Index: net/url_request/url_request_test_job.cc |
diff --git a/net/url_request/url_request_test_job.cc b/net/url_request/url_request_test_job.cc |
index 7fd019c78f53e9fc980e4e1b944519ae62f74f64..48cf96e992fbeeca08953be49a197b0b89e0d1ec 100644 |
--- a/net/url_request/url_request_test_job.cc |
+++ b/net/url_request/url_request_test_job.cc |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -18,6 +18,8 @@ |
// object. |
static std::vector< scoped_refptr<URLRequestTestJob> > pending_jobs; |
wtc
2011/01/05 00:19:41
Nit: add a g_ prefix to the 'pending_jobs' variabl
tfarina
2011/01/05 01:09:59
Done.
|
+namespace net { |
+ |
// static getters for known URLs |
GURL URLRequestTestJob::test_url_1() { |
return GURL("test:url1"); |
@@ -70,13 +72,13 @@ std::string URLRequestTestJob::test_error_headers() { |
} |
// static |
-net::URLRequestJob* URLRequestTestJob::Factory(net::URLRequest* request, |
- const std::string& scheme) { |
+URLRequestJob* URLRequestTestJob::Factory(URLRequest* request, |
+ const std::string& scheme) { |
return new URLRequestTestJob(request); |
} |
-URLRequestTestJob::URLRequestTestJob(net::URLRequest* request) |
- : net::URLRequestJob(request), |
+URLRequestTestJob::URLRequestTestJob(URLRequest* request) |
+ : URLRequestJob(request), |
auto_advance_(false), |
stage_(WAITING), |
offset_(0), |
@@ -84,9 +86,9 @@ URLRequestTestJob::URLRequestTestJob(net::URLRequest* request) |
async_buf_size_(0) { |
} |
-URLRequestTestJob::URLRequestTestJob(net::URLRequest* request, |
+URLRequestTestJob::URLRequestTestJob(URLRequest* request, |
bool auto_advance) |
- : net::URLRequestJob(request), |
+ : URLRequestJob(request), |
auto_advance_(auto_advance), |
stage_(WAITING), |
offset_(0), |
@@ -94,14 +96,14 @@ URLRequestTestJob::URLRequestTestJob(net::URLRequest* request, |
async_buf_size_(0) { |
} |
-URLRequestTestJob::URLRequestTestJob(net::URLRequest* request, |
+URLRequestTestJob::URLRequestTestJob(URLRequest* request, |
const std::string& response_headers, |
const std::string& response_data, |
bool auto_advance) |
- : net::URLRequestJob(request), |
+ : URLRequestJob(request), |
auto_advance_(auto_advance), |
stage_(WAITING), |
- response_headers_(new net::HttpResponseHeaders(response_headers)), |
+ response_headers_(new HttpResponseHeaders(response_headers)), |
response_data_(response_data), |
offset_(0), |
async_buf_(NULL), |
@@ -127,7 +129,7 @@ void URLRequestTestJob::Start() { |
void URLRequestTestJob::StartAsync() { |
if (!response_headers_) { |
- response_headers_ = new net::HttpResponseHeaders(test_headers()); |
+ response_headers_ = new HttpResponseHeaders(test_headers()); |
if (request_->url().spec() == test_url_1().spec()) { |
response_data_ = test_data_1(); |
stage_ = DATA_AVAILABLE; // Simulate a synchronous response for this one. |
@@ -140,7 +142,7 @@ void URLRequestTestJob::StartAsync() { |
// FIXME(brettw) we may want to use WININET errors or have some more types |
// of errors |
NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, |
- net::ERR_INVALID_URL)); |
+ ERR_INVALID_URL)); |
// FIXME(brettw): this should emulate a network error, and not just fail |
// initiating a connection |
return; |
@@ -152,7 +154,7 @@ void URLRequestTestJob::StartAsync() { |
this->NotifyHeadersComplete(); |
} |
-bool URLRequestTestJob::ReadRawData(net::IOBuffer* buf, int buf_size, |
+bool URLRequestTestJob::ReadRawData(IOBuffer* buf, int buf_size, |
int *bytes_read) { |
if (stage_ == WAITING) { |
async_buf_ = buf; |
@@ -179,7 +181,7 @@ bool URLRequestTestJob::ReadRawData(net::IOBuffer* buf, int buf_size, |
return true; |
} |
-void URLRequestTestJob::GetResponseInfo(net::HttpResponseInfo* info) { |
+void URLRequestTestJob::GetResponseInfo(HttpResponseInfo* info) { |
if (response_headers_) |
info->headers = response_headers_; |
} |
@@ -207,7 +209,7 @@ bool URLRequestTestJob::IsRedirectResponse(GURL* location, |
void URLRequestTestJob::Kill() { |
stage_ = DONE; |
- net::URLRequestJob::Kill(); |
+ URLRequestJob::Kill(); |
} |
void URLRequestTestJob::ProcessNextOperation() { |
@@ -259,3 +261,5 @@ bool URLRequestTestJob::ProcessOnePendingMessage() { |
next_job->ProcessNextOperation(); |
return true; |
} |
+ |
+} // namespace net |