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_service.h" | 5 #include "chrome/browser/safe_browsing/client_side_detection_service.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util_proxy.h" | 9 #include "base/file_util_proxy.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
13 #include "base/platform_file.h" | 13 #include "base/platform_file.h" |
14 #include "base/scoped_ptr.h" | 14 #include "base/scoped_ptr.h" |
15 #include "base/stl_util-inl.h" | 15 #include "base/stl_util-inl.h" |
16 #include "base/task.h" | 16 #include "base/task.h" |
17 #include "base/time.h" | 17 #include "base/time.h" |
18 #include "chrome/browser/safe_browsing/csd.pb.h" | 18 #include "chrome/browser/safe_browsing/csd.pb.h" |
19 #include "chrome/browser/tab_contents/provisional_load_details.h" | |
20 #include "chrome/common/net/http_return.h" | 19 #include "chrome/common/net/http_return.h" |
21 #include "chrome/common/net/url_fetcher.h" | 20 #include "chrome/common/net/url_fetcher.h" |
22 #include "chrome/common/net/url_request_context_getter.h" | 21 #include "chrome/common/net/url_request_context_getter.h" |
23 #include "chrome/common/notification_service.h" | 22 #include "chrome/common/notification_service.h" |
24 #include "chrome/common/notification_type.h" | 23 #include "chrome/common/notification_type.h" |
25 #include "chrome/common/render_messages.h" | 24 #include "chrome/common/render_messages.h" |
26 #include "content/browser/browser_thread.h" | 25 #include "content/browser/browser_thread.h" |
27 #include "content/browser/renderer_host/render_view_host.h" | 26 #include "content/browser/renderer_host/render_view_host.h" |
| 27 #include "content/browser/tab_contents/provisional_load_details.h" |
28 #include "content/browser/tab_contents/tab_contents.h" | 28 #include "content/browser/tab_contents/tab_contents.h" |
29 #include "googleurl/src/gurl.h" | 29 #include "googleurl/src/gurl.h" |
30 #include "net/base/load_flags.h" | 30 #include "net/base/load_flags.h" |
31 #include "net/url_request/url_request_status.h" | 31 #include "net/url_request/url_request_status.h" |
32 | 32 |
33 namespace safe_browsing { | 33 namespace safe_browsing { |
34 | 34 |
35 const int ClientSideDetectionService::kMaxReportsPerInterval = 3; | 35 const int ClientSideDetectionService::kMaxReportsPerInterval = 3; |
36 | 36 |
37 const base::TimeDelta ClientSideDetectionService::kReportsInterval = | 37 const base::TimeDelta ClientSideDetectionService::kReportsInterval = |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 while (!phishing_report_times_.empty() && | 503 while (!phishing_report_times_.empty() && |
504 phishing_report_times_.front() < cutoff) { | 504 phishing_report_times_.front() < cutoff) { |
505 phishing_report_times_.pop(); | 505 phishing_report_times_.pop(); |
506 } | 506 } |
507 | 507 |
508 // Return the number of elements that are above the cutoff. | 508 // Return the number of elements that are above the cutoff. |
509 return phishing_report_times_.size(); | 509 return phishing_report_times_.size(); |
510 } | 510 } |
511 | 511 |
512 } // namespace safe_browsing | 512 } // namespace safe_browsing |
OLD | NEW |