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

Unified Diff: content/child/blink_platform_impl.cc

Issue 1358063004: Use mojo to connect to BackgroundSyncManager object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make platform impl control cleanup of main thread provider Created 5 years, 2 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: content/child/blink_platform_impl.cc
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc
index c8f41688a6fb8017f9075e160af300c0d5673640..ed82c3b17cea393c5bfca2540e5c6ab578189c8c 100644
--- a/content/child/blink_platform_impl.cc
+++ b/content/child/blink_platform_impl.cc
@@ -38,7 +38,6 @@
#include "content/app/resources/grit/content_resources.h"
#include "content/app/strings/grit/content_strings.h"
#include "content/child/background_sync/background_sync_provider.h"
-#include "content/child/background_sync/background_sync_provider_thread_proxy.h"
#include "content/child/child_thread_impl.h"
#include "content/child/content_child_helpers.h"
#include "content/child/geofencing/web_geofencing_provider_impl.h"
@@ -459,8 +458,9 @@ void BlinkPlatformImpl::InternalInit() {
push_dispatcher_ = ChildThreadImpl::current()->push_dispatcher();
permission_client_.reset(new PermissionDispatcher(
ChildThreadImpl::current()->service_registry()));
- sync_provider_.reset(new BackgroundSyncProvider(
- ChildThreadImpl::current()->service_registry()));
+ main_thread_sync_provider_.reset(
+ BackgroundSyncProvider::GetOrCreateThreadSpecificInstance(
+ main_thread_task_runner_.get()));
}
}
@@ -1213,14 +1213,8 @@ blink::WebPermissionClient* BlinkPlatformImpl::permissionClient() {
}
blink::WebSyncProvider* BlinkPlatformImpl::backgroundSyncProvider() {
- if (!sync_provider_.get())
- return nullptr;
-
- if (IsMainThread())
- return sync_provider_.get();
-
- return BackgroundSyncProviderThreadProxy::GetThreadInstance(
- main_thread_task_runner_.get(), sync_provider_.get());
+ return BackgroundSyncProvider::GetOrCreateThreadSpecificInstance(
+ main_thread_task_runner_.get());
}
WebThemeEngine* BlinkPlatformImpl::themeEngine() {

Powered by Google App Engine
This is Rietveld 408576698