Chromium Code Reviews| 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 "chrome/browser/safe_browsing/remote_database_manager.h" | 5 #include "chrome/browser/safe_browsing/remote_database_manager.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| 11 #include "base/strings/string_split.h" | 11 #include "base/strings/string_split.h" |
| 12 #include "base/timer/elapsed_timer.h" | 12 #include "base/timer/elapsed_timer.h" |
| 13 #include "chrome/browser/safe_browsing/safe_browsing_api_handler.h" | 13 #include "chrome/browser/safe_browsing/safe_browsing_api_handler.h" |
| 14 #include "components/variations/variations_associated_data.h" | 14 #include "components/variations/variations_associated_data.h" |
| 15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 16 | 16 |
| 17 using content::BrowserThread; | 17 using content::BrowserThread; |
| 18 | 18 |
| 19 namespace { | 19 namespace safe_browsing { |
| 20 | 20 |
| 21 // Android field trial | 21 // Android field trial |
|
Nathan Parker
2015/11/05 22:00:52
These should be in anon-namespace.
vakh (old account. dont use)
2015/11/07 01:22:56
Done.
| |
| 22 const char kAndroidFieldExperiment[] = "SafeBrowsingAndroid"; | 22 const char kAndroidFieldExperiment[] = "SafeBrowsingAndroid"; |
| 23 const char kAndroidFieldParam[] = "enabled"; | 23 const char kAndroidFieldParam[] = "enabled"; |
| 24 const char kAndroidFieldParamEnabledValue[] = "true"; | 24 const char kAndroidFieldParamEnabledValue[] = "true"; |
| 25 const char kAndroidTypesToCheckParam[] = "types_to_check"; | 25 const char kAndroidTypesToCheckParam[] = "types_to_check"; |
| 26 | 26 |
| 27 } // namespace | |
| 28 | |
| 29 // | 27 // |
| 30 // RemoteSafeBrowsingDatabaseManager::ClientRequest methods | 28 // RemoteSafeBrowsingDatabaseManager::ClientRequest methods |
| 31 // | 29 // |
| 32 class RemoteSafeBrowsingDatabaseManager::ClientRequest { | 30 class RemoteSafeBrowsingDatabaseManager::ClientRequest { |
| 33 public: | 31 public: |
| 34 ClientRequest(Client* client, | 32 ClientRequest(Client* client, |
| 35 RemoteSafeBrowsingDatabaseManager* db_manager, | 33 RemoteSafeBrowsingDatabaseManager* db_manager, |
| 36 const GURL& url); | 34 const GURL& url); |
| 37 | 35 |
| 38 static void OnRequestDoneWeak(const base::WeakPtr<ClientRequest>& req, | 36 static void OnRequestDoneWeak(const base::WeakPtr<ClientRequest>& req, |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 256 | 254 |
| 257 // Call back and delete any remaining clients. OnRequestDone() modifies | 255 // Call back and delete any remaining clients. OnRequestDone() modifies |
| 258 // |current_requests_|, so we make a copy first. | 256 // |current_requests_|, so we make a copy first. |
| 259 std::vector<ClientRequest*> to_callback(current_requests_); | 257 std::vector<ClientRequest*> to_callback(current_requests_); |
| 260 for (auto req : to_callback) { | 258 for (auto req : to_callback) { |
| 261 DVLOG(1) << "Stopping: Invoking unfinished req for URL " << req->url(); | 259 DVLOG(1) << "Stopping: Invoking unfinished req for URL " << req->url(); |
| 262 req->OnRequestDone(SB_THREAT_TYPE_SAFE, std::string()); | 260 req->OnRequestDone(SB_THREAT_TYPE_SAFE, std::string()); |
| 263 } | 261 } |
| 264 enabled_ = false; | 262 enabled_ = false; |
| 265 } | 263 } |
| 264 | |
| 265 } // namespace safe_browsing | |
| OLD | NEW |