| 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> |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 field_trial_states); | 584 field_trial_states); |
| 585 } | 585 } |
| 586 | 586 |
| 587 BrowserChildProcessHost::SetCrashReporterCommandLine(command_line); | 587 BrowserChildProcessHost::SetCrashReporterCommandLine(command_line); |
| 588 | 588 |
| 589 FilePath user_data_dir = | 589 FilePath user_data_dir = |
| 590 browser_command_line.GetSwitchValuePath(switches::kUserDataDir); | 590 browser_command_line.GetSwitchValuePath(switches::kUserDataDir); |
| 591 if (!user_data_dir.empty()) | 591 if (!user_data_dir.empty()) |
| 592 command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir); | 592 command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir); |
| 593 #if defined(OS_CHROMEOS) | 593 #if defined(OS_CHROMEOS) |
| 594 const std::string& profile = | 594 const std::string& login_profile = |
| 595 browser_command_line.GetSwitchValueASCII(switches::kLoginProfile); | 595 browser_command_line.GetSwitchValueASCII(switches::kLoginProfile); |
| 596 if (!profile.empty()) | 596 if (!login_profile.empty()) |
| 597 command_line->AppendSwitchASCII(switches::kLoginProfile, profile); | 597 command_line->AppendSwitchASCII(switches::kLoginProfile, login_profile); |
| 598 #endif | 598 #endif |
| 599 |
| 600 PrefService* prefs = profile()->GetPrefs(); |
| 601 // Currently this pref is only registered if applied via a policy. |
| 602 if (prefs->HasPrefPath(prefs::kDisable3DAPIs) && |
| 603 prefs->GetBoolean(prefs::kDisable3DAPIs)) { |
| 604 // Turn this policy into a command line switch. |
| 605 command_line->AppendSwitch(switches::kDisable3DAPIs); |
| 606 } |
| 599 } | 607 } |
| 600 | 608 |
| 601 void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer( | 609 void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer( |
| 602 const CommandLine& browser_cmd, | 610 const CommandLine& browser_cmd, |
| 603 CommandLine* renderer_cmd) const { | 611 CommandLine* renderer_cmd) const { |
| 604 // Propagate the following switches to the renderer command line (along | 612 // Propagate the following switches to the renderer command line (along |
| 605 // with any associated values) if present in the browser command line. | 613 // with any associated values) if present in the browser command line. |
| 606 static const char* const kSwitchNames[] = { | 614 static const char* const kSwitchNames[] = { |
| 607 switches::kRendererAssertTest, | 615 switches::kRendererAssertTest, |
| 608 #if !defined(OFFICIAL_BUILD) | 616 #if !defined(OFFICIAL_BUILD) |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 switches::kBlockNonSandboxedPlugins, | 699 switches::kBlockNonSandboxedPlugins, |
| 692 switches::kBlockOutdatedPlugins, | 700 switches::kBlockOutdatedPlugins, |
| 693 switches::kEnableRemoting, | 701 switches::kEnableRemoting, |
| 694 switches::kEnableClickToPlay, | 702 switches::kEnableClickToPlay, |
| 695 switches::kEnableResourceContentSettings, | 703 switches::kEnableResourceContentSettings, |
| 696 switches::kPrelaunchGpuProcess, | 704 switches::kPrelaunchGpuProcess, |
| 697 switches::kEnableAcceleratedDecoding, | 705 switches::kEnableAcceleratedDecoding, |
| 698 switches::kDisableFileSystem, | 706 switches::kDisableFileSystem, |
| 699 switches::kPpapiOutOfProcess, | 707 switches::kPpapiOutOfProcess, |
| 700 switches::kEnablePrintPreview, | 708 switches::kEnablePrintPreview, |
| 701 switches::kEnableCrxlessWebApps | 709 switches::kEnableCrxlessWebApps, |
| 710 switches::kDisable3DAPIs |
| 702 }; | 711 }; |
| 703 renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames, | 712 renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames, |
| 704 arraysize(kSwitchNames)); | 713 arraysize(kSwitchNames)); |
| 705 | 714 |
| 706 // Disable databases in incognito mode. | 715 // Disable databases in incognito mode. |
| 707 if (profile()->IsOffTheRecord() && | 716 if (profile()->IsOffTheRecord() && |
| 708 !browser_cmd.HasSwitch(switches::kDisableDatabases)) { | 717 !browser_cmd.HasSwitch(switches::kDisableDatabases)) { |
| 709 renderer_cmd->AppendSwitch(switches::kDisableDatabases); | 718 renderer_cmd->AppendSwitch(switches::kDisableDatabases); |
| 710 } | 719 } |
| 711 | 720 |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1289 IPC::PlatformFileForTransit file; | 1298 IPC::PlatformFileForTransit file; |
| 1290 #if defined(OS_POSIX) | 1299 #if defined(OS_POSIX) |
| 1291 file = base::FileDescriptor(model_file, false); | 1300 file = base::FileDescriptor(model_file, false); |
| 1292 #elif defined(OS_WIN) | 1301 #elif defined(OS_WIN) |
| 1293 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, | 1302 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, |
| 1294 false, DUPLICATE_SAME_ACCESS); | 1303 false, DUPLICATE_SAME_ACCESS); |
| 1295 #endif | 1304 #endif |
| 1296 Send(new ViewMsg_SetPhishingModel(file)); | 1305 Send(new ViewMsg_SetPhishingModel(file)); |
| 1297 } | 1306 } |
| 1298 } | 1307 } |
| OLD | NEW |