Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(715)

Side by Side Diff: chrome/browser/renderer_host/browser_render_process_host.cc

Issue 6708059: Turn on client-side phishing detection for UMA users with SafeBrowsing enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 }; 776 };
777 renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames, 777 renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames,
778 arraysize(kSwitchNames)); 778 arraysize(kSwitchNames));
779 779
780 // Disable databases in incognito mode. 780 // Disable databases in incognito mode.
781 if (profile()->IsOffTheRecord() && 781 if (profile()->IsOffTheRecord() &&
782 !browser_cmd.HasSwitch(switches::kDisableDatabases)) { 782 !browser_cmd.HasSwitch(switches::kDisableDatabases)) {
783 renderer_cmd->AppendSwitch(switches::kDisableDatabases); 783 renderer_cmd->AppendSwitch(switches::kDisableDatabases);
784 } 784 }
785 785
786 // Only enable client-side phishing detection in the renderer if it is enabled 786 // Disable client-side phishing detection in the renderer if it is disabled
787 // in the browser process. 787 // in the browser process.
788 if (g_browser_process->safe_browsing_detection_service()) { 788 if (!g_browser_process->safe_browsing_detection_service()) {
789 renderer_cmd->AppendSwitch(switches::kEnableClientSidePhishingDetection); 789 renderer_cmd->AppendSwitch(switches::kDisableClientSidePhishingDetection);
790 } 790 }
791 } 791 }
792 792
793 base::ProcessHandle BrowserRenderProcessHost::GetHandle() { 793 base::ProcessHandle BrowserRenderProcessHost::GetHandle() {
794 // child_process_ is null either because we're in single process mode, we have 794 // child_process_ is null either because we're in single process mode, we have
795 // done fast termination, or the process has crashed. 795 // done fast termination, or the process has crashed.
796 if (run_renderer_in_process() || !child_process_.get()) 796 if (run_renderer_in_process() || !child_process_.get())
797 return base::Process::Current().handle(); 797 return base::Process::Current().handle();
798 798
799 if (child_process_->IsStarting()) 799 if (child_process_->IsStarting())
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 IPC::PlatformFileForTransit file; 1312 IPC::PlatformFileForTransit file;
1313 #if defined(OS_POSIX) 1313 #if defined(OS_POSIX)
1314 file = base::FileDescriptor(model_file, false); 1314 file = base::FileDescriptor(model_file, false);
1315 #elif defined(OS_WIN) 1315 #elif defined(OS_WIN)
1316 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, 1316 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0,
1317 false, DUPLICATE_SAME_ACCESS); 1317 false, DUPLICATE_SAME_ACCESS);
1318 #endif 1318 #endif
1319 Send(new SafeBrowsingMsg_SetPhishingModel(file)); 1319 Send(new SafeBrowsingMsg_SetPhishingModel(file));
1320 } 1320 }
1321 } 1321 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698