Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: content/browser/mock_resource_context.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: willchan comments + rebase Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698