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

Side by Side Diff: net/http/mock_http_cache.cc

Issue 1112083002: Use of base::StringPairs appropriately in Mock_Http (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « net/http/mock_http_cache.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/http/mock_http_cache.h" 5 #include "net/http/mock_http_cache.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "net/base/completion_callback.h" 9 #include "net/base/completion_callback.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 int OpenNextEntry(disk_cache::Entry** next_entry, 476 int OpenNextEntry(disk_cache::Entry** next_entry,
477 const CompletionCallback& callback) override { 477 const CompletionCallback& callback) override {
478 return ERR_NOT_IMPLEMENTED; 478 return ERR_NOT_IMPLEMENTED;
479 } 479 }
480 }; 480 };
481 481
482 scoped_ptr<disk_cache::Backend::Iterator> MockDiskCache::CreateIterator() { 482 scoped_ptr<disk_cache::Backend::Iterator> MockDiskCache::CreateIterator() {
483 return scoped_ptr<Iterator>(new NotImplementedIterator()); 483 return scoped_ptr<Iterator>(new NotImplementedIterator());
484 } 484 }
485 485
486 void MockDiskCache::GetStats( 486 void MockDiskCache::GetStats(base::StringPairs* stats) {
487 std::vector<std::pair<std::string, std::string> >* stats) {
488 } 487 }
489 488
490 void MockDiskCache::OnExternalCacheHit(const std::string& key) { 489 void MockDiskCache::OnExternalCacheHit(const std::string& key) {
491 } 490 }
492 491
493 void MockDiskCache::ReleaseAll() { 492 void MockDiskCache::ReleaseAll() {
494 EntryMap::iterator it = entries_.begin(); 493 EntryMap::iterator it = entries_.begin();
495 for (; it != entries_.end(); ++it) 494 for (; it != entries_.end(); ++it)
496 it->second->Release(); 495 it->second->Release();
497 entries_.clear(); 496 entries_.clear();
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 if (!callback_.is_null()) { 655 if (!callback_.is_null()) {
657 if (!fail_) 656 if (!fail_)
658 backend_->reset(new MockDiskCache()); 657 backend_->reset(new MockDiskCache());
659 CompletionCallback cb = callback_; 658 CompletionCallback cb = callback_;
660 callback_.Reset(); 659 callback_.Reset();
661 cb.Run(Result()); // This object can be deleted here. 660 cb.Run(Result()); // This object can be deleted here.
662 } 661 }
663 } 662 }
664 663
665 } // namespace net 664 } // namespace net
OLDNEW
« no previous file with comments | « net/http/mock_http_cache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698