| 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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 AddFilter(new AppCacheDispatcherHost( | 667 AddFilter(new AppCacheDispatcherHost( |
| 668 storage_partition_impl_->GetAppCacheService(), | 668 storage_partition_impl_->GetAppCacheService(), |
| 669 GetID())); | 669 GetID())); |
| 670 AddFilter(new ClipboardMessageFilter); | 670 AddFilter(new ClipboardMessageFilter); |
| 671 AddFilter(new DOMStorageMessageFilter( | 671 AddFilter(new DOMStorageMessageFilter( |
| 672 GetID(), | 672 GetID(), |
| 673 storage_partition_impl_->GetDOMStorageContext())); | 673 storage_partition_impl_->GetDOMStorageContext())); |
| 674 AddFilter(new IndexedDBDispatcherHost( | 674 AddFilter(new IndexedDBDispatcherHost( |
| 675 storage_partition_impl_->GetIndexedDBContext())); | 675 storage_partition_impl_->GetIndexedDBContext())); |
| 676 | 676 |
| 677 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter = | |
| 678 new ServiceWorkerDispatcherHost(GetID()); | |
| 679 service_worker_filter->Init( | |
| 680 storage_partition_impl_->GetServiceWorkerContext()); | |
| 681 AddFilter(service_worker_filter); | |
| 682 | |
| 683 if (IsGuest()) { | 677 if (IsGuest()) { |
| 684 if (!g_browser_plugin_geolocation_context.Get().get()) { | 678 if (!g_browser_plugin_geolocation_context.Get().get()) { |
| 685 g_browser_plugin_geolocation_context.Get() = | 679 g_browser_plugin_geolocation_context.Get() = |
| 686 new BrowserPluginGeolocationPermissionContext(); | 680 new BrowserPluginGeolocationPermissionContext(); |
| 687 } | 681 } |
| 688 geolocation_dispatcher_host_ = GeolocationDispatcherHost::New( | 682 geolocation_dispatcher_host_ = GeolocationDispatcherHost::New( |
| 689 GetID(), g_browser_plugin_geolocation_context.Get().get()); | 683 GetID(), g_browser_plugin_geolocation_context.Get().get()); |
| 690 } else { | 684 } else { |
| 691 geolocation_dispatcher_host_ = GeolocationDispatcherHost::New( | 685 geolocation_dispatcher_host_ = GeolocationDispatcherHost::New( |
| 692 GetID(), browser_context->GetGeolocationPermissionContext()); | 686 GetID(), browser_context->GetGeolocationPermissionContext()); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 base::Bind(&GetRequestContext, request_context, | 743 base::Bind(&GetRequestContext, request_context, |
| 750 media_request_context, ResourceType::SUB_RESOURCE)); | 744 media_request_context, ResourceType::SUB_RESOURCE)); |
| 751 | 745 |
| 752 AddFilter(new WebSocketDispatcherHost(websocket_request_context_callback)); | 746 AddFilter(new WebSocketDispatcherHost(websocket_request_context_callback)); |
| 753 | 747 |
| 754 message_port_message_filter_ = new MessagePortMessageFilter( | 748 message_port_message_filter_ = new MessagePortMessageFilter( |
| 755 base::Bind(&RenderWidgetHelper::GetNextRoutingID, | 749 base::Bind(&RenderWidgetHelper::GetNextRoutingID, |
| 756 base::Unretained(widget_helper_.get()))); | 750 base::Unretained(widget_helper_.get()))); |
| 757 AddFilter(message_port_message_filter_); | 751 AddFilter(message_port_message_filter_); |
| 758 | 752 |
| 753 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter = |
| 754 new ServiceWorkerDispatcherHost(GetID(), message_port_message_filter_); |
| 755 service_worker_filter->Init( |
| 756 storage_partition_impl_->GetServiceWorkerContext()); |
| 757 AddFilter(service_worker_filter); |
| 758 |
| 759 AddFilter(new WorkerMessageFilter( | 759 AddFilter(new WorkerMessageFilter( |
| 760 GetID(), | 760 GetID(), |
| 761 resource_context, | 761 resource_context, |
| 762 WorkerStoragePartition( | 762 WorkerStoragePartition( |
| 763 storage_partition_impl_->GetURLRequestContext(), | 763 storage_partition_impl_->GetURLRequestContext(), |
| 764 storage_partition_impl_->GetMediaURLRequestContext(), | 764 storage_partition_impl_->GetMediaURLRequestContext(), |
| 765 storage_partition_impl_->GetAppCacheService(), | 765 storage_partition_impl_->GetAppCacheService(), |
| 766 storage_partition_impl_->GetQuotaManager(), | 766 storage_partition_impl_->GetQuotaManager(), |
| 767 storage_partition_impl_->GetFileSystemContext(), | 767 storage_partition_impl_->GetFileSystemContext(), |
| 768 storage_partition_impl_->GetDatabaseTracker(), | 768 storage_partition_impl_->GetDatabaseTracker(), |
| (...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2090 | 2090 |
| 2091 void RenderProcessHostImpl::DecrementWorkerRefCount() { | 2091 void RenderProcessHostImpl::DecrementWorkerRefCount() { |
| 2092 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 2092 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 2093 DCHECK_GT(worker_ref_count_, 0); | 2093 DCHECK_GT(worker_ref_count_, 0); |
| 2094 --worker_ref_count_; | 2094 --worker_ref_count_; |
| 2095 if (worker_ref_count_ == 0) | 2095 if (worker_ref_count_ == 0) |
| 2096 Cleanup(); | 2096 Cleanup(); |
| 2097 } | 2097 } |
| 2098 | 2098 |
| 2099 } // namespace content | 2099 } // namespace content |
| OLD | NEW |