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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_service.cc

Issue 5544008: Add a browser test for safebrowsing service.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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) 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 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 5 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 cmdline->HasSwitch(switches::kDisableBackgroundNetworking); 426 cmdline->HasSwitch(switches::kDisableBackgroundNetworking);
427 std::string info_url_prefix = 427 std::string info_url_prefix =
428 cmdline->HasSwitch(switches::kSbInfoURLPrefix) ? 428 cmdline->HasSwitch(switches::kSbInfoURLPrefix) ?
429 cmdline->GetSwitchValueASCII(switches::kSbInfoURLPrefix) : 429 cmdline->GetSwitchValueASCII(switches::kSbInfoURLPrefix) :
430 kSbDefaultInfoURLPrefix; 430 kSbDefaultInfoURLPrefix;
431 std::string mackey_url_prefix = 431 std::string mackey_url_prefix =
432 cmdline->HasSwitch(switches::kSbMacKeyURLPrefix) ? 432 cmdline->HasSwitch(switches::kSbMacKeyURLPrefix) ?
433 cmdline->GetSwitchValueASCII(switches::kSbMacKeyURLPrefix) : 433 cmdline->GetSwitchValueASCII(switches::kSbMacKeyURLPrefix) :
434 kSbDefaultMacKeyURLPrefix; 434 kSbDefaultMacKeyURLPrefix;
435 435
436 protocol_manager_ = new SafeBrowsingProtocolManager(this, 436 DCHECK(!protocol_manager_);
437 client_name, 437 protocol_manager_ =
438 client_key, 438 SafeBrowsingProtocolManager::Create(this,
439 wrapped_key, 439 client_name,
440 request_context_getter, 440 client_key,
441 info_url_prefix, 441 wrapped_key,
442 mackey_url_prefix, 442 request_context_getter,
443 disable_auto_update); 443 info_url_prefix,
444 mackey_url_prefix,
445 disable_auto_update);
444 446
445 protocol_manager_->Initialize(); 447 protocol_manager_->Initialize();
446 } 448 }
447 449
448 void SafeBrowsingService::OnIOShutdown() { 450 void SafeBrowsingService::OnIOShutdown() {
449 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 451 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
450 if (!enabled_) 452 if (!enabled_)
451 return; 453 return;
452 454
453 enabled_ = false; 455 enabled_ = false;
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 // checkbox on the blocking page. 874 // checkbox on the blocking page.
873 void SafeBrowsingService::ReportMalwareDetails( 875 void SafeBrowsingService::ReportMalwareDetails(
874 scoped_refptr<MalwareDetails> details) { 876 scoped_refptr<MalwareDetails> details) {
875 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 877 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
876 scoped_ptr<const std::string> serialized(details->GetSerializedReport()); 878 scoped_ptr<const std::string> serialized(details->GetSerializedReport());
877 if (!serialized->empty()) { 879 if (!serialized->empty()) {
878 DVLOG(1) << "Sending serialized malware details."; 880 DVLOG(1) << "Sending serialized malware details.";
879 protocol_manager_->ReportMalwareDetails(*serialized); 881 protocol_manager_->ReportMalwareDetails(*serialized);
880 } 882 }
881 } 883 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698