| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "base/stl_util-inl.h" | 26 #include "base/stl_util-inl.h" |
| 27 #include "base/string_util.h" | 27 #include "base/string_util.h" |
| 28 #include "base/threading/thread.h" | 28 #include "base/threading/thread.h" |
| 29 #include "base/threading/thread_restrictions.h" | 29 #include "base/threading/thread_restrictions.h" |
| 30 #include "chrome/browser/browser_process.h" | 30 #include "chrome/browser/browser_process.h" |
| 31 #include "chrome/browser/extensions/extension_event_router.h" | 31 #include "chrome/browser/extensions/extension_event_router.h" |
| 32 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 32 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 33 #include "chrome/browser/extensions/extension_message_service.h" | 33 #include "chrome/browser/extensions/extension_message_service.h" |
| 34 #include "chrome/browser/extensions/extension_service.h" | 34 #include "chrome/browser/extensions/extension_service.h" |
| 35 #include "chrome/browser/extensions/user_script_master.h" | 35 #include "chrome/browser/extensions/user_script_master.h" |
| 36 #include "chrome/browser/gpu_data_manager.h" |
| 36 #include "chrome/browser/history/history.h" | 37 #include "chrome/browser/history/history.h" |
| 37 #include "chrome/browser/io_thread.h" | 38 #include "chrome/browser/io_thread.h" |
| 38 #include "chrome/browser/metrics/user_metrics.h" | 39 #include "chrome/browser/metrics/user_metrics.h" |
| 39 #include "chrome/browser/platform_util.h" | 40 #include "chrome/browser/platform_util.h" |
| 40 #include "chrome/browser/printing/printing_message_filter.h" | 41 #include "chrome/browser/printing/printing_message_filter.h" |
| 41 #include "chrome/browser/profiles/profile.h" | 42 #include "chrome/browser/profiles/profile.h" |
| 42 #include "chrome/browser/renderer_host/web_cache_manager.h" | 43 #include "chrome/browser/renderer_host/web_cache_manager.h" |
| 43 #include "chrome/browser/safe_browsing/client_side_detection_service.h" | 44 #include "chrome/browser/safe_browsing/client_side_detection_service.h" |
| 44 #include "chrome/browser/search_engines/search_provider_install_state_message_fi
lter.h" | 45 #include "chrome/browser/search_engines/search_provider_install_state_message_fi
lter.h" |
| 45 #include "chrome/browser/spellcheck_host.h" | 46 #include "chrome/browser/spellcheck_host.h" |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 command_line->AppendSwitchASCII(switches::kLoginProfile, login_profile); | 630 command_line->AppendSwitchASCII(switches::kLoginProfile, login_profile); |
| 630 #endif | 631 #endif |
| 631 | 632 |
| 632 PrefService* prefs = profile()->GetPrefs(); | 633 PrefService* prefs = profile()->GetPrefs(); |
| 633 // Currently this pref is only registered if applied via a policy. | 634 // Currently this pref is only registered if applied via a policy. |
| 634 if (prefs->HasPrefPath(prefs::kDisable3DAPIs) && | 635 if (prefs->HasPrefPath(prefs::kDisable3DAPIs) && |
| 635 prefs->GetBoolean(prefs::kDisable3DAPIs)) { | 636 prefs->GetBoolean(prefs::kDisable3DAPIs)) { |
| 636 // Turn this policy into a command line switch. | 637 // Turn this policy into a command line switch. |
| 637 command_line->AppendSwitch(switches::kDisable3DAPIs); | 638 command_line->AppendSwitch(switches::kDisable3DAPIs); |
| 638 } | 639 } |
| 640 |
| 641 // Appending disable-gpu-feature switches due to software rendering list. |
| 642 GpuDataManager* gpu_data_manager = GpuDataManager::GetInstance(); |
| 643 DCHECK(gpu_data_manager); |
| 644 gpu_data_manager->AppendRendererCommandLine(command_line); |
| 639 } | 645 } |
| 640 | 646 |
| 641 void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer( | 647 void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer( |
| 642 const CommandLine& browser_cmd, | 648 const CommandLine& browser_cmd, |
| 643 CommandLine* renderer_cmd) const { | 649 CommandLine* renderer_cmd) const { |
| 644 // Propagate the following switches to the renderer command line (along | 650 // Propagate the following switches to the renderer command line (along |
| 645 // with any associated values) if present in the browser command line. | 651 // with any associated values) if present in the browser command line. |
| 646 static const char* const kSwitchNames[] = { | 652 static const char* const kSwitchNames[] = { |
| 647 switches::kAllowOutdatedPlugins, | 653 switches::kAllowOutdatedPlugins, |
| 648 switches::kAllowScriptingGallery, | 654 switches::kAllowScriptingGallery, |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1279 IPC::PlatformFileForTransit file; | 1285 IPC::PlatformFileForTransit file; |
| 1280 #if defined(OS_POSIX) | 1286 #if defined(OS_POSIX) |
| 1281 file = base::FileDescriptor(model_file, false); | 1287 file = base::FileDescriptor(model_file, false); |
| 1282 #elif defined(OS_WIN) | 1288 #elif defined(OS_WIN) |
| 1283 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, | 1289 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, |
| 1284 false, DUPLICATE_SAME_ACCESS); | 1290 false, DUPLICATE_SAME_ACCESS); |
| 1285 #endif | 1291 #endif |
| 1286 Send(new ViewMsg_SetPhishingModel(file)); | 1292 Send(new ViewMsg_SetPhishingModel(file)); |
| 1287 } | 1293 } |
| 1288 } | 1294 } |
| OLD | NEW |