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

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

Issue 222009: Replace some net::ERR_FAILED generic error codes with more specific codes.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Address wtc's comments Created 11 years, 2 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
« no previous file with comments | « net/http/http_transaction_unittest.h ('k') | net/url_request/url_request_http_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) 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 private: 44 private:
45 int clients_; 45 int clients_;
46 }; 46 };
47 47
48 // A network client 48 // A network client
49 class Client { 49 class Client {
50 public: 50 public:
51 Client(net::HttpTransactionFactory* factory, const std::string& url) : 51 Client(net::HttpTransactionFactory* factory, const std::string& url) :
52 url_(url), 52 url_(url),
53 transaction_(factory->CreateTransaction()),
54 buffer_(new net::IOBuffer(kBufferSize)), 53 buffer_(new net::IOBuffer(kBufferSize)),
55 ALLOW_THIS_IN_INITIALIZER_LIST( 54 ALLOW_THIS_IN_INITIALIZER_LIST(
56 connect_callback_(this, &Client::OnConnectComplete)), 55 connect_callback_(this, &Client::OnConnectComplete)),
57 ALLOW_THIS_IN_INITIALIZER_LIST( 56 ALLOW_THIS_IN_INITIALIZER_LIST(
58 read_callback_(this, &Client::OnReadComplete)) { 57 read_callback_(this, &Client::OnReadComplete)) {
58 int rv = factory->CreateTransaction(&transaction_);
59 DCHECK_EQ(net::OK, rv);
59 buffer_->AddRef(); 60 buffer_->AddRef();
60 driver_->ClientStarted(); 61 driver_->ClientStarted();
61 request_info_.url = url_; 62 request_info_.url = url_;
62 request_info_.method = "GET"; 63 request_info_.method = "GET";
63 int state = transaction_->Start( 64 int state = transaction_->Start(
64 &request_info_, &connect_callback_, NULL); 65 &request_info_, &connect_callback_, NULL);
65 DCHECK(state == net::ERR_IO_PENDING); 66 DCHECK(state == net::ERR_IO_PENDING);
66 }; 67 };
67 68
68 private: 69 private:
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 std::string name(table.GetRowName(index)); 192 std::string name(table.GetRowName(index));
192 if (name.length() > 0) { 193 if (name.length() > 0) {
193 int value = table.GetRowValue(index); 194 int value = table.GetRowValue(index);
194 printf("%s:\t%d\n", name.c_str(), value); 195 printf("%s:\t%d\n", name.c_str(), value);
195 } 196 }
196 } 197 }
197 printf("</stats>\n"); 198 printf("</stats>\n");
198 } 199 }
199 return 0; 200 return 0;
200 } 201 }
OLDNEW
« no previous file with comments | « net/http/http_transaction_unittest.h ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698