Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 // This file should not be build on Android but is currently getting built. | 5 // This file should not be build on Android but is currently getting built. |
| 6 // TODO(vakh): Fix that: http://crbug.com/621647 | 6 // TODO(vakh): Fix that: http://crbug.com/621647 |
| 7 | 7 |
| 8 #include "components/safe_browsing_db/v4_local_database_manager.h" | 8 #include "components/safe_browsing_db/v4_local_database_manager.h" |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 140 if (!v4_database_) { | 140 if (!v4_database_) { |
| 141 queued_checks_.push_back(std::move(check)); | 141 queued_checks_.push_back(std::move(check)); |
| 142 return false; | 142 return false; |
| 143 } | 143 } |
| 144 | 144 |
| 145 FullHashToStoreAndHashPrefixesMap full_hash_to_store_and_hash_prefixes; | 145 FullHashToStoreAndHashPrefixesMap full_hash_to_store_and_hash_prefixes; |
| 146 if (!GetPrefixMatches(check, &full_hash_to_store_and_hash_prefixes)) { | 146 if (!GetPrefixMatches(check, &full_hash_to_store_and_hash_prefixes)) { |
| 147 return true; | 147 return true; |
| 148 } | 148 } |
| 149 | 149 |
| 150 PerformFullHashCheck(std::move(check), full_hash_to_store_and_hash_prefixes); | 150 BrowserThread::PostTask( |
| 151 BrowserThread::IO, FROM_HERE, | |
| 152 base::Bind(&V4LocalDatabaseManager::PerformFullHashCheck, this, | |
| 153 base::Passed(std::move(check)), | |
| 154 full_hash_to_store_and_hash_prefixes)); | |
|
Scott Hess - ex-Googler
2016/10/14 00:40:59
I was thinking this might introduce an extra spin
| |
| 151 return false; | 155 return false; |
| 152 } | 156 } |
| 153 | 157 |
| 154 bool V4LocalDatabaseManager::CheckDownloadUrl( | 158 bool V4LocalDatabaseManager::CheckDownloadUrl( |
| 155 const std::vector<GURL>& url_chain, | 159 const std::vector<GURL>& url_chain, |
| 156 Client* client) { | 160 Client* client) { |
| 157 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 161 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 158 // TODO(vakh): Implement this skeleton. | 162 // TODO(vakh): Implement this skeleton. |
| 159 return true; | 163 return true; |
| 160 } | 164 } |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 486 } | 490 } |
| 487 | 491 |
| 488 void V4LocalDatabaseManager::UpdateRequestCompleted( | 492 void V4LocalDatabaseManager::UpdateRequestCompleted( |
| 489 std::unique_ptr<ParsedServerResponse> parsed_server_response) { | 493 std::unique_ptr<ParsedServerResponse> parsed_server_response) { |
| 490 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 494 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 491 v4_database_->ApplyUpdate(std::move(parsed_server_response), | 495 v4_database_->ApplyUpdate(std::move(parsed_server_response), |
| 492 db_updated_callback_); | 496 db_updated_callback_); |
| 493 } | 497 } |
| 494 | 498 |
| 495 } // namespace safe_browsing | 499 } // namespace safe_browsing |
| OLD | NEW |