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

Side by Side Diff: net/tools/fetch/fetch_client.cc

Issue 10736066: Adding histograms showing fraction of page load times (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 }; 52 };
53 53
54 static base::LazyInstance<Driver> g_driver = LAZY_INSTANCE_INITIALIZER; 54 static base::LazyInstance<Driver> g_driver = LAZY_INSTANCE_INITIALIZER;
55 55
56 // A network client 56 // A network client
57 class Client { 57 class Client {
58 public: 58 public:
59 Client(net::HttpTransactionFactory* factory, const std::string& url) : 59 Client(net::HttpTransactionFactory* factory, const std::string& url) :
60 url_(url), 60 url_(url),
61 buffer_(new net::IOBuffer(kBufferSize)) { 61 buffer_(new net::IOBuffer(kBufferSize)) {
62 int rv = factory->CreateTransaction(&transaction_); 62 int rv = factory->CreateTransaction(&transaction_, NULL);
63 DCHECK_EQ(net::OK, rv); 63 DCHECK_EQ(net::OK, rv);
64 buffer_->AddRef(); 64 buffer_->AddRef();
65 g_driver.Get().ClientStarted(); 65 g_driver.Get().ClientStarted();
66 request_info_.url = url_; 66 request_info_.url = url_;
67 request_info_.method = "GET"; 67 request_info_.method = "GET";
68 int state = transaction_->Start( 68 int state = transaction_->Start(
69 &request_info_, 69 &request_info_,
70 base::Bind(&Client::OnConnectComplete, base::Unretained(this)), 70 base::Bind(&Client::OnConnectComplete, base::Unretained(this)),
71 net::BoundNetLog()); 71 net::BoundNetLog());
72 DCHECK(state == net::ERR_IO_PENDING); 72 DCHECK(state == net::ERR_IO_PENDING);
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 std::string name(table.GetRowName(index)); 216 std::string name(table.GetRowName(index));
217 if (name.length() > 0) { 217 if (name.length() > 0) {
218 int value = table.GetRowValue(index); 218 int value = table.GetRowValue(index);
219 printf("%s:\t%d\n", name.c_str(), value); 219 printf("%s:\t%d\n", name.c_str(), value);
220 } 220 }
221 } 221 }
222 printf("</stats>\n"); 222 printf("</stats>\n");
223 } 223 }
224 return 0; 224 return 0;
225 } 225 }
OLDNEW
« no previous file with comments | « net/proxy/proxy_script_fetcher_impl_unittest.cc ('k') | net/url_request/url_request_context_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698