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

Side by Side Diff: content/browser/service_worker/service_worker_dispatcher_host.h

Issue 325173002: ServiceWorker: Confirm the liveness of the associated context before handling message (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_
7 7
8 #include "base/id_map.h" 8 #include "base/id_map.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
11 #include "content/browser/service_worker/service_worker_registration_status.h" 11 #include "content/browser/service_worker/service_worker_registration_status.h"
12 #include "content/public/browser/browser_message_filter.h" 12 #include "content/public/browser/browser_message_filter.h"
13 13
14 class GURL; 14 class GURL;
15 struct EmbeddedWorkerHostMsg_ReportConsoleMessage_Params; 15 struct EmbeddedWorkerHostMsg_ReportConsoleMessage_Params;
16 16
17 namespace content { 17 namespace content {
18 18
19 class MessagePortMessageFilter; 19 class MessagePortMessageFilter;
20 class ServiceWorkerContextCore; 20 class ServiceWorkerContextCore;
21 class ServiceWorkerContextWrapper; 21 class ServiceWorkerContextWrapper;
22 class ServiceWorkerHandle; 22 class ServiceWorkerHandle;
23 class ServiceWorkerProviderHost; 23 class ServiceWorkerProviderHost;
24 class ServiceWorkerProviderHostRegistry;
24 class ServiceWorkerRegistration; 25 class ServiceWorkerRegistration;
25 26
26 class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { 27 class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter {
27 public: 28 public:
28 ServiceWorkerDispatcherHost( 29 ServiceWorkerDispatcherHost(
29 int render_process_id, 30 int render_process_id,
30 MessagePortMessageFilter* message_port_message_filter); 31 MessagePortMessageFilter* message_port_message_filter);
31 32
32 void Init(ServiceWorkerContextWrapper* context_wrapper); 33 void Init(ServiceWorkerContextWrapper* context_wrapper);
33 34
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 104
104 void UnregistrationComplete(int thread_id, 105 void UnregistrationComplete(int thread_id,
105 int request_id, 106 int request_id,
106 ServiceWorkerStatusCode status); 107 ServiceWorkerStatusCode status);
107 108
108 void SendRegistrationError(int thread_id, 109 void SendRegistrationError(int thread_id,
109 int request_id, 110 int request_id,
110 ServiceWorkerStatusCode status); 111 ServiceWorkerStatusCode status);
111 112
112 ServiceWorkerContextCore* GetContext(); 113 ServiceWorkerContextCore* GetContext();
114 ServiceWorkerProviderHostRegistry* GetProviderRegistry();
113 115
114 int render_process_id_; 116 int render_process_id_;
115 MessagePortMessageFilter* const message_port_message_filter_; 117 MessagePortMessageFilter* const message_port_message_filter_;
116 scoped_refptr<ServiceWorkerContextWrapper> context_wrapper_; 118 scoped_refptr<ServiceWorkerContextWrapper> context_wrapper_;
117 119
118 IDMap<ServiceWorkerHandle, IDMapOwnPointer> handles_; 120 IDMap<ServiceWorkerHandle, IDMapOwnPointer> handles_;
119 121
120 bool channel_ready_; // True after BrowserMessageFilter::channel_ != NULL. 122 bool channel_ready_; // True after BrowserMessageFilter::channel_ != NULL.
121 ScopedVector<IPC::Message> pending_messages_; 123 ScopedVector<IPC::Message> pending_messages_;
122 124
123 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); 125 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost);
124 }; 126 };
125 127
126 } // namespace content 128 } // namespace content
127 129
128 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ 130 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698