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 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1149 base::Unretained(widget_helper_.get()))); | 1149 base::Unretained(widget_helper_.get()))); |
1150 AddFilter(message_port_message_filter_.get()); | 1150 AddFilter(message_port_message_filter_.get()); |
1151 | 1151 |
1152 scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter = | 1152 scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter = |
1153 new CacheStorageDispatcherHost(); | 1153 new CacheStorageDispatcherHost(); |
1154 cache_storage_filter->Init(storage_partition_impl_->GetCacheStorageContext()); | 1154 cache_storage_filter->Init(storage_partition_impl_->GetCacheStorageContext()); |
1155 AddFilter(cache_storage_filter.get()); | 1155 AddFilter(cache_storage_filter.get()); |
1156 | 1156 |
1157 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter = | 1157 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter = |
1158 new ServiceWorkerDispatcherHost( | 1158 new ServiceWorkerDispatcherHost( |
1159 GetID(), message_port_message_filter_.get(), resource_context); | 1159 GetID(), message_port_message_filter_.get(), resource_context, |
1160 base::Bind(&RenderProcessHostImpl::CreateURLLoaderFactory, | |
1161 weak_factory_.GetWeakPtr())); | |
1160 service_worker_filter->Init( | 1162 service_worker_filter->Init( |
1161 storage_partition_impl_->GetServiceWorkerContext()); | 1163 storage_partition_impl_->GetServiceWorkerContext()); |
1162 AddFilter(service_worker_filter.get()); | 1164 AddFilter(service_worker_filter.get()); |
1163 | 1165 |
1164 AddFilter(new SharedWorkerMessageFilter( | 1166 AddFilter(new SharedWorkerMessageFilter( |
1165 GetID(), resource_context, | 1167 GetID(), resource_context, |
1166 WorkerStoragePartition( | 1168 WorkerStoragePartition( |
1167 storage_partition_impl_->GetURLRequestContext(), | 1169 storage_partition_impl_->GetURLRequestContext(), |
1168 storage_partition_impl_->GetMediaURLRequestContext(), | 1170 storage_partition_impl_->GetMediaURLRequestContext(), |
1169 storage_partition_impl_->GetAppCacheService(), | 1171 storage_partition_impl_->GetAppCacheService(), |
(...skipping 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3001 const std::string& error) { | 3003 const std::string& error) { |
3002 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3004 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
3003 | 3005 |
3004 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 3006 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
3005 // enough information here so that we can determine what the bad message was. | 3007 // enough information here so that we can determine what the bad message was. |
3006 base::debug::Alias(&error); | 3008 base::debug::Alias(&error); |
3007 bad_message::ReceivedBadMessage(render_process_id, | 3009 bad_message::ReceivedBadMessage(render_process_id, |
3008 bad_message::RPH_MOJO_PROCESS_ERROR); | 3010 bad_message::RPH_MOJO_PROCESS_ERROR); |
3009 } | 3011 } |
3010 | 3012 |
3013 // static | |
3014 bool RenderProcessHostImpl::CreateURLLoaderFactory( | |
3015 base::WeakPtr<RenderProcessHostImpl> weak_host, | |
3016 mojo::InterfaceRequest<mojom::URLLoaderFactory> request) { | |
sadrul
2016/10/19 14:42:43
This doesn't need to be a static, right?
horo
2016/10/19 14:48:41
I want to return false if RenderProcessHostImpl wa
sadrul
2016/10/19 15:13:31
I think the return type can be void, and you can c
horo
2016/10/19 16:08:02
Ah, sounds good.
Done.
| |
3017 if (!weak_host) | |
3018 return false; | |
3019 URLLoaderFactoryImpl::Create(weak_host->resource_message_filter_, | |
3020 std::move(request)); | |
3021 return true; | |
3022 } | |
3023 | |
3011 } // namespace content | 3024 } // namespace content |
OLD | NEW |