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

Side by Side Diff: content/common/net/url_fetcher_impl.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thakis comment, renamed LAZY_INSTANCE_INITIALIZER 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/common/net/url_fetcher_impl.h" 5 #include "content/common/net/url_fetcher_impl.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 fetchers_.erase(core); 309 fetchers_.erase(core);
310 } 310 }
311 311
312 void URLFetcherImpl::Core::Registry::CancelAll() { 312 void URLFetcherImpl::Core::Registry::CancelAll() {
313 while (!fetchers_.empty()) 313 while (!fetchers_.empty())
314 (*fetchers_.begin())->CancelURLRequest(); 314 (*fetchers_.begin())->CancelURLRequest();
315 } 315 }
316 316
317 // static 317 // static
318 base::LazyInstance<URLFetcherImpl::Core::Registry> 318 base::LazyInstance<URLFetcherImpl::Core::Registry>
319 URLFetcherImpl::Core::g_registry(base::LINKER_INITIALIZED); 319 URLFetcherImpl::Core::g_registry = LAZY_INSTANCE_INITIALIZER;
320 320
321 URLFetcherImpl::Core::TempFileWriter::TempFileWriter( 321 URLFetcherImpl::Core::TempFileWriter::TempFileWriter(
322 URLFetcherImpl::Core* core, 322 URLFetcherImpl::Core* core,
323 scoped_refptr<base::MessageLoopProxy> file_message_loop_proxy) 323 scoped_refptr<base::MessageLoopProxy> file_message_loop_proxy)
324 : core_(core), 324 : core_(core),
325 error_code_(base::PLATFORM_FILE_OK), 325 error_code_(base::PLATFORM_FILE_OK),
326 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), 326 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
327 file_message_loop_proxy_(file_message_loop_proxy), 327 file_message_loop_proxy_(file_message_loop_proxy),
328 temp_file_handle_(base::kInvalidPlatformFileValue) { 328 temp_file_handle_(base::kInvalidPlatformFileValue) {
329 } 329 }
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 1105
1106 // static 1106 // static
1107 content::URLFetcherFactory* URLFetcherImpl::factory() { 1107 content::URLFetcherFactory* URLFetcherImpl::factory() {
1108 return g_factory; 1108 return g_factory;
1109 } 1109 }
1110 1110
1111 // static 1111 // static
1112 void URLFetcherImpl::set_factory(content::URLFetcherFactory* factory) { 1112 void URLFetcherImpl::set_factory(content::URLFetcherFactory* factory) {
1113 g_factory = factory; 1113 g_factory = factory;
1114 } 1114 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698