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

Side by Side Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 11615011: Small modifications to safebrowsing code to make it simpler to add the extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 8 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <deque> 5 #include <deque>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 495
496 void SetThreatTypeForUrl(const GURL& url, SBThreatType threat_type) { 496 void SetThreatTypeForUrl(const GURL& url, SBThreatType threat_type) {
497 url_ = url; 497 url_ = url;
498 threat_type_ = threat_type; 498 threat_type_ = threat_type;
499 } 499 }
500 500
501 private: 501 private:
502 virtual ~FakeSafeBrowsingDatabaseManager() {} 502 virtual ~FakeSafeBrowsingDatabaseManager() {}
503 503
504 void OnCheckBrowseURLDone(const GURL& gurl, Client* client) { 504 void OnCheckBrowseURLDone(const GURL& gurl, Client* client) {
505 SafeBrowsingDatabaseManager::SafeBrowsingCheck check; 505 SafeBrowsingDatabaseManager::SafeBrowsingCheck check(
506 safe_browsing_util::MALWARE);
506 check.urls.push_back(gurl); 507 check.urls.push_back(gurl);
507 check.client = client; 508 check.client = client;
508 check.threat_type = threat_type_; 509 check.url_threats[gurl] = threat_type_;
509 client->OnSafeBrowsingResult(check); 510 client->OnSafeBrowsingResult(check);
510 } 511 }
511 512
512 GURL url_; 513 GURL url_;
513 SBThreatType threat_type_; 514 SBThreatType threat_type_;
514 DISALLOW_COPY_AND_ASSIGN(FakeSafeBrowsingDatabaseManager); 515 DISALLOW_COPY_AND_ASSIGN(FakeSafeBrowsingDatabaseManager);
515 }; 516 };
516 517
517 class FakeSafeBrowsingService : public SafeBrowsingService { 518 class FakeSafeBrowsingService : public SafeBrowsingService {
518 public: 519 public:
(...skipping 1988 matching lines...) Expand 10 before | Expand all | Expand 10 after
2507 channel_close_watcher.WatchChannel( 2508 channel_close_watcher.WatchChannel(
2508 chrome::GetActiveWebContents(browser())->GetRenderProcessHost()); 2509 chrome::GetActiveWebContents(browser())->GetRenderProcessHost());
2509 NavigateToDestURL(); 2510 NavigateToDestURL();
2510 channel_close_watcher.WaitForChannelClose(); 2511 channel_close_watcher.WaitForChannelClose();
2511 2512
2512 ASSERT_TRUE(IsEmptyPrerenderLinkManager()); 2513 ASSERT_TRUE(IsEmptyPrerenderLinkManager());
2513 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); 2514 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message();
2514 } 2515 }
2515 2516
2516 } // namespace prerender 2517 } // namespace prerender
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/database_manager.h » ('j') | chrome/browser/safe_browsing/database_manager.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698