Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 static StatsCounter requests("FetchClient.requests"); | 100 static StatsCounter requests("FetchClient.requests"); |
| 101 requests.Increment(); | 101 requests.Increment(); |
| 102 driver_->ClientStopped(); | 102 driver_->ClientStopped(); |
| 103 printf("."); | 103 printf("."); |
| 104 } | 104 } |
| 105 | 105 |
| 106 static const int kBufferSize = (16 * 1024); | 106 static const int kBufferSize = (16 * 1024); |
| 107 GURL url_; | 107 GURL url_; |
| 108 net::HttpRequestInfo request_info_; | 108 net::HttpRequestInfo request_info_; |
| 109 scoped_ptr<net::HttpTransaction> transaction_; | 109 scoped_ptr<net::HttpTransaction> transaction_; |
| 110 scoped_ptr<net::IOBuffer> buffer_; | 110 scoped_refptr<net::IOBuffer> buffer_; |
|
eroman
2009/11/05 20:52:19
good spot!
| |
| 111 net::CompletionCallbackImpl<Client> connect_callback_; | 111 net::CompletionCallbackImpl<Client> connect_callback_; |
| 112 net::CompletionCallbackImpl<Client> read_callback_; | 112 net::CompletionCallbackImpl<Client> read_callback_; |
| 113 Singleton<Driver> driver_; | 113 Singleton<Driver> driver_; |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 int main(int argc, char**argv) { | 116 int main(int argc, char**argv) { |
| 117 base::AtExitManager exit; | 117 base::AtExitManager exit; |
| 118 StatsTable table("fetchclient", 50, 1000); | 118 StatsTable table("fetchclient", 50, 1000); |
| 119 table.set_current(&table); | 119 table.set_current(&table); |
| 120 | 120 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 192 std::string name(table.GetRowName(index)); | 192 std::string name(table.GetRowName(index)); |
| 193 if (name.length() > 0) { | 193 if (name.length() > 0) { |
| 194 int value = table.GetRowValue(index); | 194 int value = table.GetRowValue(index); |
| 195 printf("%s:\t%d\n", name.c_str(), value); | 195 printf("%s:\t%d\n", name.c_str(), value); |
| 196 } | 196 } |
| 197 } | 197 } |
| 198 printf("</stats>\n"); | 198 printf("</stats>\n"); |
| 199 } | 199 } |
| 200 return 0; | 200 return 0; |
| 201 } | 201 } |
| OLD | NEW |