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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 const base::Time end_time, | 450 const base::Time end_time, |
451 const net::CompletionCallback& callback) { | 451 const net::CompletionCallback& callback) { |
452 return net::ERR_NOT_IMPLEMENTED; | 452 return net::ERR_NOT_IMPLEMENTED; |
453 } | 453 } |
454 | 454 |
455 int MockDiskCache::DoomEntriesSince(const base::Time initial_time, | 455 int MockDiskCache::DoomEntriesSince(const base::Time initial_time, |
456 const net::CompletionCallback& callback) { | 456 const net::CompletionCallback& callback) { |
457 return net::ERR_NOT_IMPLEMENTED; | 457 return net::ERR_NOT_IMPLEMENTED; |
458 } | 458 } |
459 | 459 |
460 class MockDiskCache::NotImplementedIterator : public Iterator { | 460 int MockDiskCache::OpenNextEntry(void** iter, disk_cache::Entry** next_entry, |
461 public: | 461 const net::CompletionCallback& callback) { |
462 virtual int OpenNextEntry(disk_cache::Entry** next_entry, | 462 return net::ERR_NOT_IMPLEMENTED; |
463 const net::CompletionCallback& callback) OVERRIDE { | 463 } |
464 return net::ERR_NOT_IMPLEMENTED; | |
465 } | |
466 }; | |
467 | 464 |
468 scoped_ptr<disk_cache::Backend::Iterator> MockDiskCache::CreateIterator() { | 465 void MockDiskCache::EndEnumeration(void** iter) { |
469 return scoped_ptr<Iterator>(new NotImplementedIterator()); | |
470 } | 466 } |
471 | 467 |
472 void MockDiskCache::GetStats( | 468 void MockDiskCache::GetStats( |
473 std::vector<std::pair<std::string, std::string> >* stats) { | 469 std::vector<std::pair<std::string, std::string> >* stats) { |
474 } | 470 } |
475 | 471 |
476 void MockDiskCache::OnExternalCacheHit(const std::string& key) { | 472 void MockDiskCache::OnExternalCacheHit(const std::string& key) { |
477 } | 473 } |
478 | 474 |
479 void MockDiskCache::ReleaseAll() { | 475 void MockDiskCache::ReleaseAll() { |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 void MockBlockingBackendFactory::FinishCreation() { | 626 void MockBlockingBackendFactory::FinishCreation() { |
631 block_ = false; | 627 block_ = false; |
632 if (!callback_.is_null()) { | 628 if (!callback_.is_null()) { |
633 if (!fail_) | 629 if (!fail_) |
634 backend_->reset(new MockDiskCache()); | 630 backend_->reset(new MockDiskCache()); |
635 net::CompletionCallback cb = callback_; | 631 net::CompletionCallback cb = callback_; |
636 callback_.Reset(); | 632 callback_.Reset(); |
637 cb.Run(Result()); // This object can be deleted here. | 633 cb.Run(Result()); // This object can be deleted here. |
638 } | 634 } |
639 } | 635 } |
OLD | NEW |