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

Side by Side Diff: net/tools/fetch/fetch_client.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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 void ClientStopped() { 42 void ClientStopped() {
43 if (!--clients_) { 43 if (!--clients_) {
44 MessageLoop::current()->Quit(); 44 MessageLoop::current()->Quit();
45 } 45 }
46 } 46 }
47 47
48 private: 48 private:
49 int clients_; 49 int clients_;
50 }; 50 };
51 51
52 static base::LazyInstance<Driver> g_driver(base::LINKER_INITIALIZED); 52 static base::LazyInstance<Driver> g_driver = LAZY_INSTANCE_INITIALIZER;
53 53
54 // A network client 54 // A network client
55 class Client { 55 class Client {
56 public: 56 public:
57 Client(net::HttpTransactionFactory* factory, const std::string& url) : 57 Client(net::HttpTransactionFactory* factory, const std::string& url) :
58 url_(url), 58 url_(url),
59 buffer_(new net::IOBuffer(kBufferSize)), 59 buffer_(new net::IOBuffer(kBufferSize)),
60 ALLOW_THIS_IN_INITIALIZER_LIST( 60 ALLOW_THIS_IN_INITIALIZER_LIST(
61 connect_callback_(this, &Client::OnConnectComplete)), 61 connect_callback_(this, &Client::OnConnectComplete)),
62 ALLOW_THIS_IN_INITIALIZER_LIST( 62 ALLOW_THIS_IN_INITIALIZER_LIST(
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 std::string name(table.GetRowName(index)); 213 std::string name(table.GetRowName(index));
214 if (name.length() > 0) { 214 if (name.length() > 0) {
215 int value = table.GetRowValue(index); 215 int value = table.GetRowValue(index);
216 printf("%s:\t%d\n", name.c_str(), value); 216 printf("%s:\t%d\n", name.c_str(), value);
217 } 217 }
218 } 218 }
219 printf("</stats>\n"); 219 printf("</stats>\n");
220 } 220 }
221 return 0; 221 return 0;
222 } 222 }
OLDNEW
« no previous file with comments | « net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp ('k') | net/url_request/url_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698