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

Side by Side Diff: content/child/background_sync/background_sync_provider_thread_proxy.h

Issue 1282013004: BackgroundSyncManager tracks client registrations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed test Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_CHILD_BACKGROUND_SYNC_BACKGROUND_SYNC_PROVIDER_THREAD_PROXY_H_ 5 #ifndef CONTENT_CHILD_BACKGROUND_SYNC_BACKGROUND_SYNC_PROVIDER_THREAD_PROXY_H_
6 #define CONTENT_CHILD_BACKGROUND_SYNC_BACKGROUND_SYNC_PROVIDER_THREAD_PROXY_H_ 6 #define CONTENT_CHILD_BACKGROUND_SYNC_BACKGROUND_SYNC_PROVIDER_THREAD_PROXY_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "content/child/worker_task_runner.h" 9 #include "content/child/worker_task_runner.h"
10 #include "content/common/background_sync_service.mojom.h"
10 #include "content/public/child/worker_thread.h" 11 #include "content/public/child/worker_thread.h"
11 #include "third_party/WebKit/public/platform/modules/background_sync/WebSyncProv ider.h" 12 #include "third_party/WebKit/public/platform/modules/background_sync/WebSyncProv ider.h"
12 13
13 namespace base { 14 namespace base {
14 class SingleThreadTaskRunner; 15 class SingleThreadTaskRunner;
15 } 16 }
16 17
17 namespace content { 18 namespace content {
18 19
19 class BackgroundSyncProvider; 20 class BackgroundSyncProvider;
(...skipping 30 matching lines...) Expand all
50 blink::WebServiceWorkerRegistration* service_worker_registration, 51 blink::WebServiceWorkerRegistration* service_worker_registration,
51 blink::WebSyncRegistrationCallbacks* callbacks); 52 blink::WebSyncRegistrationCallbacks* callbacks);
52 void getRegistrations( 53 void getRegistrations(
53 blink::WebSyncRegistration::Periodicity periodicity, 54 blink::WebSyncRegistration::Periodicity periodicity,
54 blink::WebServiceWorkerRegistration* service_worker_registration, 55 blink::WebServiceWorkerRegistration* service_worker_registration,
55 blink::WebSyncGetRegistrationsCallbacks* callbacks); 56 blink::WebSyncGetRegistrationsCallbacks* callbacks);
56 void getPermissionStatus( 57 void getPermissionStatus(
57 blink::WebSyncRegistration::Periodicity periodicity, 58 blink::WebSyncRegistration::Periodicity periodicity,
58 blink::WebServiceWorkerRegistration* service_worker_registration, 59 blink::WebServiceWorkerRegistration* service_worker_registration,
59 blink::WebSyncGetPermissionStatusCallbacks* callbacks); 60 blink::WebSyncGetPermissionStatusCallbacks* callbacks);
61 void releaseRegistration(int64_t handle_id);
62
63 // Given |handle_id|, ask the provider for a new handle with the same
64 // underlying registration.
65 void DuplicateRegistrationHandle(
66 int64 handle_id,
67 const BackgroundSyncService::DuplicateRegistrationHandleCallback&
68 callback);
60 69
61 // WorkerThread::Observer implementation. 70 // WorkerThread::Observer implementation.
62 void WillStopCurrentWorkerThread() override; 71 void WillStopCurrentWorkerThread() override;
63 72
64 private: 73 private:
65 BackgroundSyncProviderThreadProxy( 74 BackgroundSyncProviderThreadProxy(
66 base::SingleThreadTaskRunner* main_thread_task_runner, 75 base::SingleThreadTaskRunner* main_thread_task_runner,
67 BackgroundSyncProvider* sync_provider); 76 BackgroundSyncProvider* sync_provider);
68 77
69 virtual ~BackgroundSyncProviderThreadProxy(); 78 virtual ~BackgroundSyncProviderThreadProxy();
70 79
71 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; 80 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
72 81
73 // This belongs to the renderer main thread, (created by BlinkPlatformImpl) 82 // This belongs to the renderer main thread, (created by BlinkPlatformImpl)
74 // and so should outlive the BackgroundSyncProviderThreadProxy, which is 83 // and so should outlive the BackgroundSyncProviderThreadProxy, which is
75 // created for a worker thread. 84 // created for a worker thread.
76 BackgroundSyncProvider* sync_provider_; 85 BackgroundSyncProvider* sync_provider_;
77 86
78 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncProviderThreadProxy); 87 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncProviderThreadProxy);
79 }; 88 };
80 89
81 } // namespace content 90 } // namespace content
82 91
83 #endif // CONTENT_CHILD_BACKGROUND_SYNC_BACKGROUND_SYNC_PROVIDER_THREAD_PROXY_H _ 92 #endif // CONTENT_CHILD_BACKGROUND_SYNC_BACKGROUND_SYNC_PROVIDER_THREAD_PROXY_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698