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

Side by Side Diff: content/renderer/service_worker/service_worker_script_context.h

Issue 785133006: Enable messaging over a navigator.connect initiated channel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigator-connect_serviceside
Patch Set: add empty line Created 6 years 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_SCRIPT_CONTEXT_H_ 5 #ifndef CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_
6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ 6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/id_map.h" 13 #include "base/id_map.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "content/child/webmessageportchannel_impl.h" 17 #include "content/child/webmessageportchannel_impl.h"
18 #include "content/common/service_worker/service_worker_types.h" 18 #include "content/common/service_worker/service_worker_types.h"
19 #include "content/renderer/service_worker/service_worker_cache_storage_dispatche r.h" 19 #include "content/renderer/service_worker/service_worker_cache_storage_dispatche r.h"
20 #include "third_party/WebKit/public/platform/WebGeofencingEventType.h" 20 #include "third_party/WebKit/public/platform/WebGeofencingEventType.h"
21 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" 21 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h"
22 #include "third_party/WebKit/public/platform/WebServiceWorkerClientFocusCallback .h" 22 #include "third_party/WebKit/public/platform/WebServiceWorkerClientFocusCallback .h"
23 #include "third_party/WebKit/public/platform/WebServiceWorkerClientsInfo.h" 23 #include "third_party/WebKit/public/platform/WebServiceWorkerClientsInfo.h"
24 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h" 24 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h"
25 #include "third_party/WebKit/public/platform/WebServiceWorkerSkipWaitingCallback s.h" 25 #include "third_party/WebKit/public/platform/WebServiceWorkerSkipWaitingCallback s.h"
26 26
27 namespace blink { 27 namespace blink {
28 struct WebCircularGeofencingRegion; 28 struct WebCircularGeofencingRegion;
29 struct WebCrossOriginServiceWorkerClient;
29 class WebServiceWorkerContextProxy; 30 class WebServiceWorkerContextProxy;
30 } 31 }
31 32
32 namespace IPC { 33 namespace IPC {
33 class Message; 34 class Message;
34 } 35 }
35 36
36 namespace content { 37 namespace content {
37 38
38 struct CrossOriginServiceWorkerClient; 39 struct CrossOriginServiceWorkerClient;
(...skipping 26 matching lines...) Expand all
65 void DidHandlePushEvent(int request_id, 66 void DidHandlePushEvent(int request_id,
66 blink::WebServiceWorkerEventResult result); 67 blink::WebServiceWorkerEventResult result);
67 void DidHandleSyncEvent(int request_id); 68 void DidHandleSyncEvent(int request_id);
68 void DidHandleCrossOriginConnectEvent(int request_id, bool accept_connection); 69 void DidHandleCrossOriginConnectEvent(int request_id, bool accept_connection);
69 void GetClientDocuments( 70 void GetClientDocuments(
70 blink::WebServiceWorkerClientsCallbacks* callbacks); 71 blink::WebServiceWorkerClientsCallbacks* callbacks);
71 void PostMessageToDocument( 72 void PostMessageToDocument(
72 int client_id, 73 int client_id,
73 const base::string16& message, 74 const base::string16& message,
74 scoped_ptr<blink::WebMessagePortChannelArray> channels); 75 scoped_ptr<blink::WebMessagePortChannelArray> channels);
76 void PostCrossOriginMessageToClient(
77 const blink::WebCrossOriginServiceWorkerClient& client,
78 const base::string16& message,
79 scoped_ptr<blink::WebMessagePortChannelArray> channels);
75 void FocusClient(int client_id, 80 void FocusClient(int client_id,
76 blink::WebServiceWorkerClientFocusCallback* callback); 81 blink::WebServiceWorkerClientFocusCallback* callback);
77 void SkipWaiting(blink::WebServiceWorkerSkipWaitingCallbacks* callbacks); 82 void SkipWaiting(blink::WebServiceWorkerSkipWaitingCallbacks* callbacks);
78 83
79 // Send a message to the browser. Takes ownership of |message|. 84 // Send a message to the browser. Takes ownership of |message|.
80 void Send(IPC::Message* message); 85 void Send(IPC::Message* message);
81 86
82 // Get routing_id for sending message to the ServiceWorkerVersion 87 // Get routing_id for sending message to the ServiceWorkerVersion
83 // in the browser process. 88 // in the browser process.
84 int GetRoutingID() const; 89 int GetRoutingID() const;
(...skipping 21 matching lines...) Expand all
106 void OnPushEvent(int request_id, const std::string& data); 111 void OnPushEvent(int request_id, const std::string& data);
107 void OnGeofencingEvent(int request_id, 112 void OnGeofencingEvent(int request_id,
108 blink::WebGeofencingEventType event_type, 113 blink::WebGeofencingEventType event_type,
109 const std::string& region_id, 114 const std::string& region_id,
110 const blink::WebCircularGeofencingRegion& region); 115 const blink::WebCircularGeofencingRegion& region);
111 void OnCrossOriginConnectEvent(int request_id, 116 void OnCrossOriginConnectEvent(int request_id,
112 const CrossOriginServiceWorkerClient& client); 117 const CrossOriginServiceWorkerClient& client);
113 void OnPostMessage(const base::string16& message, 118 void OnPostMessage(const base::string16& message,
114 const std::vector<int>& sent_message_port_ids, 119 const std::vector<int>& sent_message_port_ids,
115 const std::vector<int>& new_routing_ids); 120 const std::vector<int>& new_routing_ids);
121 void OnCrossOriginMessageToWorker(
122 const CrossOriginServiceWorkerClient& client,
123 const base::string16& message,
124 const std::vector<int>& sent_message_port_ids,
125 const std::vector<int>& new_routing_ids);
116 void OnDidGetClientDocuments( 126 void OnDidGetClientDocuments(
117 int request_id, const std::vector<ServiceWorkerClientInfo>& clients); 127 int request_id, const std::vector<ServiceWorkerClientInfo>& clients);
118 void OnFocusClientResponse(int request_id, bool result); 128 void OnFocusClientResponse(int request_id, bool result);
119 void OnDidSkipWaiting(int request_id); 129 void OnDidSkipWaiting(int request_id);
120 130
121 scoped_ptr<ServiceWorkerCacheStorageDispatcher> cache_storage_dispatcher_; 131 scoped_ptr<ServiceWorkerCacheStorageDispatcher> cache_storage_dispatcher_;
122 132
123 // Not owned; embedded_context_ owns this. 133 // Not owned; embedded_context_ owns this.
124 EmbeddedWorkerContextClient* embedded_context_; 134 EmbeddedWorkerContextClient* embedded_context_;
125 135
(...skipping 20 matching lines...) Expand all
146 std::map<int, base::TimeTicks> install_start_timings_; 156 std::map<int, base::TimeTicks> install_start_timings_;
147 std::map<int, base::TimeTicks> notification_click_start_timings_; 157 std::map<int, base::TimeTicks> notification_click_start_timings_;
148 std::map<int, base::TimeTicks> push_start_timings_; 158 std::map<int, base::TimeTicks> push_start_timings_;
149 159
150 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext); 160 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext);
151 }; 161 };
152 162
153 } // namespace content 163 } // namespace content
154 164
155 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ 165 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698