OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/safe_browsing/safe_browsing_service.h" | 5 #include "ios/chrome/browser/safe_browsing/safe_browsing_service.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 void ServiceShuttingDown(); | 83 void ServiceShuttingDown(); |
84 | 84 |
85 protected: | 85 protected: |
86 ~SafeBrowsingURLRequestContextGetter() override; | 86 ~SafeBrowsingURLRequestContextGetter() override; |
87 | 87 |
88 private: | 88 private: |
89 bool shut_down_; | 89 bool shut_down_; |
90 | 90 |
91 scoped_refptr<net::URLRequestContextGetter> system_context_getter_; | 91 scoped_refptr<net::URLRequestContextGetter> system_context_getter_; |
92 | 92 |
| 93 scoped_ptr<net::CookieStore> safe_browsing_cookie_store_; |
| 94 |
93 scoped_ptr<net::URLRequestContext> safe_browsing_request_context_; | 95 scoped_ptr<net::URLRequestContext> safe_browsing_request_context_; |
94 | 96 |
95 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; | 97 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; |
96 }; | 98 }; |
97 | 99 |
98 SafeBrowsingURLRequestContextGetter::SafeBrowsingURLRequestContextGetter( | 100 SafeBrowsingURLRequestContextGetter::SafeBrowsingURLRequestContextGetter( |
99 scoped_refptr<net::URLRequestContextGetter> system_context_getter) | 101 scoped_refptr<net::URLRequestContextGetter> system_context_getter) |
100 : shut_down_(false), | 102 : shut_down_(false), |
101 system_context_getter_(system_context_getter), | 103 system_context_getter_(system_context_getter), |
102 network_task_runner_( | 104 network_task_runner_( |
(...skipping 16 matching lines...) Expand all Loading... |
119 } | 121 } |
120 | 122 |
121 scoped_refptr<net::SQLitePersistentCookieStore> sqlite_store( | 123 scoped_refptr<net::SQLitePersistentCookieStore> sqlite_store( |
122 new net::SQLitePersistentCookieStore( | 124 new net::SQLitePersistentCookieStore( |
123 base::FilePath(SafeBrowsingService::GetBaseFilename().value() + | 125 base::FilePath(SafeBrowsingService::GetBaseFilename().value() + |
124 kCookiesFile), | 126 kCookiesFile), |
125 network_task_runner_, | 127 network_task_runner_, |
126 web::WebThread::GetBlockingPool()->GetSequencedTaskRunner( | 128 web::WebThread::GetBlockingPool()->GetSequencedTaskRunner( |
127 web::WebThread::GetBlockingPool()->GetSequenceToken()), | 129 web::WebThread::GetBlockingPool()->GetSequenceToken()), |
128 false, nullptr)); | 130 false, nullptr)); |
129 | 131 safe_browsing_cookie_store_.reset( |
| 132 new net::CookieMonster(sqlite_store.get(), nullptr)); |
130 safe_browsing_request_context_->set_cookie_store( | 133 safe_browsing_request_context_->set_cookie_store( |
131 new net::CookieMonster(sqlite_store.get(), nullptr)); | 134 safe_browsing_cookie_store_.get()); |
132 } | 135 } |
133 | 136 |
134 return safe_browsing_request_context_.get(); | 137 return safe_browsing_request_context_.get(); |
135 } | 138 } |
136 | 139 |
137 scoped_refptr<base::SingleThreadTaskRunner> | 140 scoped_refptr<base::SingleThreadTaskRunner> |
138 SafeBrowsingURLRequestContextGetter::GetNetworkTaskRunner() const { | 141 SafeBrowsingURLRequestContextGetter::GetNetworkTaskRunner() const { |
139 return network_task_runner_; | 142 return network_task_runner_; |
140 } | 143 } |
141 | 144 |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 } | 425 } |
423 | 426 |
424 void SafeBrowsingService::OnSendDownloadRecoveryReport( | 427 void SafeBrowsingService::OnSendDownloadRecoveryReport( |
425 const std::string& report) { | 428 const std::string& report) { |
426 DCHECK_CURRENTLY_ON(web::WebThread::IO); | 429 DCHECK_CURRENTLY_ON(web::WebThread::IO); |
427 if (ping_manager()) | 430 if (ping_manager()) |
428 ping_manager()->ReportThreatDetails(report); | 431 ping_manager()->ReportThreatDetails(report); |
429 } | 432 } |
430 | 433 |
431 } // namespace safe_browsing | 434 } // namespace safe_browsing |
OLD | NEW |