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.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" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 // We can override the test mode for a given operation by setting this global | 15 // We can override the test mode for a given operation by setting this global |
16 // variable. | 16 // variable. |
17 int g_test_mode = 0; | 17 int g_test_mode = 0; |
18 | 18 |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 void MockBlockingBackendFactory::FinishCreation() { | 610 void MockBlockingBackendFactory::FinishCreation() { |
611 block_ = false; | 611 block_ = false; |
612 if (!callback_.is_null()) { | 612 if (!callback_.is_null()) { |
613 if (!fail_) | 613 if (!fail_) |
614 *backend_ = new MockDiskCache(); | 614 *backend_ = new MockDiskCache(); |
615 net::CompletionCallback cb = callback_; | 615 net::CompletionCallback cb = callback_; |
616 callback_.Reset(); | 616 callback_.Reset(); |
617 cb.Run(Result()); // This object can be deleted here. | 617 cb.Run(Result()); // This object can be deleted here. |
618 } | 618 } |
619 } | 619 } |
OLD | NEW |