OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 8 #include "base/message_loop.h" |
9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 entries_.erase(it); | 431 entries_.erase(it); |
432 } | 432 } |
433 | 433 |
434 if (GetTestModeForEntry(key) & TEST_MODE_SYNC_CACHE_START) | 434 if (GetTestModeForEntry(key) & TEST_MODE_SYNC_CACHE_START) |
435 return net::OK; | 435 return net::OK; |
436 | 436 |
437 CallbackLater(callback, net::OK); | 437 CallbackLater(callback, net::OK); |
438 return net::ERR_IO_PENDING; | 438 return net::ERR_IO_PENDING; |
439 } | 439 } |
440 | 440 |
441 int MockDiskCache::DoomAllEntries(net::OldCompletionCallback* callback) { | |
442 return net::ERR_NOT_IMPLEMENTED; | |
443 } | |
444 | |
445 int MockDiskCache::DoomAllEntries(const net::CompletionCallback& callback) { | 441 int MockDiskCache::DoomAllEntries(const net::CompletionCallback& callback) { |
446 return net::ERR_NOT_IMPLEMENTED; | 442 return net::ERR_NOT_IMPLEMENTED; |
447 } | 443 } |
448 | 444 |
449 int MockDiskCache::DoomEntriesBetween(const base::Time initial_time, | 445 int MockDiskCache::DoomEntriesBetween(const base::Time initial_time, |
450 const base::Time end_time, | 446 const base::Time end_time, |
451 net::OldCompletionCallback* callback) { | |
452 return net::ERR_NOT_IMPLEMENTED; | |
453 } | |
454 | |
455 int MockDiskCache::DoomEntriesBetween(const base::Time initial_time, | |
456 const base::Time end_time, | |
457 const net::CompletionCallback& callback) { | 447 const net::CompletionCallback& callback) { |
458 return net::ERR_NOT_IMPLEMENTED; | 448 return net::ERR_NOT_IMPLEMENTED; |
459 } | 449 } |
460 | 450 |
461 int MockDiskCache::DoomEntriesSince(const base::Time initial_time, | 451 int MockDiskCache::DoomEntriesSince(const base::Time initial_time, |
462 net::OldCompletionCallback* callback) { | 452 net::OldCompletionCallback* callback) { |
463 return net::ERR_NOT_IMPLEMENTED; | 453 return net::ERR_NOT_IMPLEMENTED; |
464 } | 454 } |
465 | 455 |
466 int MockDiskCache::OpenNextEntry(void** iter, disk_cache::Entry** next_entry, | 456 int MockDiskCache::OpenNextEntry(void** iter, disk_cache::Entry** next_entry, |
467 net::OldCompletionCallback* callback) { | |
468 return net::ERR_NOT_IMPLEMENTED; | |
469 } | |
470 | |
471 int MockDiskCache::OpenNextEntry(void** iter, disk_cache::Entry** next_entry, | |
472 const net::CompletionCallback& callback) { | 457 const net::CompletionCallback& callback) { |
473 return net::ERR_NOT_IMPLEMENTED; | 458 return net::ERR_NOT_IMPLEMENTED; |
474 } | 459 } |
475 | 460 |
476 void MockDiskCache::EndEnumeration(void** iter) { | 461 void MockDiskCache::EndEnumeration(void** iter) { |
477 } | 462 } |
478 | 463 |
479 void MockDiskCache::GetStats( | 464 void MockDiskCache::GetStats( |
480 std::vector<std::pair<std::string, std::string> >* stats) { | 465 std::vector<std::pair<std::string, std::string> >* stats) { |
481 } | 466 } |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 void MockBlockingBackendFactory::FinishCreation() { | 609 void MockBlockingBackendFactory::FinishCreation() { |
625 block_ = false; | 610 block_ = false; |
626 if (callback_) { | 611 if (callback_) { |
627 if (!fail_) | 612 if (!fail_) |
628 *backend_ = new MockDiskCache(); | 613 *backend_ = new MockDiskCache(); |
629 net::OldCompletionCallback* cb = callback_; | 614 net::OldCompletionCallback* cb = callback_; |
630 callback_ = NULL; | 615 callback_ = NULL; |
631 cb->Run(Result()); // This object can be deleted here. | 616 cb->Run(Result()); // This object can be deleted here. |
632 } | 617 } |
633 } | 618 } |
OLD | NEW |