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 23 matching lines...) Expand all Loading... |
34 #include "base/rand_util.h" | 34 #include "base/rand_util.h" |
35 #include "base/stl_util.h" | 35 #include "base/stl_util.h" |
36 #include "base/string_util.h" | 36 #include "base/string_util.h" |
37 #include "base/sys_info.h" | 37 #include "base/sys_info.h" |
38 #include "base/threading/thread.h" | 38 #include "base/threading/thread.h" |
39 #include "base/threading/thread_restrictions.h" | 39 #include "base/threading/thread_restrictions.h" |
40 #include "base/tracked_objects.h" | 40 #include "base/tracked_objects.h" |
41 #include "content/browser/appcache/appcache_dispatcher_host.h" | 41 #include "content/browser/appcache/appcache_dispatcher_host.h" |
42 #include "content/browser/appcache/chrome_appcache_service.h" | 42 #include "content/browser/appcache/chrome_appcache_service.h" |
43 #include "content/browser/browser_main.h" | 43 #include "content/browser/browser_main.h" |
| 44 #include "content/browser/browser_main_loop.h" |
44 #include "content/browser/child_process_security_policy_impl.h" | 45 #include "content/browser/child_process_security_policy_impl.h" |
45 #include "content/browser/chrome_blob_storage_context.h" | 46 #include "content/browser/chrome_blob_storage_context.h" |
46 #include "content/browser/device_orientation/message_filter.h" | 47 #include "content/browser/device_orientation/message_filter.h" |
47 #include "content/browser/download/mhtml_generation_manager.h" | 48 #include "content/browser/download/mhtml_generation_manager.h" |
48 #include "content/browser/file_system/file_system_dispatcher_host.h" | 49 #include "content/browser/file_system/file_system_dispatcher_host.h" |
49 #include "content/browser/geolocation/geolocation_dispatcher_host.h" | 50 #include "content/browser/geolocation/geolocation_dispatcher_host.h" |
50 #include "content/browser/gpu/gpu_data_manager_impl.h" | 51 #include "content/browser/gpu/gpu_data_manager_impl.h" |
51 #include "content/browser/gpu/gpu_process_host.h" | 52 #include "content/browser/gpu/gpu_process_host.h" |
52 #include "content/browser/in_process_webkit/dom_storage_message_filter.h" | 53 #include "content/browser/in_process_webkit/dom_storage_message_filter.h" |
53 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" | 54 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 new RenderMessageFilter( | 450 new RenderMessageFilter( |
450 GetID(), | 451 GetID(), |
451 PluginServiceImpl::GetInstance(), | 452 PluginServiceImpl::GetInstance(), |
452 GetBrowserContext(), | 453 GetBrowserContext(), |
453 GetBrowserContext()->GetRequestContextForRenderProcess(GetID()), | 454 GetBrowserContext()->GetRequestContextForRenderProcess(GetID()), |
454 widget_helper_)); | 455 widget_helper_)); |
455 channel_->AddFilter(render_message_filter); | 456 channel_->AddFilter(render_message_filter); |
456 content::BrowserContext* browser_context = GetBrowserContext(); | 457 content::BrowserContext* browser_context = GetBrowserContext(); |
457 content::ResourceContext* resource_context = | 458 content::ResourceContext* resource_context = |
458 browser_context->GetResourceContext(); | 459 browser_context->GetResourceContext(); |
| 460 AudioManager* audio_manager = content::BrowserMainLoop::GetAudioManager(); |
459 | 461 |
460 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( | 462 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( |
461 GetID(), content::PROCESS_TYPE_RENDERER, resource_context, | 463 GetID(), content::PROCESS_TYPE_RENDERER, resource_context, |
462 new RendererURLRequestContextSelector(browser_context, GetID())); | 464 new RendererURLRequestContextSelector(browser_context, GetID())); |
463 | 465 |
464 channel_->AddFilter(resource_message_filter); | 466 channel_->AddFilter(resource_message_filter); |
465 channel_->AddFilter(new AudioInputRendererHost(resource_context)); | 467 channel_->AddFilter(new AudioInputRendererHost( |
466 channel_->AddFilter(new AudioRendererHost(resource_context)); | 468 resource_context, audio_manager)); |
467 channel_->AddFilter(new VideoCaptureHost(resource_context)); | 469 channel_->AddFilter(new AudioRendererHost(resource_context, audio_manager)); |
| 470 channel_->AddFilter(new VideoCaptureHost(resource_context, audio_manager)); |
468 channel_->AddFilter(new AppCacheDispatcherHost( | 471 channel_->AddFilter(new AppCacheDispatcherHost( |
469 static_cast<ChromeAppCacheService*>( | 472 static_cast<ChromeAppCacheService*>( |
470 BrowserContext::GetAppCacheService(browser_context)), | 473 BrowserContext::GetAppCacheService(browser_context)), |
471 GetID())); | 474 GetID())); |
472 channel_->AddFilter(new ClipboardMessageFilter()); | 475 channel_->AddFilter(new ClipboardMessageFilter()); |
473 channel_->AddFilter(new DOMStorageMessageFilter(GetID(), | 476 channel_->AddFilter(new DOMStorageMessageFilter(GetID(), |
474 BrowserContext::GetWebKitContext(browser_context))); | 477 BrowserContext::GetWebKitContext(browser_context))); |
475 channel_->AddFilter(new IndexedDBDispatcherHost(GetID(), | 478 channel_->AddFilter(new IndexedDBDispatcherHost(GetID(), |
476 BrowserContext::GetWebKitContext(browser_context))); | 479 BrowserContext::GetWebKitContext(browser_context))); |
477 channel_->AddFilter(GeolocationDispatcherHost::New( | 480 channel_->AddFilter(GeolocationDispatcherHost::New( |
478 GetID(), browser_context->GetGeolocationPermissionContext())); | 481 GetID(), browser_context->GetGeolocationPermissionContext())); |
479 channel_->AddFilter(new GpuMessageFilter(GetID(), widget_helper_.get())); | 482 channel_->AddFilter(new GpuMessageFilter(GetID(), widget_helper_.get())); |
480 channel_->AddFilter(new media_stream::MediaStreamDispatcherHost( | 483 channel_->AddFilter(new media_stream::MediaStreamDispatcherHost( |
481 resource_context, GetID())); | 484 resource_context, GetID(), audio_manager)); |
482 channel_->AddFilter(new PepperFileMessageFilter(GetID(), browser_context)); | 485 channel_->AddFilter(new PepperFileMessageFilter(GetID(), browser_context)); |
483 channel_->AddFilter(new PepperMessageFilter(PepperMessageFilter::RENDERER, | 486 channel_->AddFilter(new PepperMessageFilter(PepperMessageFilter::RENDERER, |
484 GetID(), resource_context)); | 487 GetID(), resource_context)); |
485 #if defined(ENABLE_INPUT_SPEECH) | 488 #if defined(ENABLE_INPUT_SPEECH) |
486 channel_->AddFilter(new speech_input::SpeechInputDispatcherHost( | 489 channel_->AddFilter(new speech_input::SpeechInputDispatcherHost( |
487 GetID(), browser_context->GetRequestContext(), | 490 GetID(), browser_context->GetRequestContext(), |
488 browser_context->GetSpeechInputPreferences(), resource_context)); | 491 browser_context->GetSpeechInputPreferences(), audio_manager)); |
489 #endif | 492 #endif |
490 channel_->AddFilter(new FileSystemDispatcherHost( | 493 channel_->AddFilter(new FileSystemDispatcherHost( |
491 browser_context->GetRequestContext(), | 494 browser_context->GetRequestContext(), |
492 BrowserContext::GetFileSystemContext(browser_context))); | 495 BrowserContext::GetFileSystemContext(browser_context))); |
493 channel_->AddFilter(new device_orientation::MessageFilter()); | 496 channel_->AddFilter(new device_orientation::MessageFilter()); |
494 channel_->AddFilter(new BlobMessageFilter(GetID(), | 497 channel_->AddFilter(new BlobMessageFilter(GetID(), |
495 ChromeBlobStorageContext::GetFor(browser_context))); | 498 ChromeBlobStorageContext::GetFor(browser_context))); |
496 channel_->AddFilter(new FileUtilitiesMessageFilter(GetID())); | 499 channel_->AddFilter(new FileUtilitiesMessageFilter(GetID())); |
497 channel_->AddFilter(new MimeRegistryMessageFilter()); | 500 channel_->AddFilter(new MimeRegistryMessageFilter()); |
498 channel_->AddFilter(new DatabaseMessageFilter( | 501 channel_->AddFilter(new DatabaseMessageFilter( |
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 // Only honor the request if appropriate persmissions are granted. | 1313 // Only honor the request if appropriate persmissions are granted. |
1311 if (ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile(GetID(), | 1314 if (ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile(GetID(), |
1312 path)) | 1315 path)) |
1313 content::GetContentClient()->browser()->OpenItem(path); | 1316 content::GetContentClient()->browser()->OpenItem(path); |
1314 } | 1317 } |
1315 | 1318 |
1316 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { | 1319 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { |
1317 content::GetContentClient()->browser()->GetMHTMLGenerationManager()-> | 1320 content::GetContentClient()->browser()->GetMHTMLGenerationManager()-> |
1318 MHTMLGenerated(job_id, data_size); | 1321 MHTMLGenerated(job_id, data_size); |
1319 } | 1322 } |
OLD | NEW |