forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Defer ServiceWorker update checks until after browser startup is comp…
…lete. Also implement after startup task deferral more reasonably on android. Now its based on a signal from DeferredStartupHandler.java instead of an arbitrary 10 second timer. BUG=460265 Review URL: https://codereview.chromium.org/1078283002 Cr-Commit-Position: refs/heads/master@{#342768}
- Loading branch information
michaeln
authored and
Commit bot
committed
Aug 11, 2015
1 parent
698215b
commit 68bf4a8
Showing
12 changed files
with
98 additions
and
4 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
chrome/android/java/src/org/chromium/chrome/browser/AfterStartupTaskUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2015 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package org.chromium.chrome.browser; | ||
|
||
/** | ||
* JNI call glue for AfterStartupTaskUtils in C++. | ||
*/ | ||
public final class AfterStartupTaskUtils { | ||
private AfterStartupTaskUtils() {} | ||
|
||
/** | ||
* Informs the C++ side that startup is complete. Tasks that | ||
* have been deferred until after startup will be scheduled | ||
* to run and newly posted tasks will no longer be deferred. | ||
*/ | ||
public static void setStartupComplete() { | ||
nativeSetStartupComplete(); | ||
} | ||
|
||
private static native void nativeSetStartupComplete(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2015 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "chrome/browser/after_startup_task_utils_android.h" | ||
|
||
#include "chrome/browser/after_startup_task_utils.h" | ||
#include "jni/AfterStartupTaskUtils_jni.h" | ||
|
||
namespace android { | ||
|
||
class AfterStartupTaskUtilsJNI { | ||
public: | ||
static void SetBrowserStartupIsComplete() { | ||
AfterStartupTaskUtils::SetBrowserStartupIsComplete(); | ||
} | ||
}; | ||
|
||
} // android | ||
|
||
static void SetStartupComplete(JNIEnv* env, jclass obj) { | ||
android::AfterStartupTaskUtilsJNI::SetBrowserStartupIsComplete(); | ||
} | ||
|
||
bool RegisterAfterStartupTaskUtilsJNI(JNIEnv* env) { | ||
return RegisterNativesImpl(env); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright 2015 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROME_BROWSER_AFTER_STARTUP_TASK_UTILS_ANDROID_H_ | ||
#define CHROME_BROWSER_AFTER_STARTUP_TASK_UTILS_ANDROID_H_ | ||
|
||
#include <jni.h> | ||
|
||
bool RegisterAfterStartupTaskUtilsJNI(JNIEnv* env); | ||
|
||
#endif // CHROME_BROWSER_AFTER_STARTUP_TASK_UTILS_ANDROID_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters