| 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
| 6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
| 7 | 7 |
| 8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 AddFilter(new AppCacheDispatcherHost( | 669 AddFilter(new AppCacheDispatcherHost( |
| 670 storage_partition_impl_->GetAppCacheService(), | 670 storage_partition_impl_->GetAppCacheService(), |
| 671 GetID())); | 671 GetID())); |
| 672 AddFilter(new ClipboardMessageFilter); | 672 AddFilter(new ClipboardMessageFilter); |
| 673 AddFilter(new DOMStorageMessageFilter( | 673 AddFilter(new DOMStorageMessageFilter( |
| 674 GetID(), | 674 GetID(), |
| 675 storage_partition_impl_->GetDOMStorageContext())); | 675 storage_partition_impl_->GetDOMStorageContext())); |
| 676 AddFilter(new IndexedDBDispatcherHost( | 676 AddFilter(new IndexedDBDispatcherHost( |
| 677 storage_partition_impl_->GetIndexedDBContext())); | 677 storage_partition_impl_->GetIndexedDBContext())); |
| 678 | 678 |
| 679 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter = | |
| 680 new ServiceWorkerDispatcherHost(GetID()); | |
| 681 service_worker_filter->Init( | |
| 682 storage_partition_impl_->GetServiceWorkerContext()); | |
| 683 AddFilter(service_worker_filter); | |
| 684 | |
| 685 if (IsGuest()) { | 679 if (IsGuest()) { |
| 686 if (!g_browser_plugin_geolocation_context.Get().get()) { | 680 if (!g_browser_plugin_geolocation_context.Get().get()) { |
| 687 g_browser_plugin_geolocation_context.Get() = | 681 g_browser_plugin_geolocation_context.Get() = |
| 688 new BrowserPluginGeolocationPermissionContext(); | 682 new BrowserPluginGeolocationPermissionContext(); |
| 689 } | 683 } |
| 690 geolocation_dispatcher_host_ = GeolocationDispatcherHost::New( | 684 geolocation_dispatcher_host_ = GeolocationDispatcherHost::New( |
| 691 GetID(), g_browser_plugin_geolocation_context.Get().get()); | 685 GetID(), g_browser_plugin_geolocation_context.Get().get()); |
| 692 } else { | 686 } else { |
| 693 geolocation_dispatcher_host_ = GeolocationDispatcherHost::New( | 687 geolocation_dispatcher_host_ = GeolocationDispatcherHost::New( |
| 694 GetID(), browser_context->GetGeolocationPermissionContext()); | 688 GetID(), browser_context->GetGeolocationPermissionContext()); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 base::Bind(&GetRequestContext, request_context, | 745 base::Bind(&GetRequestContext, request_context, |
| 752 media_request_context, ResourceType::SUB_RESOURCE)); | 746 media_request_context, ResourceType::SUB_RESOURCE)); |
| 753 | 747 |
| 754 AddFilter(new WebSocketDispatcherHost(websocket_request_context_callback)); | 748 AddFilter(new WebSocketDispatcherHost(websocket_request_context_callback)); |
| 755 | 749 |
| 756 message_port_message_filter_ = new MessagePortMessageFilter( | 750 message_port_message_filter_ = new MessagePortMessageFilter( |
| 757 base::Bind(&RenderWidgetHelper::GetNextRoutingID, | 751 base::Bind(&RenderWidgetHelper::GetNextRoutingID, |
| 758 base::Unretained(widget_helper_.get()))); | 752 base::Unretained(widget_helper_.get()))); |
| 759 AddFilter(message_port_message_filter_); | 753 AddFilter(message_port_message_filter_); |
| 760 | 754 |
| 755 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter = |
| 756 new ServiceWorkerDispatcherHost(GetID(), message_port_message_filter_); |
| 757 service_worker_filter->Init( |
| 758 storage_partition_impl_->GetServiceWorkerContext()); |
| 759 AddFilter(service_worker_filter); |
| 760 |
| 761 // If "--enable-embedded-shared-worker" is set, we use | 761 // If "--enable-embedded-shared-worker" is set, we use |
| 762 // SharedWorkerMessageFilter in stead of WorkerMessageFilter. | 762 // SharedWorkerMessageFilter in stead of WorkerMessageFilter. |
| 763 if (WorkerService::EmbeddedSharedWorkerEnabled()) { | 763 if (WorkerService::EmbeddedSharedWorkerEnabled()) { |
| 764 AddFilter(new SharedWorkerMessageFilter( | 764 AddFilter(new SharedWorkerMessageFilter( |
| 765 GetID(), | 765 GetID(), |
| 766 resource_context, | 766 resource_context, |
| 767 WorkerStoragePartition( | 767 WorkerStoragePartition( |
| 768 storage_partition_impl_->GetURLRequestContext(), | 768 storage_partition_impl_->GetURLRequestContext(), |
| 769 storage_partition_impl_->GetMediaURLRequestContext(), | 769 storage_partition_impl_->GetMediaURLRequestContext(), |
| 770 storage_partition_impl_->GetAppCacheService(), | 770 storage_partition_impl_->GetAppCacheService(), |
| (...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2108 | 2108 |
| 2109 void RenderProcessHostImpl::DecrementWorkerRefCount() { | 2109 void RenderProcessHostImpl::DecrementWorkerRefCount() { |
| 2110 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 2110 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 2111 DCHECK_GT(worker_ref_count_, 0); | 2111 DCHECK_GT(worker_ref_count_, 0); |
| 2112 --worker_ref_count_; | 2112 --worker_ref_count_; |
| 2113 if (worker_ref_count_ == 0) | 2113 if (worker_ref_count_ == 0) |
| 2114 Cleanup(); | 2114 Cleanup(); |
| 2115 } | 2115 } |
| 2116 | 2116 |
| 2117 } // namespace content | 2117 } // namespace content |
| OLD | NEW |