Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: components/safe_browsing_db/v4_local_database_manager.cc

Issue 2421703002: Tiny: Post PerformFullHashCheck on IO thread, instead of calling it synchronously. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_local_database_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_local_database_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698