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

Side by Side Diff: net/url_request/url_request_test_job.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
« no previous file with comments | « net/url_request/url_request.cc ('k') | net/websockets/websocket_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "net/url_request/url_request_test_job.h" 5 #include "net/url_request/url_request_test_job.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/lazy_instance.h" 11 #include "base/lazy_instance.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "base/string_util.h" 13 #include "base/string_util.h"
14 #include "net/base/io_buffer.h" 14 #include "net/base/io_buffer.h"
15 #include "net/base/net_errors.h" 15 #include "net/base/net_errors.h"
16 #include "net/http/http_response_headers.h" 16 #include "net/http/http_response_headers.h"
17 #include "net/url_request/url_request.h" 17 #include "net/url_request/url_request.h"
18 18
19 namespace net { 19 namespace net {
20 20
21 namespace { 21 namespace {
22 22
23 typedef std::list<URLRequestTestJob*> URLRequestJobList; 23 typedef std::list<URLRequestTestJob*> URLRequestJobList;
24 base::LazyInstance<URLRequestJobList, 24 base::LazyInstance<URLRequestJobList,
25 base::LeakyLazyInstanceTraits<URLRequestJobList> > 25 base::LeakyLazyInstanceTraits<URLRequestJobList> >
26 g_pending_jobs(base::LINKER_INITIALIZED); 26 g_pending_jobs = LAZY_INSTANCE_INITIALIZER;
27 27
28 } // namespace 28 } // namespace
29 29
30 // static getters for known URLs 30 // static getters for known URLs
31 GURL URLRequestTestJob::test_url_1() { 31 GURL URLRequestTestJob::test_url_1() {
32 return GURL("test:url1"); 32 return GURL("test:url1");
33 } 33 }
34 GURL URLRequestTestJob::test_url_2() { 34 GURL URLRequestTestJob::test_url_2() {
35 return GURL("test:url2"); 35 return GURL("test:url2");
36 } 36 }
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 282
283 URLRequestTestJob* next_job(g_pending_jobs.Get().front()); 283 URLRequestTestJob* next_job(g_pending_jobs.Get().front());
284 g_pending_jobs.Get().pop_front(); 284 g_pending_jobs.Get().pop_front();
285 285
286 DCHECK(!next_job->auto_advance()); // auto_advance jobs should be in this q 286 DCHECK(!next_job->auto_advance()); // auto_advance jobs should be in this q
287 next_job->ProcessNextOperation(); 287 next_job->ProcessNextOperation();
288 return true; 288 return true;
289 } 289 }
290 290
291 } // namespace net 291 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request.cc ('k') | net/websockets/websocket_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698