| 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 <limits> | 7 #include <limits> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/location.h" | 11 #include "base/location.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 14 #include "base/thread_task_runner_handle.h" | 14 #include "base/threading/thread_task_runner_handle.h" |
| 15 #include "net/base/completion_callback.h" | 15 #include "net/base/completion_callback.h" |
| 16 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 // We can override the test mode for a given operation by setting this global | 23 // We can override the test mode for a given operation by setting this global |
| 24 // variable. | 24 // variable. |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 if (!callback_.is_null()) { | 672 if (!callback_.is_null()) { |
| 673 if (!fail_) | 673 if (!fail_) |
| 674 backend_->reset(new MockDiskCache()); | 674 backend_->reset(new MockDiskCache()); |
| 675 CompletionCallback cb = callback_; | 675 CompletionCallback cb = callback_; |
| 676 callback_.Reset(); | 676 callback_.Reset(); |
| 677 cb.Run(Result()); // This object can be deleted here. | 677 cb.Run(Result()); // This object can be deleted here. |
| 678 } | 678 } |
| 679 } | 679 } |
| 680 | 680 |
| 681 } // namespace net | 681 } // namespace net |
| OLD | NEW |