Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1497)

Unified Diff: chrome/browser/android/offline_pages/background_scheduler_bridge.cc

Issue 2054913002: hook up background task's "startProcessing" from Java to request_coordinator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/offline_pages/background_scheduler_bridge.cc
diff --git a/chrome/browser/android/offline_pages/background_scheduler_bridge.cc b/chrome/browser/android/offline_pages/background_scheduler_bridge.cc
index 3075cb2ab30c79e13a67a6aad0383c60a64c8ca4..b92b5bb24b3f7c6d4cfd389a432d9ec808c0ff98 100644
--- a/chrome/browser/android/offline_pages/background_scheduler_bridge.cc
+++ b/chrome/browser/android/offline_pages/background_scheduler_bridge.cc
@@ -8,7 +8,7 @@
#include "chrome/browser/android/offline_pages/offline_page_model_factory.h"
#include "chrome/browser/android/offline_pages/request_coordinator_factory.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/profiles/profile_android.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "components/offline_pages/background/request_coordinator.h"
#include "jni/BackgroundSchedulerBridge_jni.h"
@@ -21,7 +21,7 @@ namespace {
// C++ callback that delegates to Java callback.
void ProcessingDoneCallback(
- const ScopedJavaGlobalRef<jobject>& j_callback_obj, jboolean result) {
+ const ScopedJavaGlobalRef<jobject>& j_callback_obj, bool result) {
base::android::RunCallbackAndroid(j_callback_obj, result);
}
@@ -34,6 +34,18 @@ static jboolean StartProcessing(
const JavaParamRef<jobject>& j_callback_obj) {
ScopedJavaGlobalRef<jobject> j_callback_ref;
j_callback_ref.Reset(env, j_callback_obj);
+
+ // Lookup/create RequestCoordinator KeyedService and call StartProcessing on
+ // it with bound j_callback_obj.
+Profile* profile = ProfileManager::GetLastUsedProfile();
dougarnett 2016/06/09 21:54:27 indent
Pete Williamson 2016/06/09 22:09:48 Done.
+ RequestCoordinator* coordinator =
+ RequestCoordinatorFactory::GetInstance()->
+ GetForBrowserContext(profile);
+ DVLOG(2) << "resource_coordinator: " << coordinator;
+ coordinator->StartProcessing(
+ base::Bind(&ProcessingDoneCallback, j_callback_ref));
+
+
base::Bind(&ProcessingDoneCallback, j_callback_ref);
// TODO(dougarnett): lookup/create RequestCoordinator KeyedService
// and call StartProcessing on it with bound j_callback_obj.

Powered by Google App Engine
This is Rietveld 408576698