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 "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 Loading... |
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 Loading... |
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 } |
OLD | NEW |