OLD | NEW |
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/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 17 matching lines...) Expand all Loading... |
28 #include "content/browser/renderer_host/resource_request_details.h" | 28 #include "content/browser/renderer_host/resource_request_details.h" |
29 #include "content/browser/tab_contents/navigation_details.h" | 29 #include "content/browser/tab_contents/navigation_details.h" |
30 #include "content/browser/tab_contents/tab_contents.h" | 30 #include "content/browser/tab_contents/tab_contents.h" |
31 #include "content/common/view_messages.h" | 31 #include "content/common/view_messages.h" |
32 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
33 #include "content/public/browser/notification_details.h" | 33 #include "content/public/browser/notification_details.h" |
34 #include "content/public/browser/notification_source.h" | 34 #include "content/public/browser/notification_source.h" |
35 #include "content/public/browser/notification_types.h" | 35 #include "content/public/browser/notification_types.h" |
36 #include "googleurl/src/gurl.h" | 36 #include "googleurl/src/gurl.h" |
37 | 37 |
| 38 using content::BrowserThread; |
| 39 |
38 namespace safe_browsing { | 40 namespace safe_browsing { |
39 | 41 |
40 // This class is instantiated each time a new toplevel URL loads, and | 42 // This class is instantiated each time a new toplevel URL loads, and |
41 // asynchronously checks whether the phishing classifier should run for this | 43 // asynchronously checks whether the phishing classifier should run for this |
42 // URL. If so, it notifies the renderer with a StartPhishingDetection IPC. | 44 // URL. If so, it notifies the renderer with a StartPhishingDetection IPC. |
43 // Objects of this class are ref-counted and will be destroyed once nobody | 45 // Objects of this class are ref-counted and will be destroyed once nobody |
44 // uses it anymore. If |tab_contents|, |csd_service| or |host| go away you need | 46 // uses it anymore. If |tab_contents|, |csd_service| or |host| go away you need |
45 // to call Cancel(). We keep the |sb_service| alive in a ref pointer for as | 47 // to call Cancel(). We keep the |sb_service| alive in a ref pointer for as |
46 // long as it takes. | 48 // long as it takes. |
47 class ClientSideDetectionHost::ShouldClassifyUrlRequest | 49 class ClientSideDetectionHost::ShouldClassifyUrlRequest |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 if (sb_service_) { | 489 if (sb_service_) { |
488 sb_service_->RemoveObserver(this); | 490 sb_service_->RemoveObserver(this); |
489 } | 491 } |
490 sb_service_ = service; | 492 sb_service_ = service; |
491 if (sb_service_) { | 493 if (sb_service_) { |
492 sb_service_->AddObserver(this); | 494 sb_service_->AddObserver(this); |
493 } | 495 } |
494 } | 496 } |
495 | 497 |
496 } // namespace safe_browsing | 498 } // namespace safe_browsing |
OLD | NEW |