| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |