Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/browser_render_process_host.h" | 8 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| 11 #include <limits> | 11 #include <limits> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #if defined(OS_POSIX) | 14 #if defined(OS_POSIX) |
| 15 #include <utility> // for pair<> | 15 #include <utility> // for pair<> |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 #include "app/app_switches.h" | 18 #include "app/app_switches.h" |
| 19 #include "base/command_line.h" | 19 #include "base/command_line.h" |
| 20 #include "base/logging.h" | 20 #include "base/logging.h" |
| 21 #include "base/metrics/field_trial.h" | 21 #include "base/metrics/field_trial.h" |
| 22 #include "base/metrics/histogram.h" | 22 #include "base/metrics/histogram.h" |
| 23 #include "base/path_service.h" | 23 #include "base/path_service.h" |
| 24 #include "base/platform_file.h" | 24 #include "base/platform_file.h" |
| 25 #include "base/stl_util-inl.h" | 25 #include "base/stl_util-inl.h" |
| 26 #include "base/string_util.h" | 26 #include "base/string_util.h" |
| 27 #include "base/thread.h" | 27 #include "base/thread.h" |
| 28 #include "base/thread_restrictions.h" | 28 #include "base/thread_restrictions.h" |
| 29 #include "chrome/browser/appcache/appcache_dispatcher_host.h" | |
| 29 #include "chrome/browser/browser_child_process_host.h" | 30 #include "chrome/browser/browser_child_process_host.h" |
| 30 #include "chrome/browser/browser_process.h" | 31 #include "chrome/browser/browser_process.h" |
| 31 #include "chrome/browser/child_process_security_policy.h" | 32 #include "chrome/browser/child_process_security_policy.h" |
| 32 #include "chrome/browser/extensions/extension_event_router.h" | 33 #include "chrome/browser/extensions/extension_event_router.h" |
| 33 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 34 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 34 #include "chrome/browser/extensions/extension_message_service.h" | 35 #include "chrome/browser/extensions/extension_message_service.h" |
| 35 #include "chrome/browser/extensions/extensions_service.h" | 36 #include "chrome/browser/extensions/extensions_service.h" |
| 36 #include "chrome/browser/extensions/user_script_master.h" | 37 #include "chrome/browser/extensions/user_script_master.h" |
| 37 #include "chrome/browser/gpu_process_host.h" | 38 #include "chrome/browser/gpu_process_host.h" |
| 38 #include "chrome/browser/history/history.h" | 39 #include "chrome/browser/history/history.h" |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 376 scoped_refptr<ResourceMessageFilter> resource_message_filter( | 377 scoped_refptr<ResourceMessageFilter> resource_message_filter( |
| 377 new ResourceMessageFilter(g_browser_process->resource_dispatcher_host(), | 378 new ResourceMessageFilter(g_browser_process->resource_dispatcher_host(), |
| 378 id(), | 379 id(), |
| 379 PluginService::GetInstance(), | 380 PluginService::GetInstance(), |
| 380 g_browser_process->print_job_manager(), | 381 g_browser_process->print_job_manager(), |
| 381 profile(), | 382 profile(), |
| 382 widget_helper_)); | 383 widget_helper_)); |
| 383 channel_->AddFilter(resource_message_filter); | 384 channel_->AddFilter(resource_message_filter); |
| 384 | 385 |
| 385 channel_->AddFilter(new AudioRendererHost()); | 386 channel_->AddFilter(new AudioRendererHost()); |
| 387 channel_->AddFilter( | |
|
jennb
2010/12/04 00:31:51
Does order of the filters matter? I.e. would we w
| |
| 388 new AppCacheDispatcherHost(profile()->GetRequestContext(), id())); | |
| 386 channel_->AddFilter(new PepperFileMessageFilter(id(), profile())); | 389 channel_->AddFilter(new PepperFileMessageFilter(id(), profile())); |
| 387 } | 390 } |
| 388 | 391 |
| 389 int BrowserRenderProcessHost::GetNextRoutingID() { | 392 int BrowserRenderProcessHost::GetNextRoutingID() { |
| 390 return widget_helper_->GetNextRoutingID(); | 393 return widget_helper_->GetNextRoutingID(); |
| 391 } | 394 } |
| 392 | 395 |
| 393 void BrowserRenderProcessHost::CancelResourceRequests(int render_widget_id) { | 396 void BrowserRenderProcessHost::CancelResourceRequests(int render_widget_id) { |
| 394 widget_helper_->CancelResourceRequests(render_widget_id); | 397 widget_helper_->CancelResourceRequests(render_widget_id); |
| 395 } | 398 } |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1168 IPC::InvalidPlatformFileForTransit(), | 1171 IPC::InvalidPlatformFileForTransit(), |
| 1169 std::vector<std::string>(), | 1172 std::vector<std::string>(), |
| 1170 std::string(), | 1173 std::string(), |
| 1171 false)); | 1174 false)); |
| 1172 } | 1175 } |
| 1173 } | 1176 } |
| 1174 | 1177 |
| 1175 void BrowserRenderProcessHost::EnableAutoSpellCorrect(bool enable) { | 1178 void BrowserRenderProcessHost::EnableAutoSpellCorrect(bool enable) { |
| 1176 Send(new ViewMsg_SpellChecker_EnableAutoSpellCorrect(enable)); | 1179 Send(new ViewMsg_SpellChecker_EnableAutoSpellCorrect(enable)); |
| 1177 } | 1180 } |
| OLD | NEW |