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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 AddFilter(new AppCacheDispatcherHost( | 685 AddFilter(new AppCacheDispatcherHost( |
686 storage_partition_impl_->GetAppCacheService(), | 686 storage_partition_impl_->GetAppCacheService(), |
687 GetID())); | 687 GetID())); |
688 AddFilter(new ClipboardMessageFilter); | 688 AddFilter(new ClipboardMessageFilter); |
689 AddFilter(new DOMStorageMessageFilter( | 689 AddFilter(new DOMStorageMessageFilter( |
690 GetID(), | 690 GetID(), |
691 storage_partition_impl_->GetDOMStorageContext())); | 691 storage_partition_impl_->GetDOMStorageContext())); |
692 AddFilter(new IndexedDBDispatcherHost( | 692 AddFilter(new IndexedDBDispatcherHost( |
693 storage_partition_impl_->GetIndexedDBContext())); | 693 storage_partition_impl_->GetIndexedDBContext())); |
694 | 694 |
695 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter = | |
696 new ServiceWorkerDispatcherHost(GetID()); | |
697 service_worker_filter->Init( | |
698 storage_partition_impl_->GetServiceWorkerContext()); | |
699 AddFilter(service_worker_filter); | |
700 | |
701 if (IsGuest()) { | 695 if (IsGuest()) { |
702 if (!g_browser_plugin_geolocation_context.Get().get()) { | 696 if (!g_browser_plugin_geolocation_context.Get().get()) { |
703 g_browser_plugin_geolocation_context.Get() = | 697 g_browser_plugin_geolocation_context.Get() = |
704 new BrowserPluginGeolocationPermissionContext(); | 698 new BrowserPluginGeolocationPermissionContext(); |
705 } | 699 } |
706 geolocation_dispatcher_host_ = GeolocationDispatcherHost::New( | 700 geolocation_dispatcher_host_ = GeolocationDispatcherHost::New( |
707 GetID(), g_browser_plugin_geolocation_context.Get().get()); | 701 GetID(), g_browser_plugin_geolocation_context.Get().get()); |
708 } else { | 702 } else { |
709 geolocation_dispatcher_host_ = GeolocationDispatcherHost::New( | 703 geolocation_dispatcher_host_ = GeolocationDispatcherHost::New( |
710 GetID(), browser_context->GetGeolocationPermissionContext()); | 704 GetID(), browser_context->GetGeolocationPermissionContext()); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 base::Bind(&GetRequestContext, request_context, | 762 base::Bind(&GetRequestContext, request_context, |
769 media_request_context, ResourceType::SUB_RESOURCE)); | 763 media_request_context, ResourceType::SUB_RESOURCE)); |
770 | 764 |
771 AddFilter(new WebSocketDispatcherHost(websocket_request_context_callback)); | 765 AddFilter(new WebSocketDispatcherHost(websocket_request_context_callback)); |
772 | 766 |
773 message_port_message_filter_ = new MessagePortMessageFilter( | 767 message_port_message_filter_ = new MessagePortMessageFilter( |
774 base::Bind(&RenderWidgetHelper::GetNextRoutingID, | 768 base::Bind(&RenderWidgetHelper::GetNextRoutingID, |
775 base::Unretained(widget_helper_.get()))); | 769 base::Unretained(widget_helper_.get()))); |
776 AddFilter(message_port_message_filter_); | 770 AddFilter(message_port_message_filter_); |
777 | 771 |
| 772 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter = |
| 773 new ServiceWorkerDispatcherHost(GetID(), message_port_message_filter_); |
| 774 service_worker_filter->Init( |
| 775 storage_partition_impl_->GetServiceWorkerContext()); |
| 776 AddFilter(service_worker_filter); |
| 777 |
778 // If "--enable-embedded-shared-worker" is set, we use | 778 // If "--enable-embedded-shared-worker" is set, we use |
779 // SharedWorkerMessageFilter in stead of WorkerMessageFilter. | 779 // SharedWorkerMessageFilter in stead of WorkerMessageFilter. |
780 if (WorkerService::EmbeddedSharedWorkerEnabled()) { | 780 if (WorkerService::EmbeddedSharedWorkerEnabled()) { |
781 AddFilter(new SharedWorkerMessageFilter( | 781 AddFilter(new SharedWorkerMessageFilter( |
782 GetID(), | 782 GetID(), |
783 resource_context, | 783 resource_context, |
784 WorkerStoragePartition( | 784 WorkerStoragePartition( |
785 storage_partition_impl_->GetURLRequestContext(), | 785 storage_partition_impl_->GetURLRequestContext(), |
786 storage_partition_impl_->GetMediaURLRequestContext(), | 786 storage_partition_impl_->GetMediaURLRequestContext(), |
787 storage_partition_impl_->GetAppCacheService(), | 787 storage_partition_impl_->GetAppCacheService(), |
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2131 | 2131 |
2132 void RenderProcessHostImpl::DecrementWorkerRefCount() { | 2132 void RenderProcessHostImpl::DecrementWorkerRefCount() { |
2133 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 2133 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
2134 DCHECK_GT(worker_ref_count_, 0); | 2134 DCHECK_GT(worker_ref_count_, 0); |
2135 --worker_ref_count_; | 2135 --worker_ref_count_; |
2136 if (worker_ref_count_ == 0) | 2136 if (worker_ref_count_ == 0) |
2137 Cleanup(); | 2137 Cleanup(); |
2138 } | 2138 } |
2139 | 2139 |
2140 } // namespace content | 2140 } // namespace content |
OLD | NEW |