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 "content/browser/mock_resource_context.h" | 5 #include "content/browser/mock_resource_context.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "net/url_request/url_request_test_util.h" | 8 #include "net/url_request/url_request_test_util.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
11 | 11 |
12 static base::LazyInstance<MockResourceContext> | 12 static base::LazyInstance<MockResourceContext> |
13 g_mock_resource_context(base::LINKER_INITIALIZED); | 13 g_mock_resource_context = LAZY_INSTANCE_INITIALIZER; |
14 | 14 |
15 MockResourceContext* MockResourceContext::GetInstance() { | 15 MockResourceContext* MockResourceContext::GetInstance() { |
16 return &g_mock_resource_context.Get(); | 16 return &g_mock_resource_context.Get(); |
17 } | 17 } |
18 | 18 |
19 MockResourceContext::MockResourceContext() | 19 MockResourceContext::MockResourceContext() |
20 : test_request_context_(new TestURLRequestContext) { | 20 : test_request_context_(new TestURLRequestContext) { |
21 set_request_context(test_request_context_); | 21 set_request_context(test_request_context_); |
22 } | 22 } |
23 MockResourceContext::~MockResourceContext() {} | 23 MockResourceContext::~MockResourceContext() {} |
24 | 24 |
25 void MockResourceContext::EnsureInitialized() const {} | 25 void MockResourceContext::EnsureInitialized() const {} |
26 | 26 |
27 } // namespace content | 27 } // namespace content |
OLD | NEW |