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

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

Issue 397853002: Refactor safe-browsing build-config definitions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup gn files Created 6 years, 5 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) 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/renderer_host/safe_browsing_resource_throttle_factory.h " 5 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.h "
6 6
7 #include "content/public/browser/resource_context.h" 7 #include "content/public/browser/resource_context.h"
8 #if defined(FULL_SAFE_BROWSING) 8
9 #if defined(SAFE_BROWSING_DATABASE)
9 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h" 10 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h"
10 #endif 11 #endif
11 12
12 using content::ResourceThrottle; 13 using content::ResourceThrottle;
13 14
14 // static 15 // static
15 SafeBrowsingResourceThrottleFactory* 16 SafeBrowsingResourceThrottleFactory*
16 SafeBrowsingResourceThrottleFactory::factory_ = NULL; 17 SafeBrowsingResourceThrottleFactory::factory_ = NULL;
17 18
18 // static 19 // static
19 ResourceThrottle* SafeBrowsingResourceThrottleFactory::Create( 20 ResourceThrottle* SafeBrowsingResourceThrottleFactory::Create(
20 net::URLRequest* request, 21 net::URLRequest* request,
21 content::ResourceContext* resource_context, 22 content::ResourceContext* resource_context,
22 bool is_subresource, 23 bool is_subresource,
23 SafeBrowsingService* service) { 24 SafeBrowsingService* service) {
24 25 #if defined(SAFE_BROWSING_SERVICE)
25 #if defined(FULL_SAFE_BROWSING)
26 if (factory_) 26 if (factory_)
27 return factory_->CreateResourceThrottle( 27 return factory_->CreateResourceThrottle(
28 request, resource_context, is_subresource, service); 28 request, resource_context, is_subresource, service);
29
30 #if defined(SAFE_BROWSING_DATABASE)
31 // Throttle consults a local database before proceeding.
29 return new SafeBrowsingResourceThrottle(request, is_subresource, service); 32 return new SafeBrowsingResourceThrottle(request, is_subresource, service);
30 #elif defined(MOBILE_SAFE_BROWSING) 33 #else
31 if (factory_)
32 return factory_->CreateResourceThrottle(
33 request, resource_context, is_subresource, service);
34 return NULL; 34 return NULL;
35 #endif // SAFE_BROWSING_DATABASE
36
35 #else 37 #else
36 #error Need to define {FULL|MOBILE} SAFE_BROWSING mode. 38 #error Need to define {FULL|MOBILE} SAFE_BROWSING mode.
37 #endif 39 #endif // SAFE_BROWSING_SERVICE
38 } 40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698