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

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

Issue 165333004: Revert "Allow MessageFilters to restrict listening to specific message classes" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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 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 #include "content/browser/service_worker/service_worker_dispatcher_host.h" 5 #include "content/browser/service_worker/service_worker_dispatcher_host.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "content/browser/service_worker/embedded_worker_registry.h" 8 #include "content/browser/service_worker/embedded_worker_registry.h"
9 #include "content/browser/service_worker/service_worker_context_core.h" 9 #include "content/browser/service_worker/service_worker_context_core.h"
10 #include "content/browser/service_worker/service_worker_context_wrapper.h" 10 #include "content/browser/service_worker/service_worker_context_wrapper.h"
11 #include "content/browser/service_worker/service_worker_provider_host.h" 11 #include "content/browser/service_worker/service_worker_provider_host.h"
12 #include "content/common/service_worker/embedded_worker_messages.h" 12 #include "content/common/service_worker/embedded_worker_messages.h"
13 #include "content/common/service_worker/service_worker_messages.h" 13 #include "content/common/service_worker/service_worker_messages.h"
14 #include "ipc/ipc_message_macros.h" 14 #include "ipc/ipc_message_macros.h"
15 #include "third_party/WebKit/public/platform/WebServiceWorkerError.h" 15 #include "third_party/WebKit/public/platform/WebServiceWorkerError.h"
16 #include "url/gurl.h" 16 #include "url/gurl.h"
17 17
18 using blink::WebServiceWorkerError; 18 using blink::WebServiceWorkerError;
19 19
20 namespace { 20 namespace {
21 21
22 const char kDisabledErrorMessage[] = 22 const char kDisabledErrorMessage[] =
23 "ServiceWorker is disabled"; 23 "ServiceWorker is disabled";
24 const char kDomainMismatchErrorMessage[] = 24 const char kDomainMismatchErrorMessage[] =
25 "Scope and scripts do not have the same origin"; 25 "Scope and scripts do not have the same origin";
26 26
27 const uint32 kFilteredMessageClasses[] = {
28 ServiceWorkerMsgStart,
29 EmbeddedWorkerMsgStart,
30 };
31
32 } // namespace 27 } // namespace
33 28
34 namespace content { 29 namespace content {
35 30
36 ServiceWorkerDispatcherHost::ServiceWorkerDispatcherHost( 31 ServiceWorkerDispatcherHost::ServiceWorkerDispatcherHost(
37 int render_process_id) 32 int render_process_id)
38 : BrowserMessageFilter( 33 : render_process_id_(render_process_id) {
39 kFilteredMessageClasses, arraysize(kFilteredMessageClasses)),
40 render_process_id_(render_process_id) {
41 } 34 }
42 35
43 ServiceWorkerDispatcherHost::~ServiceWorkerDispatcherHost() { 36 ServiceWorkerDispatcherHost::~ServiceWorkerDispatcherHost() {
44 if (context_) { 37 if (context_) {
45 context_->RemoveAllProviderHostsForProcess(render_process_id_); 38 context_->RemoveAllProviderHostsForProcess(render_process_id_);
46 context_->embedded_worker_registry()->RemoveChildProcessSender( 39 context_->embedded_worker_registry()->RemoveChildProcessSender(
47 render_process_id_); 40 render_process_id_);
48 } 41 }
49 } 42 }
50 43
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 ServiceWorkerStatusCode status) { 225 ServiceWorkerStatusCode status) {
233 base::string16 error_message; 226 base::string16 error_message;
234 blink::WebServiceWorkerError::ErrorType error_type; 227 blink::WebServiceWorkerError::ErrorType error_type;
235 GetServiceWorkerRegistrationStatusResponse( 228 GetServiceWorkerRegistrationStatusResponse(
236 status, &error_type, &error_message); 229 status, &error_type, &error_message);
237 Send(new ServiceWorkerMsg_ServiceWorkerRegistrationError( 230 Send(new ServiceWorkerMsg_ServiceWorkerRegistrationError(
238 thread_id, request_id, error_type, error_message)); 231 thread_id, request_id, error_type, error_message));
239 } 232 }
240 233
241 } // namespace content 234 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/resolve_proxy_msg_helper.cc ('k') | content/browser/shared_worker/shared_worker_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698