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

Side by Side Diff: content/renderer/service_worker/service_worker_context_client.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ 5 #ifndef CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_
6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ 6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <map> 11 #include <map>
12 #include <memory> 12 #include <memory>
13 #include <string> 13 #include <string>
14 #include <vector> 14 #include <vector>
15 15
16 #include "base/id_map.h" 16 #include "base/id_map.h"
17 #include "base/macros.h" 17 #include "base/macros.h"
18 #include "base/memory/ref_counted.h" 18 #include "base/memory/ref_counted.h"
19 #include "base/strings/string16.h" 19 #include "base/strings/string16.h"
20 #include "base/time/time.h" 20 #include "base/time/time.h"
21 #include "content/child/webmessageportchannel_impl.h" 21 #include "content/child/webmessageportchannel_impl.h"
22 #include "content/common/service_worker/service_worker_types.h" 22 #include "content/common/service_worker/service_worker_types.h"
23 #include "content/public/common/service_worker_event_status.mojom.h"
24 #include "ipc/ipc_listener.h" 23 #include "ipc/ipc_listener.h"
25 #include "services/shell/public/interfaces/interface_provider.mojom.h" 24 #include "services/shell/public/interfaces/interface_provider.mojom.h"
26 #include "third_party/WebKit/public/platform/WebGeofencingEventType.h" 25 #include "third_party/WebKit/public/platform/WebGeofencingEventType.h"
27 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" 26 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h"
28 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerError.h" 27 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerError.h"
28 #include "third_party/WebKit/public/platform/modules/serviceworker/service_worke r_event_status.mojom.h"
29 #include "third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerCo ntextClient.h" 29 #include "third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerCo ntextClient.h"
30 #include "third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerCo ntextProxy.h" 30 #include "third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerCo ntextProxy.h"
31 #include "v8/include/v8.h" 31 #include "v8/include/v8.h"
32 32
33 struct ServiceWorkerMsg_ExtendableMessageEvent_Params; 33 struct ServiceWorkerMsg_ExtendableMessageEvent_Params;
34 34
35 namespace base { 35 namespace base {
36 class SingleThreadTaskRunner; 36 class SingleThreadTaskRunner;
37 class TaskRunner; 37 class TaskRunner;
38 } 38 }
(...skipping 19 matching lines...) Expand all
58 class ServiceWorkerProviderContext; 58 class ServiceWorkerProviderContext;
59 class ServiceWorkerContextClient; 59 class ServiceWorkerContextClient;
60 class ThreadSafeSender; 60 class ThreadSafeSender;
61 class WebServiceWorkerRegistrationImpl; 61 class WebServiceWorkerRegistrationImpl;
62 62
63 // This class provides access to/from an ServiceWorker's WorkerGlobalScope. 63 // This class provides access to/from an ServiceWorker's WorkerGlobalScope.
64 // Unless otherwise noted, all methods are called on the worker thread. 64 // Unless otherwise noted, all methods are called on the worker thread.
65 class ServiceWorkerContextClient 65 class ServiceWorkerContextClient
66 : public blink::WebServiceWorkerContextClient { 66 : public blink::WebServiceWorkerContextClient {
67 public: 67 public:
68 using SyncCallback = mojo::Callback<void(mojom::ServiceWorkerEventStatus)>; 68 using SyncCallback =
69 mojo::Callback<void(blink::mojom::ServiceWorkerEventStatus)>;
69 70
70 // Returns a thread-specific client instance. This does NOT create a 71 // Returns a thread-specific client instance. This does NOT create a
71 // new instance. 72 // new instance.
72 static ServiceWorkerContextClient* ThreadSpecificInstance(); 73 static ServiceWorkerContextClient* ThreadSpecificInstance();
73 74
74 // Called on the main thread. 75 // Called on the main thread.
75 ServiceWorkerContextClient(int embedded_worker_id, 76 ServiceWorkerContextClient(int embedded_worker_id,
76 int64_t service_worker_version_id, 77 int64_t service_worker_version_id,
77 const GURL& service_worker_scope, 78 const GURL& service_worker_scope,
78 const GURL& script_url, 79 const GURL& script_url,
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 // Initialized on the worker thread in workerContextStarted and 251 // Initialized on the worker thread in workerContextStarted and
251 // destructed on the worker thread in willDestroyWorkerContext. 252 // destructed on the worker thread in willDestroyWorkerContext.
252 std::unique_ptr<WorkerContextData> context_; 253 std::unique_ptr<WorkerContextData> context_;
253 254
254 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient); 255 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient);
255 }; 256 };
256 257
257 } // namespace content 258 } // namespace content
258 259
259 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ 260 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698