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

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

Issue 2814733002: Add the SocEng as a type for checking in CheckUrlForSubresourceFilter. (Closed)
Patch Set: rebased and changes sync strategy Created 3 years, 7 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
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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 client, ClientCallbackType::CHECK_RESOURCE_URL, stores_to_check, 269 client, ClientCallbackType::CHECK_RESOURCE_URL, stores_to_check,
270 std::vector<GURL>(1, url)); 270 std::vector<GURL>(1, url));
271 271
272 return HandleCheck(std::move(check)); 272 return HandleCheck(std::move(check));
273 } 273 }
274 274
275 bool V4LocalDatabaseManager::CheckUrlForSubresourceFilter(const GURL& url, 275 bool V4LocalDatabaseManager::CheckUrlForSubresourceFilter(const GURL& url,
276 Client* client) { 276 Client* client) {
277 DCHECK_CURRENTLY_ON(BrowserThread::IO); 277 DCHECK_CURRENTLY_ON(BrowserThread::IO);
278 278
279 StoresToCheck stores_to_check({GetUrlSubresourceFilterId()}); 279 StoresToCheck stores_to_check(
280 {GetUrlSocEngId(), GetUrlSubresourceFilterId()});
280 if (!AreStoresAvailableNow(stores_to_check) || !CanCheckUrl(url)) { 281 if (!AreStoresAvailableNow(stores_to_check) || !CanCheckUrl(url)) {
281 return true; 282 return true;
282 } 283 }
283 284
284 std::unique_ptr<PendingCheck> check = base::MakeUnique<PendingCheck>( 285 std::unique_ptr<PendingCheck> check = base::MakeUnique<PendingCheck>(
285 client, ClientCallbackType::CHECK_URL_FOR_SUBRESOURCE_FILTER, 286 client, ClientCallbackType::CHECK_URL_FOR_SUBRESOURCE_FILTER,
286 stores_to_check, std::vector<GURL>(1, url)); 287 stores_to_check, std::vector<GURL>(1, url));
287 288
288 return HandleCheck(std::move(check)); 289 return HandleCheck(std::move(check));
289 } 290 }
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 db_updated_callback_); 758 db_updated_callback_);
758 } 759 }
759 760
760 bool V4LocalDatabaseManager::AreStoresAvailableNow( 761 bool V4LocalDatabaseManager::AreStoresAvailableNow(
761 const StoresToCheck& stores_to_check) const { 762 const StoresToCheck& stores_to_check) const {
762 return enabled_ && v4_database_ && 763 return enabled_ && v4_database_ &&
763 v4_database_->AreStoresAvailable(stores_to_check); 764 v4_database_->AreStoresAvailable(stores_to_check);
764 } 765 }
765 766
766 } // namespace safe_browsing 767 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698