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 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 }; | 777 }; |
778 renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames, | 778 renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames, |
779 arraysize(kSwitchNames)); | 779 arraysize(kSwitchNames)); |
780 | 780 |
781 // Disable databases in incognito mode. | 781 // Disable databases in incognito mode. |
782 if (profile()->IsOffTheRecord() && | 782 if (profile()->IsOffTheRecord() && |
783 !browser_cmd.HasSwitch(switches::kDisableDatabases)) { | 783 !browser_cmd.HasSwitch(switches::kDisableDatabases)) { |
784 renderer_cmd->AppendSwitch(switches::kDisableDatabases); | 784 renderer_cmd->AppendSwitch(switches::kDisableDatabases); |
785 } | 785 } |
786 | 786 |
787 // Only enable client-side phishing detection in the renderer if it is enabled | 787 // Disable client-side phishing detection in the renderer if it is disabled |
788 // in the browser process. | 788 // in the browser process. |
789 if (g_browser_process->safe_browsing_detection_service()) { | 789 if (!g_browser_process->safe_browsing_detection_service()) { |
790 renderer_cmd->AppendSwitch(switches::kEnableClientSidePhishingDetection); | 790 renderer_cmd->AppendSwitch(switches::kDisableClientSidePhishingDetection); |
791 } | 791 } |
792 } | 792 } |
793 | 793 |
794 base::ProcessHandle BrowserRenderProcessHost::GetHandle() { | 794 base::ProcessHandle BrowserRenderProcessHost::GetHandle() { |
795 // child_process_ is null either because we're in single process mode, we have | 795 // child_process_ is null either because we're in single process mode, we have |
796 // done fast termination, or the process has crashed. | 796 // done fast termination, or the process has crashed. |
797 if (run_renderer_in_process() || !child_process_.get()) | 797 if (run_renderer_in_process() || !child_process_.get()) |
798 return base::Process::Current().handle(); | 798 return base::Process::Current().handle(); |
799 | 799 |
800 if (child_process_->IsStarting()) | 800 if (child_process_->IsStarting()) |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1311 IPC::PlatformFileForTransit file; | 1311 IPC::PlatformFileForTransit file; |
1312 #if defined(OS_POSIX) | 1312 #if defined(OS_POSIX) |
1313 file = base::FileDescriptor(model_file, false); | 1313 file = base::FileDescriptor(model_file, false); |
1314 #elif defined(OS_WIN) | 1314 #elif defined(OS_WIN) |
1315 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, | 1315 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, |
1316 false, DUPLICATE_SAME_ACCESS); | 1316 false, DUPLICATE_SAME_ACCESS); |
1317 #endif | 1317 #endif |
1318 Send(new SafeBrowsingMsg_SetPhishingModel(file)); | 1318 Send(new SafeBrowsingMsg_SetPhishingModel(file)); |
1319 } | 1319 } |
1320 } | 1320 } |
OLD | NEW |