| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |