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

Side by Side Diff: chrome/browser/safe_browsing/client_side_detection_service.cc

Issue 570713007: Fix WeakPtrFactory member ordering in chrome/browser/safe_browsing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/safe_browsing/client_side_detection_service.h" 5 #include "chrome/browser/safe_browsing/client_side_detection_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 GURL original_url; 93 GURL original_url;
94 }; 94 };
95 95
96 ClientSideDetectionService::CacheState::CacheState(bool phish, base::Time time) 96 ClientSideDetectionService::CacheState::CacheState(bool phish, base::Time time)
97 : is_phishing(phish), 97 : is_phishing(phish),
98 timestamp(time) {} 98 timestamp(time) {}
99 99
100 ClientSideDetectionService::ClientSideDetectionService( 100 ClientSideDetectionService::ClientSideDetectionService(
101 net::URLRequestContextGetter* request_context_getter) 101 net::URLRequestContextGetter* request_context_getter)
102 : enabled_(false), 102 : enabled_(false),
103 weak_factory_(this), 103 request_context_getter_(request_context_getter),
104 request_context_getter_(request_context_getter) { 104 weak_factory_(this) {
105 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CREATED, 105 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CREATED,
106 content::NotificationService::AllBrowserContextsAndSources()); 106 content::NotificationService::AllBrowserContextsAndSources());
107 } 107 }
108 108
109 ClientSideDetectionService::~ClientSideDetectionService() { 109 ClientSideDetectionService::~ClientSideDetectionService() {
110 weak_factory_.InvalidateWeakPtrs(); 110 weak_factory_.InvalidateWeakPtrs();
111 STLDeleteContainerPairPointers(client_phishing_reports_.begin(), 111 STLDeleteContainerPairPointers(client_phishing_reports_.begin(),
112 client_phishing_reports_.end()); 112 client_phishing_reports_.end());
113 client_phishing_reports_.clear(); 113 client_phishing_reports_.clear();
114 STLDeleteContainerPairPointers(client_malware_reports_.begin(), 114 STLDeleteContainerPairPointers(client_malware_reports_.begin(),
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 GURL ClientSideDetectionService::GetClientReportUrl( 635 GURL ClientSideDetectionService::GetClientReportUrl(
636 const std::string& report_url) { 636 const std::string& report_url) {
637 GURL url(report_url); 637 GURL url(report_url);
638 std::string api_key = google_apis::GetAPIKey(); 638 std::string api_key = google_apis::GetAPIKey();
639 if (!api_key.empty()) 639 if (!api_key.empty())
640 url = url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true)); 640 url = url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true));
641 641
642 return url; 642 return url;
643 } 643 }
644 } // namespace safe_browsing 644 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/client_side_detection_service.h ('k') | chrome/browser/safe_browsing/safe_browsing_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698