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

Side by Side Diff: chrome/browser/loader/safe_browsing_resource_throttle.cc

Issue 2675063002: Browser tests for using the new SafeBrowsing protocol (v4) (Closed)
Patch Set: Use ANNOTATE_LEAKING_OBJECT_PTR Created 3 years, 10 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
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 "chrome/browser/loader/safe_browsing_resource_throttle.h" 5 #include "chrome/browser/loader/safe_browsing_resource_throttle.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 if (sb_service->database_manager()->IsSupported()) { 50 if (sb_service->database_manager()->IsSupported()) {
51 return new SafeBrowsingResourceThrottle(request, resource_type, sb_service); 51 return new SafeBrowsingResourceThrottle(request, resource_type, sb_service);
52 } 52 }
53 return nullptr; 53 return nullptr;
54 } 54 }
55 55
56 SafeBrowsingResourceThrottle::SafeBrowsingResourceThrottle( 56 SafeBrowsingResourceThrottle::SafeBrowsingResourceThrottle(
57 const net::URLRequest* request, 57 const net::URLRequest* request,
58 content::ResourceType resource_type, 58 content::ResourceType resource_type,
59 safe_browsing::SafeBrowsingService* sb_service) 59 safe_browsing::SafeBrowsingService* sb_service)
60 : safe_browsing::BaseResourceThrottle( 60 : safe_browsing::BaseResourceThrottle(request,
61 request, 61 resource_type,
62 resource_type, 62 sb_service->database_manager(),
63 safe_browsing::V4FeatureList::IsV4HybridEnabled() 63 sb_service->ui_manager()) {}
64 ? sb_service->v4_local_database_manager()
65 : sb_service->database_manager(),
66 sb_service->ui_manager()) {}
67 64
68 SafeBrowsingResourceThrottle::~SafeBrowsingResourceThrottle() {} 65 SafeBrowsingResourceThrottle::~SafeBrowsingResourceThrottle() {}
69 66
70 const char* SafeBrowsingResourceThrottle::GetNameForLogging() const { 67 const char* SafeBrowsingResourceThrottle::GetNameForLogging() const {
71 return "SafeBrowsingResourceThrottle"; 68 return "SafeBrowsingResourceThrottle";
72 } 69 }
73 70
74 void SafeBrowsingResourceThrottle::MaybeDestroyPrerenderContents( 71 void SafeBrowsingResourceThrottle::MaybeDestroyPrerenderContents(
75 const content::ResourceRequestInfo* info) { 72 const content::ResourceRequestInfo* info) {
76 // Destroy the prefetch with FINAL_STATUS_SAFEBROSWING. 73 // Destroy the prefetch with FINAL_STATUS_SAFEBROSWING.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 ui_manager->DisplayBlockingPage(resource); 123 ui_manager->DisplayBlockingPage(resource);
127 return; 124 return;
128 } 125 }
129 } 126 }
130 127
131 // Tab is gone or it's being prerendered. 128 // Tab is gone or it's being prerendered.
132 content::BrowserThread::PostTask( 129 content::BrowserThread::PostTask(
133 content::BrowserThread::IO, FROM_HERE, 130 content::BrowserThread::IO, FROM_HERE,
134 base::Bind(&SafeBrowsingResourceThrottle::Cancel, throttle)); 131 base::Bind(&SafeBrowsingResourceThrottle::Cancel, throttle));
135 } 132 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/safe_browsing/safe_browsing_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698