| 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 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 this)); | 441 this)); |
| 442 | 442 |
| 443 fast_shutdown_started_ = false; | 443 fast_shutdown_started_ = false; |
| 444 } | 444 } |
| 445 | 445 |
| 446 is_initialized_ = true; | 446 is_initialized_ = true; |
| 447 return true; | 447 return true; |
| 448 } | 448 } |
| 449 | 449 |
| 450 void RenderProcessHostImpl::CreateMessageFilters() { | 450 void RenderProcessHostImpl::CreateMessageFilters() { |
| 451 content::MediaObserver* media_observer = |
| 452 content::GetContentClient()->browser()->GetMediaObserver(); |
| 451 scoped_refptr<RenderMessageFilter> render_message_filter( | 453 scoped_refptr<RenderMessageFilter> render_message_filter( |
| 452 new RenderMessageFilter( | 454 new RenderMessageFilter( |
| 453 GetID(), | 455 GetID(), |
| 454 PluginServiceImpl::GetInstance(), | 456 PluginServiceImpl::GetInstance(), |
| 455 GetBrowserContext(), | 457 GetBrowserContext(), |
| 456 GetBrowserContext()->GetRequestContextForRenderProcess(GetID()), | 458 GetBrowserContext()->GetRequestContextForRenderProcess(GetID()), |
| 457 widget_helper_)); | 459 widget_helper_, |
| 460 media_observer)); |
| 458 channel_->AddFilter(render_message_filter); | 461 channel_->AddFilter(render_message_filter); |
| 459 content::BrowserContext* browser_context = GetBrowserContext(); | 462 content::BrowserContext* browser_context = GetBrowserContext(); |
| 460 content::ResourceContext* resource_context = | 463 content::ResourceContext* resource_context = |
| 461 browser_context->GetResourceContext(); | 464 browser_context->GetResourceContext(); |
| 462 | 465 |
| 463 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( | 466 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( |
| 464 GetID(), content::PROCESS_TYPE_RENDERER, resource_context, | 467 GetID(), content::PROCESS_TYPE_RENDERER, resource_context, |
| 465 new RendererURLRequestContextSelector(browser_context, GetID())); | 468 new RendererURLRequestContextSelector(browser_context, GetID())); |
| 466 | 469 |
| 467 channel_->AddFilter(resource_message_filter); | 470 channel_->AddFilter(resource_message_filter); |
| 468 #if !defined(OS_ANDROID) | 471 #if !defined(OS_ANDROID) |
| 469 // TODO(dtrainor, klobag): Enable this when content::BrowserMainLoop gets | 472 // TODO(dtrainor, klobag): Enable this when content::BrowserMainLoop gets |
| 470 // included in Android builds. Tracked via 115941. | 473 // included in Android builds. Tracked via 115941. |
| 471 AudioManager* audio_manager = content::BrowserMainLoop::GetAudioManager(); | 474 AudioManager* audio_manager = content::BrowserMainLoop::GetAudioManager(); |
| 472 channel_->AddFilter(new AudioInputRendererHost( | 475 channel_->AddFilter(new AudioInputRendererHost( |
| 473 resource_context, audio_manager)); | 476 resource_context, audio_manager)); |
| 474 channel_->AddFilter(new AudioRendererHost(resource_context, audio_manager)); | 477 channel_->AddFilter(new AudioRendererHost(audio_manager, media_observer)); |
| 475 channel_->AddFilter(new VideoCaptureHost(resource_context, audio_manager)); | 478 channel_->AddFilter(new VideoCaptureHost(resource_context, audio_manager)); |
| 476 #endif | 479 #endif |
| 477 channel_->AddFilter(new AppCacheDispatcherHost( | 480 channel_->AddFilter(new AppCacheDispatcherHost( |
| 478 static_cast<ChromeAppCacheService*>( | 481 static_cast<ChromeAppCacheService*>( |
| 479 BrowserContext::GetAppCacheService(browser_context)), | 482 BrowserContext::GetAppCacheService(browser_context)), |
| 480 GetID())); | 483 GetID())); |
| 481 channel_->AddFilter(new ClipboardMessageFilter()); | 484 channel_->AddFilter(new ClipboardMessageFilter()); |
| 482 channel_->AddFilter(new DOMStorageMessageFilter(GetID(), | 485 channel_->AddFilter(new DOMStorageMessageFilter(GetID(), |
| 483 static_cast<DOMStorageContextImpl*>( | 486 static_cast<DOMStorageContextImpl*>( |
| 484 BrowserContext::GetDOMStorageContext(browser_context)))); | 487 BrowserContext::GetDOMStorageContext(browser_context)))); |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1338 void RenderProcessHostImpl::OnRevealFolderInOS(const FilePath& path) { | 1341 void RenderProcessHostImpl::OnRevealFolderInOS(const FilePath& path) { |
| 1339 // Only honor the request if appropriate persmissions are granted. | 1342 // Only honor the request if appropriate persmissions are granted. |
| 1340 if (ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile(GetID(), | 1343 if (ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile(GetID(), |
| 1341 path)) | 1344 path)) |
| 1342 content::GetContentClient()->browser()->OpenItem(path); | 1345 content::GetContentClient()->browser()->OpenItem(path); |
| 1343 } | 1346 } |
| 1344 | 1347 |
| 1345 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { | 1348 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { |
| 1346 MHTMLGenerationManager::GetInstance()->MHTMLGenerated(job_id, data_size); | 1349 MHTMLGenerationManager::GetInstance()->MHTMLGenerated(job_id, data_size); |
| 1347 } | 1350 } |
| OLD | NEW |