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

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

Issue 1960843002: [OnionSoup] Move background_sync.mojom from //content to //third_party/WebKit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address dcheng@'s comment Created 4 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 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_H_ 5 #ifndef CONTENT_CHILD_BACKGROUND_SYNC_BACKGROUND_SYNC_PROVIDER_H_
6 #define CONTENT_CHILD_BACKGROUND_SYNC_BACKGROUND_SYNC_PROVIDER_H_ 6 #define CONTENT_CHILD_BACKGROUND_SYNC_BACKGROUND_SYNC_PROVIDER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <string> 11 #include <string>
12 12
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "content/common/background_sync_service.mojom.h"
15 #include "content/public/child/worker_thread.h" 14 #include "content/public/child/worker_thread.h"
16 #include "third_party/WebKit/public/platform/modules/background_sync/WebSyncProv ider.h" 15 #include "third_party/WebKit/public/platform/modules/background_sync/WebSyncProv ider.h"
16 #include "third_party/WebKit/public/platform/modules/background_sync/background_ sync.mojom.h"
17 17
18 namespace base { 18 namespace base {
19 class SingleThreadTaskRunner; 19 class SingleThreadTaskRunner;
20 } 20 }
21 21
22 namespace content { 22 namespace content {
23 23
24 // The BackgroundSyncProvider is called by the SyncManager and SyncRegistration 24 // The BackgroundSyncProvider is called by the SyncManager and SyncRegistration
25 // objects and communicates with the BackgroundSyncManager object in the browser 25 // objects and communicates with the BackgroundSyncManager object in the browser
26 // process. Each thread will have its own instance (e.g. main thread, worker 26 // process. Each thread will have its own instance (e.g. main thread, worker
(...skipping 26 matching lines...) Expand all
53 blink::WebServiceWorkerRegistration* service_worker_registration, 53 blink::WebServiceWorkerRegistration* service_worker_registration,
54 blink::WebSyncGetRegistrationsCallbacks* callbacks) override; 54 blink::WebSyncGetRegistrationsCallbacks* callbacks) override;
55 55
56 // WorkerThread::Observer implementation. 56 // WorkerThread::Observer implementation.
57 void WillStopCurrentWorkerThread() override; 57 void WillStopCurrentWorkerThread() override;
58 58
59 private: 59 private:
60 // Callback handlers 60 // Callback handlers
61 void RegisterCallback( 61 void RegisterCallback(
62 std::unique_ptr<blink::WebSyncRegistrationCallbacks> callbacks, 62 std::unique_ptr<blink::WebSyncRegistrationCallbacks> callbacks,
63 mojom::BackgroundSyncError error, 63 blink::mojom::BackgroundSyncError error,
64 const mojom::SyncRegistrationPtr& options); 64 const blink::mojom::SyncRegistrationPtr& options);
65 void GetRegistrationsCallback( 65 void GetRegistrationsCallback(
66 std::unique_ptr<blink::WebSyncGetRegistrationsCallbacks> callbacks, 66 std::unique_ptr<blink::WebSyncGetRegistrationsCallbacks> callbacks,
67 mojom::BackgroundSyncError error, 67 blink::mojom::BackgroundSyncError error,
68 const mojo::Array<mojom::SyncRegistrationPtr>& registrations); 68 const mojo::Array<blink::mojom::SyncRegistrationPtr>& registrations);
69 69
70 // Helper method that returns an initialized BackgroundSyncServicePtr. 70 // Helper method that returns an initialized BackgroundSyncServicePtr.
71 mojom::BackgroundSyncServicePtr& GetBackgroundSyncServicePtr(); 71 blink::mojom::BackgroundSyncServicePtr& GetBackgroundSyncServicePtr();
72 72
73 mojom::BackgroundSyncServicePtr background_sync_service_; 73 blink::mojom::BackgroundSyncServicePtr background_sync_service_;
74 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; 74 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
75 75
76 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncProvider); 76 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncProvider);
77 }; 77 };
78 78
79 } // namespace content 79 } // namespace content
80 80
81 #endif // CONTENT_CHILD_BACKGROUND_SYNC_BACKGROUND_SYNC_PROVIDER_H_ 81 #endif // CONTENT_CHILD_BACKGROUND_SYNC_BACKGROUND_SYNC_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698