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

Side by Side Diff: chrome/browser/safe_browsing/client_side_detection_host.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_host.h" 5 #include "chrome/browser/safe_browsing/client_side_detection_host.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 return new ClientSideDetectionHost(tab); 316 return new ClientSideDetectionHost(tab);
317 } 317 }
318 318
319 ClientSideDetectionHost::ClientSideDetectionHost(WebContents* tab) 319 ClientSideDetectionHost::ClientSideDetectionHost(WebContents* tab)
320 : content::WebContentsObserver(tab), 320 : content::WebContentsObserver(tab),
321 csd_service_(NULL), 321 csd_service_(NULL),
322 classification_request_(NULL), 322 classification_request_(NULL),
323 should_extract_malware_features_(true), 323 should_extract_malware_features_(true),
324 should_classify_for_malware_(false), 324 should_classify_for_malware_(false),
325 pageload_complete_(false), 325 pageload_complete_(false),
326 weak_factory_(this), 326 unsafe_unique_page_id_(-1),
327 unsafe_unique_page_id_(-1) { 327 weak_factory_(this) {
328 DCHECK(tab); 328 DCHECK(tab);
329 // Note: csd_service_ and sb_service will be NULL here in testing. 329 // Note: csd_service_ and sb_service will be NULL here in testing.
330 csd_service_ = g_browser_process->safe_browsing_detection_service(); 330 csd_service_ = g_browser_process->safe_browsing_detection_service();
331 feature_extractor_.reset(new BrowserFeatureExtractor(tab, this)); 331 feature_extractor_.reset(new BrowserFeatureExtractor(tab, this));
332 registrar_.Add(this, content::NOTIFICATION_RESOURCE_RESPONSE_STARTED, 332 registrar_.Add(this, content::NOTIFICATION_RESOURCE_RESPONSE_STARTED,
333 content::Source<WebContents>(tab)); 333 content::Source<WebContents>(tab));
334 334
335 scoped_refptr<SafeBrowsingService> sb_service = 335 scoped_refptr<SafeBrowsingService> sb_service =
336 g_browser_process->safe_browsing_service(); 336 g_browser_process->safe_browsing_service();
337 if (sb_service.get()) { 337 if (sb_service.get()) {
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 ui_manager_->RemoveObserver(this); 737 ui_manager_->RemoveObserver(this);
738 738
739 ui_manager_ = ui_manager; 739 ui_manager_ = ui_manager;
740 if (ui_manager) 740 if (ui_manager)
741 ui_manager_->AddObserver(this); 741 ui_manager_->AddObserver(this);
742 742
743 database_manager_ = database_manager; 743 database_manager_ = database_manager;
744 } 744 }
745 745
746 } // namespace safe_browsing 746 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698