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

Unified Diff: content/child/blink_platform_impl.cc

Issue 1104283002: [Background Sync] Add renderer code to interface between JS API and back-end service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bgsync-mojo
Patch Set: Better scoped_ptr construction (nit) Created 5 years, 7 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
« no previous file with comments | « content/child/blink_platform_impl.h ('k') | content/content_child.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/blink_platform_impl.cc
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc
index 9e33ff8b4d312c0f83ac8d4a55f5bacea4ce67db..764513c4b29e2df6fb35ee560c91eb829f41c108 100644
--- a/content/child/blink_platform_impl.cc
+++ b/content/child/blink_platform_impl.cc
@@ -33,6 +33,8 @@
#include "components/scheduler/child/webthread_impl_for_worker_scheduler.h"
#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/bluetooth/web_bluetooth_impl.h"
#include "content/child/child_thread_impl.h"
#include "content/child/content_child_helpers.h"
@@ -455,6 +457,8 @@ 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()));
}
if (main_thread_task_runner_.get()) {
@@ -1200,6 +1204,17 @@ blink::WebPermissionClient* BlinkPlatformImpl::permissionClient() {
main_thread_task_runner_.get(), permission_client_.get());
}
+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());
+}
+
WebThemeEngine* BlinkPlatformImpl::themeEngine() {
return &native_theme_engine_;
}
« no previous file with comments | « content/child/blink_platform_impl.h ('k') | content/content_child.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698