OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/worker_host/worker_process_host.h" | 5 #include "content/browser/worker_host/worker_process_host.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/base_switches.h" | 11 #include "base/base_switches.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/message_loop.h" | 16 #include "base/message_loop.h" |
17 #include "base/string_util.h" | 17 #include "base/string_util.h" |
18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
19 #include "content/browser/appcache/appcache_dispatcher_host.h" | 19 #include "content/browser/appcache/appcache_dispatcher_host.h" |
20 #include "content/browser/appcache/chrome_appcache_service.h" | 20 #include "content/browser/appcache/chrome_appcache_service.h" |
21 #include "content/browser/browser_child_process_host_impl.h" | 21 #include "content/browser/browser_child_process_host_impl.h" |
22 #include "content/browser/child_process_security_policy_impl.h" | 22 #include "content/browser/child_process_security_policy_impl.h" |
23 #include "content/browser/debugger/worker_devtools_manager.h" | 23 #include "content/browser/debugger/worker_devtools_manager.h" |
24 #include "content/browser/debugger/worker_devtools_message_filter.h" | 24 #include "content/browser/debugger/worker_devtools_message_filter.h" |
25 #include "content/browser/fileapi/fileapi_message_filter.h" | 25 #include "content/browser/fileapi/fileapi_message_filter.h" |
26 #include "content/browser/in_process_webkit/indexed_db_context_impl.h" | |
26 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" | 27 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" |
27 #include "content/browser/mime_registry_message_filter.h" | 28 #include "content/browser/mime_registry_message_filter.h" |
28 #include "content/browser/renderer_host/database_message_filter.h" | 29 #include "content/browser/renderer_host/database_message_filter.h" |
29 #include "content/browser/renderer_host/file_utilities_message_filter.h" | 30 #include "content/browser/renderer_host/file_utilities_message_filter.h" |
30 #include "content/browser/renderer_host/render_view_host_delegate.h" | 31 #include "content/browser/renderer_host/render_view_host_delegate.h" |
31 #include "content/browser/renderer_host/render_view_host_impl.h" | 32 #include "content/browser/renderer_host/render_view_host_impl.h" |
32 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" | 33 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" |
33 #include "content/browser/resource_context_impl.h" | 34 #include "content/browser/resource_context_impl.h" |
35 #include "content/browser/storage_partition_impl.h" | |
34 #include "content/browser/worker_host/message_port_service.h" | 36 #include "content/browser/worker_host/message_port_service.h" |
35 #include "content/browser/worker_host/worker_message_filter.h" | 37 #include "content/browser/worker_host/worker_message_filter.h" |
36 #include "content/browser/worker_host/worker_service_impl.h" | 38 #include "content/browser/worker_host/worker_service_impl.h" |
37 #include "content/common/child_process_host_impl.h" | 39 #include "content/common/child_process_host_impl.h" |
38 #include "content/common/debug_flags.h" | 40 #include "content/common/debug_flags.h" |
39 #include "content/common/view_messages.h" | 41 #include "content/common/view_messages.h" |
40 #include "content/common/worker_messages.h" | 42 #include "content/common/worker_messages.h" |
41 #include "content/public/browser/browser_thread.h" | 43 #include "content/public/browser/browser_thread.h" |
42 #include "content/public/browser/content_browser_client.h" | 44 #include "content/public/browser/content_browser_client.h" |
43 #include "content/public/browser/user_metrics.h" | 45 #include "content/public/browser/user_metrics.h" |
44 #include "content/public/common/content_switches.h" | 46 #include "content/public/common/content_switches.h" |
45 #include "content/public/common/result_codes.h" | 47 #include "content/public/common/result_codes.h" |
46 #include "ipc/ipc_switches.h" | 48 #include "ipc/ipc_switches.h" |
47 #include "net/base/mime_util.h" | 49 #include "net/base/mime_util.h" |
48 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 50 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
49 #include "ui/base/ui_base_switches.h" | 51 #include "ui/base/ui_base_switches.h" |
50 #include "webkit/fileapi/file_system_context.h" | 52 #include "webkit/fileapi/file_system_context.h" |
51 #include "webkit/fileapi/sandbox_mount_point_provider.h" | 53 #include "webkit/fileapi/sandbox_mount_point_provider.h" |
52 #include "webkit/glue/resource_type.h" | 54 #include "webkit/glue/resource_type.h" |
53 | 55 |
54 using content::BrowserThread; | 56 using content::BrowserThread; |
55 using content::ChildProcessData; | 57 using content::ChildProcessData; |
56 using content::ChildProcessHost; | 58 using content::ChildProcessHost; |
57 using content::RenderViewHostImpl; | 59 using content::RenderViewHostImpl; |
58 using content::ResourceContext; | 60 using content::ResourceContext; |
59 using content::ResourceMessageFilter; | 61 using content::ResourceMessageFilter; |
60 using content::SocketStreamDispatcherHost; | 62 using content::SocketStreamDispatcherHost; |
63 using content::StoragePartitionImpl; | |
61 using content::UserMetricsAction; | 64 using content::UserMetricsAction; |
62 using content::WorkerDevToolsManager; | 65 using content::WorkerDevToolsManager; |
63 using content::WorkerServiceImpl; | 66 using content::WorkerServiceImpl; |
64 | 67 |
65 namespace { | 68 namespace { |
66 | 69 |
67 // Helper class that we pass to SocketStreamDispatcherHost so that it can find | 70 // Helper class that we pass to SocketStreamDispatcherHost so that it can find |
68 // the right net::URLRequestContext for a request. | 71 // the right net::URLRequestContext for a request. |
69 class URLRequestContextSelector | 72 class URLRequestContextSelector |
70 : public ResourceMessageFilter::URLRequestContextSelector { | 73 : public ResourceMessageFilter::URLRequestContextSelector { |
(...skipping 16 matching lines...) Expand all Loading... | |
87 } // namespace | 90 } // namespace |
88 | 91 |
89 // Notifies RenderViewHost that one or more worker objects crashed. | 92 // Notifies RenderViewHost that one or more worker objects crashed. |
90 void WorkerCrashCallback(int render_process_unique_id, int render_view_id) { | 93 void WorkerCrashCallback(int render_process_unique_id, int render_view_id) { |
91 RenderViewHostImpl* host = | 94 RenderViewHostImpl* host = |
92 RenderViewHostImpl::FromID(render_process_unique_id, render_view_id); | 95 RenderViewHostImpl::FromID(render_process_unique_id, render_view_id); |
93 if (host) | 96 if (host) |
94 host->GetDelegate()->WorkerCrashed(); | 97 host->GetDelegate()->WorkerCrashed(); |
95 } | 98 } |
96 | 99 |
97 WorkerProcessHost::WorkerProcessHost(ResourceContext* resource_context) | 100 WorkerProcessHost::WorkerProcessHost(ResourceContext* resource_context, |
98 : resource_context_(resource_context) { | 101 StoragePartitionImpl* storage_partition) |
102 : resource_context_(resource_context), | |
103 storage_partition_(storage_partition) { | |
99 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 104 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
100 DCHECK(resource_context); | 105 DCHECK(resource_context); |
106 DCHECK(storage_partition); | |
101 process_.reset( | 107 process_.reset( |
102 new BrowserChildProcessHostImpl(content::PROCESS_TYPE_WORKER, this)); | 108 new BrowserChildProcessHostImpl(content::PROCESS_TYPE_WORKER, this)); |
103 } | 109 } |
104 | 110 |
105 WorkerProcessHost::~WorkerProcessHost() { | 111 WorkerProcessHost::~WorkerProcessHost() { |
106 // If we crashed, tell the RenderViewHosts. | 112 // If we crashed, tell the RenderViewHosts. |
107 for (Instances::iterator i = instances_.begin(); i != instances_.end(); ++i) { | 113 for (Instances::iterator i = instances_.begin(); i != instances_.end(); ++i) { |
108 const WorkerDocumentSet::DocumentInfoSet& parents = | 114 const WorkerDocumentSet::DocumentInfoSet& parents = |
109 i->worker_document_set()->documents(); | 115 i->worker_document_set()->documents(); |
110 for (WorkerDocumentSet::DocumentInfoSet::const_iterator parent_iter = | 116 for (WorkerDocumentSet::DocumentInfoSet::const_iterator parent_iter = |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
194 process_->Launch( | 200 process_->Launch( |
195 #if defined(OS_WIN) | 201 #if defined(OS_WIN) |
196 FilePath(), | 202 FilePath(), |
197 #elif defined(OS_POSIX) | 203 #elif defined(OS_POSIX) |
198 use_zygote, | 204 use_zygote, |
199 base::EnvironmentVector(), | 205 base::EnvironmentVector(), |
200 #endif | 206 #endif |
201 cmd_line); | 207 cmd_line); |
202 | 208 |
203 fileapi::FileSystemContext* file_system_context = | 209 fileapi::FileSystemContext* file_system_context = |
204 GetFileSystemContextForResourceContext(resource_context_); | 210 storage_partition_->GetFileSystemContext(); |
205 ChildProcessSecurityPolicyImpl::GetInstance()->AddWorker( | 211 ChildProcessSecurityPolicyImpl::GetInstance()->AddWorker( |
206 process_->GetData().id, render_process_id); | 212 process_->GetData().id, render_process_id); |
207 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 213 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
208 switches::kDisableFileSystem)) { | 214 switches::kDisableFileSystem)) { |
209 // Grant most file permissions to this worker. | 215 // Grant most file permissions to this worker. |
210 // PLATFORM_FILE_TEMPORARY, PLATFORM_FILE_HIDDEN and | 216 // PLATFORM_FILE_TEMPORARY, PLATFORM_FILE_HIDDEN and |
211 // PLATFORM_FILE_DELETE_ON_CLOSE are not granted, because no existing API | 217 // PLATFORM_FILE_DELETE_ON_CLOSE are not granted, because no existing API |
212 // requests them. | 218 // requests them. |
213 // This is for the filesystem sandbox. | 219 // This is for the filesystem sandbox. |
214 ChildProcessSecurityPolicyImpl::GetInstance()->GrantPermissionsForFile( | 220 ChildProcessSecurityPolicyImpl::GetInstance()->GrantPermissionsForFile( |
(...skipping 27 matching lines...) Expand all Loading... | |
242 base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_CREATE_ALWAYS | | 248 base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_CREATE_ALWAYS | |
243 base::PLATFORM_FILE_WRITE); | 249 base::PLATFORM_FILE_WRITE); |
244 } | 250 } |
245 | 251 |
246 CreateMessageFilters(render_process_id); | 252 CreateMessageFilters(render_process_id); |
247 | 253 |
248 return true; | 254 return true; |
249 } | 255 } |
250 | 256 |
251 void WorkerProcessHost::CreateMessageFilters(int render_process_id) { | 257 void WorkerProcessHost::CreateMessageFilters(int render_process_id) { |
258 // TODO(michaeln): Put ChromeBlobStorageContext in StorageParition too. | |
259 ChromeBlobStorageContext* blob_storage_context = | |
260 content::GetChromeBlobStorageContextForResourceContext( | |
261 resource_context_); | |
262 | |
263 // TODO(michaeln): this is not correct, workers will not be using the | |
264 // isolated/partitioned context. | |
252 net::URLRequestContext* request_context = | 265 net::URLRequestContext* request_context = |
253 resource_context_->GetRequestContext(); | 266 resource_context_->GetRequestContext(); |
254 | 267 |
255 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( | 268 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( |
256 process_->GetData().id, content::PROCESS_TYPE_WORKER, resource_context_, | 269 process_->GetData().id, content::PROCESS_TYPE_WORKER, resource_context_, |
270 static_cast<ChromeAppCacheService*>( | |
awong
2012/09/06 22:29:27
Also unnecessary with covariant return...
| |
271 storage_partition_->GetAppCacheService()), | |
272 blob_storage_context, | |
257 new URLRequestContextSelector(request_context)); | 273 new URLRequestContextSelector(request_context)); |
258 process_->GetHost()->AddFilter(resource_message_filter); | 274 process_->GetHost()->AddFilter(resource_message_filter); |
259 | 275 |
260 worker_message_filter_ = new WorkerMessageFilter( | 276 worker_message_filter_ = new WorkerMessageFilter( |
261 render_process_id, resource_context_, | 277 render_process_id, resource_context_, storage_partition_, |
262 base::Bind(&WorkerServiceImpl::next_worker_route_id, | 278 base::Bind(&WorkerServiceImpl::next_worker_route_id, |
263 base::Unretained(WorkerServiceImpl::GetInstance()))); | 279 base::Unretained(WorkerServiceImpl::GetInstance()))); |
264 process_->GetHost()->AddFilter(worker_message_filter_); | 280 process_->GetHost()->AddFilter(worker_message_filter_); |
265 process_->GetHost()->AddFilter(new AppCacheDispatcherHost( | 281 process_->GetHost()->AddFilter(new AppCacheDispatcherHost( |
266 static_cast<ChromeAppCacheService*>( | 282 static_cast<ChromeAppCacheService*>( |
267 ResourceContext::GetAppCacheService(resource_context_)), | 283 storage_partition_->GetAppCacheService()), |
268 process_->GetData().id)); | 284 process_->GetData().id)); |
269 process_->GetHost()->AddFilter(new FileAPIMessageFilter( | 285 process_->GetHost()->AddFilter(new FileAPIMessageFilter( |
270 process_->GetData().id, | 286 process_->GetData().id, |
271 request_context, | 287 request_context, |
272 GetFileSystemContextForResourceContext(resource_context_), | 288 storage_partition_->GetFileSystemContext(), |
273 content::GetChromeBlobStorageContextForResourceContext( | 289 blob_storage_context)); |
274 resource_context_))); | |
275 process_->GetHost()->AddFilter(new FileUtilitiesMessageFilter( | 290 process_->GetHost()->AddFilter(new FileUtilitiesMessageFilter( |
276 process_->GetData().id)); | 291 process_->GetData().id)); |
277 process_->GetHost()->AddFilter(new MimeRegistryMessageFilter()); | 292 process_->GetHost()->AddFilter(new MimeRegistryMessageFilter()); |
278 process_->GetHost()->AddFilter(new DatabaseMessageFilter( | 293 process_->GetHost()->AddFilter(new DatabaseMessageFilter( |
279 content::GetDatabaseTrackerForResourceContext(resource_context_))); | 294 storage_partition_->GetDatabaseTracker())); |
280 | 295 |
281 SocketStreamDispatcherHost* socket_stream_dispatcher_host = | 296 SocketStreamDispatcherHost* socket_stream_dispatcher_host = |
282 new SocketStreamDispatcherHost(render_process_id, | 297 new SocketStreamDispatcherHost(render_process_id, |
283 new URLRequestContextSelector(request_context), resource_context_); | 298 new URLRequestContextSelector(request_context), resource_context_); |
284 process_->GetHost()->AddFilter(socket_stream_dispatcher_host); | 299 process_->GetHost()->AddFilter(socket_stream_dispatcher_host); |
285 process_->GetHost()->AddFilter( | 300 process_->GetHost()->AddFilter( |
286 new content::WorkerDevToolsMessageFilter(process_->GetData().id)); | 301 new content::WorkerDevToolsMessageFilter(process_->GetData().id)); |
287 process_->GetHost()->AddFilter(new IndexedDBDispatcherHost( | 302 process_->GetHost()->AddFilter(new IndexedDBDispatcherHost( |
288 process_->GetData().id, | 303 process_->GetData().id, |
289 content::GetIndexedDBContextForResourceContext(resource_context_))); | 304 static_cast<IndexedDBContextImpl*>( |
305 storage_partition_->GetIndexedDBContext()))); | |
290 } | 306 } |
291 | 307 |
292 void WorkerProcessHost::CreateWorker(const WorkerInstance& instance) { | 308 void WorkerProcessHost::CreateWorker(const WorkerInstance& instance) { |
293 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( | 309 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( |
294 process_->GetData().id, instance.url()); | 310 process_->GetData().id, instance.url()); |
295 | 311 |
296 instances_.push_back(instance); | 312 instances_.push_back(instance); |
297 | 313 |
298 WorkerProcessMsg_CreateWorker_Params params; | 314 WorkerProcessMsg_CreateWorker_Params params; |
299 params.url = instance.url(); | 315 params.url = instance.url(); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
384 } | 400 } |
385 } | 401 } |
386 } | 402 } |
387 | 403 |
388 void WorkerProcessHost::OnAllowDatabase(int worker_route_id, | 404 void WorkerProcessHost::OnAllowDatabase(int worker_route_id, |
389 const GURL& url, | 405 const GURL& url, |
390 const string16& name, | 406 const string16& name, |
391 const string16& display_name, | 407 const string16& display_name, |
392 unsigned long estimated_size, | 408 unsigned long estimated_size, |
393 bool* result) { | 409 bool* result) { |
410 // FIXME: Should we introduce a SettingsContext abstraction for settings | |
411 // related things like this? | |
394 *result = content::GetContentClient()->browser()->AllowWorkerDatabase( | 412 *result = content::GetContentClient()->browser()->AllowWorkerDatabase( |
395 url, name, display_name, estimated_size, resource_context_, | 413 url, name, display_name, estimated_size, resource_context_, |
396 GetRenderViewIDsForWorker(worker_route_id)); | 414 GetRenderViewIDsForWorker(worker_route_id)); |
397 } | 415 } |
398 | 416 |
399 void WorkerProcessHost::OnAllowFileSystem(int worker_route_id, | 417 void WorkerProcessHost::OnAllowFileSystem(int worker_route_id, |
400 const GURL& url, | 418 const GURL& url, |
401 bool* result) { | 419 bool* result) { |
402 *result = content::GetContentClient()->browser()->AllowWorkerFileSystem( | 420 *result = content::GetContentClient()->browser()->AllowWorkerFileSystem( |
403 url, resource_context_, GetRenderViewIDsForWorker(worker_route_id)); | 421 url, resource_context_, GetRenderViewIDsForWorker(worker_route_id)); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
571 } | 589 } |
572 return result; | 590 return result; |
573 } | 591 } |
574 | 592 |
575 WorkerProcessHost::WorkerInstance::WorkerInstance( | 593 WorkerProcessHost::WorkerInstance::WorkerInstance( |
576 const GURL& url, | 594 const GURL& url, |
577 const string16& name, | 595 const string16& name, |
578 int worker_route_id, | 596 int worker_route_id, |
579 int parent_process_id, | 597 int parent_process_id, |
580 int64 main_resource_appcache_id, | 598 int64 main_resource_appcache_id, |
581 content::ResourceContext* resource_context) | 599 content::ResourceContext* resource_context, |
600 content::StoragePartitionImpl* storage_partition) | |
582 : url_(url), | 601 : url_(url), |
583 closed_(false), | 602 closed_(false), |
584 name_(name), | 603 name_(name), |
585 worker_route_id_(worker_route_id), | 604 worker_route_id_(worker_route_id), |
586 parent_process_id_(parent_process_id), | 605 parent_process_id_(parent_process_id), |
587 main_resource_appcache_id_(main_resource_appcache_id), | 606 main_resource_appcache_id_(main_resource_appcache_id), |
588 worker_document_set_(new WorkerDocumentSet()), | 607 worker_document_set_(new WorkerDocumentSet()), |
589 resource_context_(resource_context) { | 608 resource_context_(resource_context), |
609 storage_partition_(storage_partition) { | |
590 DCHECK(resource_context_); | 610 DCHECK(resource_context_); |
611 DCHECK(storage_partition_); | |
591 } | 612 } |
592 | 613 |
593 WorkerProcessHost::WorkerInstance::WorkerInstance( | 614 WorkerProcessHost::WorkerInstance::WorkerInstance( |
594 const GURL& url, | 615 const GURL& url, |
595 bool shared, | 616 bool shared, |
596 const string16& name, | 617 const string16& name, |
597 content::ResourceContext* resource_context) | 618 content::ResourceContext* resource_context, |
619 content::StoragePartitionImpl* storage_partition) | |
598 : url_(url), | 620 : url_(url), |
599 closed_(false), | 621 closed_(false), |
600 name_(name), | 622 name_(name), |
601 worker_route_id_(MSG_ROUTING_NONE), | 623 worker_route_id_(MSG_ROUTING_NONE), |
602 parent_process_id_(0), | 624 parent_process_id_(0), |
603 main_resource_appcache_id_(0), | 625 main_resource_appcache_id_(0), |
604 worker_document_set_(new WorkerDocumentSet()), | 626 worker_document_set_(new WorkerDocumentSet()), |
605 resource_context_(resource_context) { | 627 resource_context_(resource_context), |
628 storage_partition_(storage_partition) { | |
606 DCHECK(resource_context_); | 629 DCHECK(resource_context_); |
630 DCHECK(storage_partition_); | |
607 } | 631 } |
608 | 632 |
609 WorkerProcessHost::WorkerInstance::~WorkerInstance() { | 633 WorkerProcessHost::WorkerInstance::~WorkerInstance() { |
610 } | 634 } |
611 | 635 |
612 // Compares an instance based on the algorithm in the WebWorkers spec - an | 636 // Compares an instance based on the algorithm in the WebWorkers spec - an |
613 // instance matches if the origins of the URLs match, and: | 637 // instance matches if the origins of the URLs match, and: |
614 // a) the names are non-empty and equal | 638 // a) the names are non-empty and equal |
615 // -or- | 639 // -or- |
616 // b) the names are both empty, and the urls are equal | 640 // b) the names are both empty, and the urls are equal |
617 bool WorkerProcessHost::WorkerInstance::Matches( | 641 bool WorkerProcessHost::WorkerInstance::Matches( |
618 const GURL& match_url, | 642 const GURL& match_url, |
619 const string16& match_name, | 643 const string16& match_name, |
620 content::ResourceContext* resource_context) const { | 644 content::ResourceContext* resource_context, |
645 content::StoragePartitionImpl* storage_partition) const { | |
621 // Only match open shared workers. | 646 // Only match open shared workers. |
622 if (closed_) | 647 if (closed_) |
623 return false; | 648 return false; |
624 | 649 |
625 // ResourceContext equivalence is being used as a proxy to ensure we only | 650 // ResourceContext equivalence is being used as a proxy to ensure we only |
626 // matched shared workers within the same BrowserContext. | 651 // matched shared workers within the same BrowserContext. |
627 if (resource_context_ != resource_context) | 652 if (resource_context_ != resource_context) |
628 return false; | 653 return false; |
629 | 654 |
655 // Must be bound to the same storage partition too. | |
656 if (storage_partition_.get() != storage_partition) | |
657 return false; | |
658 | |
630 if (url_.GetOrigin() != match_url.GetOrigin()) | 659 if (url_.GetOrigin() != match_url.GetOrigin()) |
631 return false; | 660 return false; |
632 | 661 |
633 if (name_.empty() && match_name.empty()) | 662 if (name_.empty() && match_name.empty()) |
634 return url_ == match_url; | 663 return url_ == match_url; |
635 | 664 |
636 return name_ == match_name; | 665 return name_ == match_name; |
637 } | 666 } |
638 | 667 |
639 void WorkerProcessHost::WorkerInstance::AddFilter(WorkerMessageFilter* filter, | 668 void WorkerProcessHost::WorkerInstance::AddFilter(WorkerMessageFilter* filter, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
690 } | 719 } |
691 } | 720 } |
692 return false; | 721 return false; |
693 } | 722 } |
694 | 723 |
695 WorkerProcessHost::WorkerInstance::FilterInfo | 724 WorkerProcessHost::WorkerInstance::FilterInfo |
696 WorkerProcessHost::WorkerInstance::GetFilter() const { | 725 WorkerProcessHost::WorkerInstance::GetFilter() const { |
697 DCHECK(NumFilters() == 1); | 726 DCHECK(NumFilters() == 1); |
698 return *filters_.begin(); | 727 return *filters_.begin(); |
699 } | 728 } |
OLD | NEW |