OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1161 AddFilter(message_port_message_filter_.get()); | 1161 AddFilter(message_port_message_filter_.get()); |
1162 | 1162 |
1163 scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter = | 1163 scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter = |
1164 new CacheStorageDispatcherHost(); | 1164 new CacheStorageDispatcherHost(); |
1165 cache_storage_filter->Init(storage_partition_impl_->GetCacheStorageContext()); | 1165 cache_storage_filter->Init(storage_partition_impl_->GetCacheStorageContext()); |
1166 AddFilter(cache_storage_filter.get()); | 1166 AddFilter(cache_storage_filter.get()); |
1167 | 1167 |
1168 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter = | 1168 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter = |
1169 new ServiceWorkerDispatcherHost( | 1169 new ServiceWorkerDispatcherHost( |
1170 GetID(), message_port_message_filter_.get(), resource_context, | 1170 GetID(), message_port_message_filter_.get(), resource_context, |
1171 base::Bind(&RenderProcessHostImpl::CreateURLLoaderFactory, | 1171 CreateURLLoaderFactoryGetter()); |
1172 weak_factory_.GetWeakPtr())); | |
1173 service_worker_filter->Init( | 1172 service_worker_filter->Init( |
1174 storage_partition_impl_->GetServiceWorkerContext()); | 1173 storage_partition_impl_->GetServiceWorkerContext()); |
1175 AddFilter(service_worker_filter.get()); | 1174 AddFilter(service_worker_filter.get()); |
1176 | 1175 |
1177 AddFilter(new SharedWorkerMessageFilter( | 1176 AddFilter(new SharedWorkerMessageFilter( |
1178 GetID(), resource_context, | 1177 GetID(), resource_context, |
1179 WorkerStoragePartition( | 1178 WorkerStoragePartition( |
1180 storage_partition_impl_->GetURLRequestContext(), | 1179 storage_partition_impl_->GetURLRequestContext(), |
1181 storage_partition_impl_->GetMediaURLRequestContext(), | 1180 storage_partition_impl_->GetMediaURLRequestContext(), |
1182 storage_partition_impl_->GetAppCacheService(), | 1181 storage_partition_impl_->GetAppCacheService(), |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1430 } | 1429 } |
1431 | 1430 |
1432 void RenderProcessHostImpl::PurgeAndSuspend() { | 1431 void RenderProcessHostImpl::PurgeAndSuspend() { |
1433 Send(new ChildProcessMsg_PurgeAndSuspend()); | 1432 Send(new ChildProcessMsg_PurgeAndSuspend()); |
1434 } | 1433 } |
1435 | 1434 |
1436 mojom::Renderer* RenderProcessHostImpl::GetRendererInterface() { | 1435 mojom::Renderer* RenderProcessHostImpl::GetRendererInterface() { |
1437 return renderer_interface_.get(); | 1436 return renderer_interface_.get(); |
1438 } | 1437 } |
1439 | 1438 |
| 1439 MojoURLLoaderFactoryGetter |
| 1440 RenderProcessHostImpl::CreateURLLoaderFactoryGetter() { |
| 1441 return base::Bind(&RenderProcessHostImpl::CreateURLLoaderFactory, |
| 1442 weak_factory_.GetWeakPtr()); |
| 1443 } |
| 1444 |
1440 mojom::RouteProvider* RenderProcessHostImpl::GetRemoteRouteProvider() { | 1445 mojom::RouteProvider* RenderProcessHostImpl::GetRemoteRouteProvider() { |
1441 return remote_route_provider_.get(); | 1446 return remote_route_provider_.get(); |
1442 } | 1447 } |
1443 | 1448 |
1444 void RenderProcessHostImpl::AddRoute(int32_t routing_id, | 1449 void RenderProcessHostImpl::AddRoute(int32_t routing_id, |
1445 IPC::Listener* listener) { | 1450 IPC::Listener* listener) { |
1446 CHECK(!listeners_.Lookup(routing_id)) << "Found Routing ID Conflict: " | 1451 CHECK(!listeners_.Lookup(routing_id)) << "Found Routing ID Conflict: " |
1447 << routing_id; | 1452 << routing_id; |
1448 listeners_.AddWithID(listener, routing_id); | 1453 listeners_.AddWithID(listener, routing_id); |
1449 } | 1454 } |
(...skipping 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3010 bad_message::ReceivedBadMessage(render_process_id, | 3015 bad_message::ReceivedBadMessage(render_process_id, |
3011 bad_message::RPH_MOJO_PROCESS_ERROR); | 3016 bad_message::RPH_MOJO_PROCESS_ERROR); |
3012 } | 3017 } |
3013 | 3018 |
3014 void RenderProcessHostImpl::CreateURLLoaderFactory( | 3019 void RenderProcessHostImpl::CreateURLLoaderFactory( |
3015 mojo::InterfaceRequest<mojom::URLLoaderFactory> request) { | 3020 mojo::InterfaceRequest<mojom::URLLoaderFactory> request) { |
3016 URLLoaderFactoryImpl::Create(resource_message_filter_, std::move(request)); | 3021 URLLoaderFactoryImpl::Create(resource_message_filter_, std::move(request)); |
3017 } | 3022 } |
3018 | 3023 |
3019 } // namespace content | 3024 } // namespace content |
OLD | NEW |