| 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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 AddFilter(new AppCacheDispatcherHost( | 702 AddFilter(new AppCacheDispatcherHost( |
| 703 storage_partition_impl_->GetAppCacheService(), | 703 storage_partition_impl_->GetAppCacheService(), |
| 704 GetID())); | 704 GetID())); |
| 705 AddFilter(new ClipboardMessageFilter); | 705 AddFilter(new ClipboardMessageFilter); |
| 706 AddFilter(new DOMStorageMessageFilter( | 706 AddFilter(new DOMStorageMessageFilter( |
| 707 GetID(), | 707 GetID(), |
| 708 storage_partition_impl_->GetDOMStorageContext())); | 708 storage_partition_impl_->GetDOMStorageContext())); |
| 709 AddFilter(new IndexedDBDispatcherHost( | 709 AddFilter(new IndexedDBDispatcherHost( |
| 710 storage_partition_impl_->GetIndexedDBContext())); | 710 storage_partition_impl_->GetIndexedDBContext())); |
| 711 | 711 |
| 712 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter = | |
| 713 new ServiceWorkerDispatcherHost(GetID()); | |
| 714 service_worker_filter->Init( | |
| 715 storage_partition_impl_->GetServiceWorkerContext()); | |
| 716 AddFilter(service_worker_filter); | |
| 717 | |
| 718 if (IsGuest()) { | 712 if (IsGuest()) { |
| 719 if (!g_browser_plugin_geolocation_context.Get().get()) { | 713 if (!g_browser_plugin_geolocation_context.Get().get()) { |
| 720 g_browser_plugin_geolocation_context.Get() = | 714 g_browser_plugin_geolocation_context.Get() = |
| 721 new BrowserPluginGeolocationPermissionContext(); | 715 new BrowserPluginGeolocationPermissionContext(); |
| 722 } | 716 } |
| 723 geolocation_dispatcher_host_ = GeolocationDispatcherHost::New( | 717 geolocation_dispatcher_host_ = GeolocationDispatcherHost::New( |
| 724 GetID(), g_browser_plugin_geolocation_context.Get().get()); | 718 GetID(), g_browser_plugin_geolocation_context.Get().get()); |
| 725 } else { | 719 } else { |
| 726 geolocation_dispatcher_host_ = GeolocationDispatcherHost::New( | 720 geolocation_dispatcher_host_ = GeolocationDispatcherHost::New( |
| 727 GetID(), browser_context->GetGeolocationPermissionContext()); | 721 GetID(), browser_context->GetGeolocationPermissionContext()); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 base::Bind(&GetRequestContext, request_context, | 779 base::Bind(&GetRequestContext, request_context, |
| 786 media_request_context, ResourceType::SUB_RESOURCE)); | 780 media_request_context, ResourceType::SUB_RESOURCE)); |
| 787 | 781 |
| 788 AddFilter(new WebSocketDispatcherHost(websocket_request_context_callback)); | 782 AddFilter(new WebSocketDispatcherHost(websocket_request_context_callback)); |
| 789 | 783 |
| 790 message_port_message_filter_ = new MessagePortMessageFilter( | 784 message_port_message_filter_ = new MessagePortMessageFilter( |
| 791 base::Bind(&RenderWidgetHelper::GetNextRoutingID, | 785 base::Bind(&RenderWidgetHelper::GetNextRoutingID, |
| 792 base::Unretained(widget_helper_.get()))); | 786 base::Unretained(widget_helper_.get()))); |
| 793 AddFilter(message_port_message_filter_); | 787 AddFilter(message_port_message_filter_); |
| 794 | 788 |
| 789 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter = |
| 790 new ServiceWorkerDispatcherHost(GetID(), message_port_message_filter_); |
| 791 service_worker_filter->Init( |
| 792 storage_partition_impl_->GetServiceWorkerContext()); |
| 793 AddFilter(service_worker_filter); |
| 794 |
| 795 // If "--enable-embedded-shared-worker" is set, we use | 795 // If "--enable-embedded-shared-worker" is set, we use |
| 796 // SharedWorkerMessageFilter in stead of WorkerMessageFilter. | 796 // SharedWorkerMessageFilter in stead of WorkerMessageFilter. |
| 797 if (WorkerService::EmbeddedSharedWorkerEnabled()) { | 797 if (WorkerService::EmbeddedSharedWorkerEnabled()) { |
| 798 AddFilter(new SharedWorkerMessageFilter( | 798 AddFilter(new SharedWorkerMessageFilter( |
| 799 GetID(), | 799 GetID(), |
| 800 resource_context, | 800 resource_context, |
| 801 WorkerStoragePartition( | 801 WorkerStoragePartition( |
| 802 storage_partition_impl_->GetURLRequestContext(), | 802 storage_partition_impl_->GetURLRequestContext(), |
| 803 storage_partition_impl_->GetMediaURLRequestContext(), | 803 storage_partition_impl_->GetMediaURLRequestContext(), |
| 804 storage_partition_impl_->GetAppCacheService(), | 804 storage_partition_impl_->GetAppCacheService(), |
| (...skipping 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2172 child_process_launcher_->GetHandle(); | 2172 child_process_launcher_->GetHandle(); |
| 2173 base::PlatformFile client_file = | 2173 base::PlatformFile client_file = |
| 2174 PlatformFileFromScopedPlatformHandle(channel_pair.PassClientHandle()); | 2174 PlatformFileFromScopedPlatformHandle(channel_pair.PassClientHandle()); |
| 2175 Send(new MojoMsg_ChannelCreated( | 2175 Send(new MojoMsg_ChannelCreated( |
| 2176 IPC::GetFileHandleForProcess(client_file, process_handle, true))); | 2176 IPC::GetFileHandleForProcess(client_file, process_handle, true))); |
| 2177 } | 2177 } |
| 2178 } | 2178 } |
| 2179 #endif | 2179 #endif |
| 2180 | 2180 |
| 2181 } // namespace content | 2181 } // namespace content |
| OLD | NEW |