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

Side by Side Diff: chrome/renderer/safe_browsing/phishing_classifier_delegate.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/renderer/safe_browsing/phishing_classifier_delegate.h" 5 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 21 matching lines...) Expand all
32 32
33 namespace safe_browsing { 33 namespace safe_browsing {
34 34
35 static GURL StripRef(const GURL& url) { 35 static GURL StripRef(const GURL& url) {
36 GURL::Replacements replacements; 36 GURL::Replacements replacements;
37 replacements.ClearRef(); 37 replacements.ClearRef();
38 return url.ReplaceComponents(replacements); 38 return url.ReplaceComponents(replacements);
39 } 39 }
40 40
41 typedef std::set<PhishingClassifierDelegate*> PhishingClassifierDelegates; 41 typedef std::set<PhishingClassifierDelegate*> PhishingClassifierDelegates;
42 static base::LazyInstance<PhishingClassifierDelegates> 42 static base::LazyInstance<PhishingClassifierDelegates>::DestructorAtExit
43 g_delegates = LAZY_INSTANCE_INITIALIZER; 43 g_delegates = LAZY_INSTANCE_INITIALIZER;
44 44
45 static base::LazyInstance<std::unique_ptr<const safe_browsing::Scorer>> 45 static base::LazyInstance<std::unique_ptr<const safe_browsing::Scorer>>::
46 g_phishing_scorer = LAZY_INSTANCE_INITIALIZER; 46 DestructorAtExit g_phishing_scorer = LAZY_INSTANCE_INITIALIZER;
47 47
48 // static 48 // static
49 PhishingClassifierFilter* PhishingClassifierFilter::Create() { 49 PhishingClassifierFilter* PhishingClassifierFilter::Create() {
50 // Private constructor and public static Create() method to facilitate 50 // Private constructor and public static Create() method to facilitate
51 // stubbing out this class for binary-size reduction purposes. 51 // stubbing out this class for binary-size reduction purposes.
52 return new PhishingClassifierFilter(); 52 return new PhishingClassifierFilter();
53 } 53 }
54 54
55 PhishingClassifierFilter::PhishingClassifierFilter() 55 PhishingClassifierFilter::PhishingClassifierFilter()
56 : RenderThreadObserver() {} 56 : RenderThreadObserver() {}
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 &classifier_page_text_, 287 &classifier_page_text_,
288 base::Bind(&PhishingClassifierDelegate::ClassificationDone, 288 base::Bind(&PhishingClassifierDelegate::ClassificationDone,
289 base::Unretained(this))); 289 base::Unretained(this)));
290 } 290 }
291 291
292 void PhishingClassifierDelegate::OnDestruct() { 292 void PhishingClassifierDelegate::OnDestruct() {
293 delete this; 293 delete this;
294 } 294 }
295 295
296 } // namespace safe_browsing 296 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/renderer/pepper/pepper_flash_renderer_host.cc ('k') | chrome/service/cloud_print/cloud_print_token_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698