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

Side by Side Diff: content/browser/cache_storage/cache_storage_manager.cc

Issue 2352853002: Disallow redundant Bind calls. (Closed)
Patch Set: static_assert message tweak 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/browser/cache_storage/cache_storage_manager.h" 5 #include "content/browser/cache_storage/cache_storage_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 for (const auto& key_value : cache_storage_map_) 300 for (const auto& key_value : cache_storage_map_)
301 origins.insert(key_value.first); 301 origins.insert(key_value.first);
302 302
303 base::ThreadTaskRunnerHandle::Get()->PostTask( 303 base::ThreadTaskRunnerHandle::Get()->PostTask(
304 FROM_HERE, base::Bind(callback, origins)); 304 FROM_HERE, base::Bind(callback, origins));
305 return; 305 return;
306 } 306 }
307 307
308 PostTaskAndReplyWithResult(cache_task_runner_.get(), FROM_HERE, 308 PostTaskAndReplyWithResult(cache_task_runner_.get(), FROM_HERE,
309 base::Bind(&ListOriginsOnTaskRunner, root_path_), 309 base::Bind(&ListOriginsOnTaskRunner, root_path_),
310 base::Bind(callback)); 310 callback);
311 } 311 }
312 312
313 void CacheStorageManager::GetOriginsForHost( 313 void CacheStorageManager::GetOriginsForHost(
314 const std::string& host, 314 const std::string& host,
315 const storage::QuotaClient::GetOriginsCallback& callback) { 315 const storage::QuotaClient::GetOriginsCallback& callback) {
316 DCHECK_CURRENTLY_ON(BrowserThread::IO); 316 DCHECK_CURRENTLY_ON(BrowserThread::IO);
317 317
318 if (IsMemoryBacked()) { 318 if (IsMemoryBacked()) {
319 std::set<GURL> origins; 319 std::set<GURL> origins;
320 for (const auto& key_value : cache_storage_map_) { 320 for (const auto& key_value : cache_storage_map_) {
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 const base::FilePath& old_path, 452 const base::FilePath& old_path,
453 const base::FilePath& new_path) { 453 const base::FilePath& new_path) {
454 if (base::PathExists(old_path)) { 454 if (base::PathExists(old_path)) {
455 if (!base::PathExists(new_path)) 455 if (!base::PathExists(new_path))
456 base::Move(old_path, new_path); 456 base::Move(old_path, new_path);
457 base::DeleteFile(old_path, /*recursive*/ true); 457 base::DeleteFile(old_path, /*recursive*/ true);
458 } 458 }
459 } 459 }
460 460
461 } // namespace content 461 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698