Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 9150016: Move creation and ownership of ResourceDispatcherHost and PluginService to content. This gives a ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix chromeos ui_tests Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #if defined(OS_WIN) 10 #if defined(OS_WIN)
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 PluginServiceImpl::GetInstance(), 447 PluginServiceImpl::GetInstance(),
448 GetBrowserContext(), 448 GetBrowserContext(),
449 GetBrowserContext()->GetRequestContextForRenderProcess(GetID()), 449 GetBrowserContext()->GetRequestContextForRenderProcess(GetID()),
450 widget_helper_)); 450 widget_helper_));
451 channel_->AddFilter(render_message_filter); 451 channel_->AddFilter(render_message_filter);
452 content::BrowserContext* browser_context = GetBrowserContext(); 452 content::BrowserContext* browser_context = GetBrowserContext();
453 const content::ResourceContext* resource_context = 453 const content::ResourceContext* resource_context =
454 &browser_context->GetResourceContext(); 454 &browser_context->GetResourceContext();
455 455
456 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( 456 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter(
457 GetID(), content::PROCESS_TYPE_RENDERER, 457 GetID(), content::PROCESS_TYPE_RENDERER, resource_context,
458 resource_context, 458 new RendererURLRequestContextSelector(browser_context, GetID()));
459 new RendererURLRequestContextSelector(browser_context, GetID()),
460 content::GetContentClient()->browser()->GetResourceDispatcherHost());
461 459
462 channel_->AddFilter(resource_message_filter); 460 channel_->AddFilter(resource_message_filter);
463 channel_->AddFilter(new AudioInputRendererHost(resource_context)); 461 channel_->AddFilter(new AudioInputRendererHost(resource_context));
464 channel_->AddFilter(new AudioRendererHost(resource_context)); 462 channel_->AddFilter(new AudioRendererHost(resource_context));
465 channel_->AddFilter(new VideoCaptureHost(resource_context)); 463 channel_->AddFilter(new VideoCaptureHost(resource_context));
466 channel_->AddFilter(new AppCacheDispatcherHost( 464 channel_->AddFilter(new AppCacheDispatcherHost(
467 browser_context->GetAppCacheService(), GetID())); 465 browser_context->GetAppCacheService(), GetID()));
468 channel_->AddFilter(new ClipboardMessageFilter()); 466 channel_->AddFilter(new ClipboardMessageFilter());
469 channel_->AddFilter(new DOMStorageMessageFilter(GetID(), 467 channel_->AddFilter(new DOMStorageMessageFilter(GetID(),
470 browser_context->GetWebKitContext())); 468 browser_context->GetWebKitContext()));
(...skipping 25 matching lines...) Expand all
496 channel_->AddFilter(new FontCacheDispatcher()); 494 channel_->AddFilter(new FontCacheDispatcher());
497 #endif 495 #endif
498 496
499 SocketStreamDispatcherHost* socket_stream_dispatcher_host = 497 SocketStreamDispatcherHost* socket_stream_dispatcher_host =
500 new SocketStreamDispatcherHost( 498 new SocketStreamDispatcherHost(
501 new RendererURLRequestContextSelector(browser_context, GetID()), 499 new RendererURLRequestContextSelector(browser_context, GetID()),
502 resource_context); 500 resource_context);
503 channel_->AddFilter(socket_stream_dispatcher_host); 501 channel_->AddFilter(socket_stream_dispatcher_host);
504 502
505 channel_->AddFilter(new WorkerMessageFilter(GetID(), resource_context, 503 channel_->AddFilter(new WorkerMessageFilter(GetID(), resource_context,
506 content::GetContentClient()->browser()->GetResourceDispatcherHost(),
507 base::Bind(&RenderWidgetHelper::GetNextRoutingID, 504 base::Bind(&RenderWidgetHelper::GetNextRoutingID,
508 base::Unretained(widget_helper_.get())))); 505 base::Unretained(widget_helper_.get()))));
509 506
510 #if defined(ENABLE_P2P_APIS) 507 #if defined(ENABLE_P2P_APIS)
511 channel_->AddFilter(new content::P2PSocketDispatcherHost(resource_context)); 508 channel_->AddFilter(new content::P2PSocketDispatcherHost(resource_context));
512 #endif 509 #endif
513 510
514 channel_->AddFilter(new TraceMessageFilter()); 511 channel_->AddFilter(new TraceMessageFilter());
515 channel_->AddFilter(new ResolveProxyMsgHelper( 512 channel_->AddFilter(new ResolveProxyMsgHelper(
516 browser_context->GetRequestContextForRenderProcess(GetID()))); 513 browser_context->GetRequestContextForRenderProcess(GetID())));
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
1303 void RenderProcessHostImpl::OnRevealFolderInOS(const FilePath& path) { 1300 void RenderProcessHostImpl::OnRevealFolderInOS(const FilePath& path) {
1304 // Only honor the request if appropriate persmissions are granted. 1301 // Only honor the request if appropriate persmissions are granted.
1305 if (ChildProcessSecurityPolicy::GetInstance()->CanReadFile(GetID(), path)) 1302 if (ChildProcessSecurityPolicy::GetInstance()->CanReadFile(GetID(), path))
1306 content::GetContentClient()->browser()->OpenItem(path); 1303 content::GetContentClient()->browser()->OpenItem(path);
1307 } 1304 }
1308 1305
1309 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { 1306 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) {
1310 content::GetContentClient()->browser()->GetMHTMLGenerationManager()-> 1307 content::GetContentClient()->browser()->GetMHTMLGenerationManager()->
1311 MHTMLGenerated(job_id, data_size); 1308 MHTMLGenerated(job_id, data_size);
1312 } 1309 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698