OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_SAFE_SEARCH_API_SAFE_SEARCH_URL_CHECKER_H_ | 5 #ifndef CHROME_BROWSER_SAFE_SEARCH_API_SAFE_SEARCH_URL_CHECKER_H_ |
6 #define CHROME_BROWSER_SAFE_SEARCH_API_SAFE_SEARCH_URL_CHECKER_H_ | 6 #define CHROME_BROWSER_SAFE_SEARCH_API_SAFE_SEARCH_URL_CHECKER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
| 10 #include <memory> |
| 11 #include <vector> |
| 12 |
10 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
11 #include "base/containers/mru_cache.h" | 14 #include "base/containers/mru_cache.h" |
12 #include "base/macros.h" | 15 #include "base/macros.h" |
13 #include "base/memory/scoped_vector.h" | |
14 #include "base/time/time.h" | 16 #include "base/time/time.h" |
15 #include "net/traffic_annotation/network_traffic_annotation.h" | 17 #include "net/traffic_annotation/network_traffic_annotation.h" |
16 #include "net/url_request/url_fetcher_delegate.h" | 18 #include "net/url_request/url_fetcher_delegate.h" |
17 #include "url/gurl.h" | 19 #include "url/gurl.h" |
18 | 20 |
19 namespace net { | 21 namespace net { |
20 class URLFetcher; | 22 class URLFetcher; |
21 class URLRequestContextGetter; | 23 class URLRequestContextGetter; |
22 } | 24 } |
23 | 25 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 bool uncertain; | 58 bool uncertain; |
57 base::TimeTicks timestamp; | 59 base::TimeTicks timestamp; |
58 }; | 60 }; |
59 | 61 |
60 // net::URLFetcherDelegate implementation. | 62 // net::URLFetcherDelegate implementation. |
61 void OnURLFetchComplete(const net::URLFetcher* source) override; | 63 void OnURLFetchComplete(const net::URLFetcher* source) override; |
62 | 64 |
63 net::URLRequestContextGetter* context_; | 65 net::URLRequestContextGetter* context_; |
64 const net::NetworkTrafficAnnotationTag traffic_annotation_; | 66 const net::NetworkTrafficAnnotationTag traffic_annotation_; |
65 | 67 |
66 ScopedVector<Check> checks_in_progress_; | 68 std::vector<std::unique_ptr<Check>> checks_in_progress_; |
67 | 69 |
68 base::MRUCache<GURL, CheckResult> cache_; | 70 base::MRUCache<GURL, CheckResult> cache_; |
69 base::TimeDelta cache_timeout_; | 71 base::TimeDelta cache_timeout_; |
70 | 72 |
71 DISALLOW_COPY_AND_ASSIGN(SafeSearchURLChecker); | 73 DISALLOW_COPY_AND_ASSIGN(SafeSearchURLChecker); |
72 }; | 74 }; |
73 | 75 |
74 #endif // CHROME_BROWSER_SAFE_SEARCH_API_SAFE_SEARCH_URL_CHECKER_H_ | 76 #endif // CHROME_BROWSER_SAFE_SEARCH_API_SAFE_SEARCH_URL_CHECKER_H_ |
OLD | NEW |