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

Side by Side Diff: net/http/http_transaction_unittest.cc

Issue 12886022: Implement offline mode behind a flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Setup OfflinePolicy for all started requests. Created 7 years, 8 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_response_info.cc ('k') | no next file » | 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) 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 "net/http/http_transaction_unittest.h" 5 #include "net/http/http_transaction_unittest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 257
258 std::string header_data = base::StringPrintf( 258 std::string header_data = base::StringPrintf(
259 "%s\n%s\n", resp_status.c_str(), resp_headers.c_str()); 259 "%s\n%s\n", resp_status.c_str(), resp_headers.c_str());
260 std::replace(header_data.begin(), header_data.end(), '\n', '\0'); 260 std::replace(header_data.begin(), header_data.end(), '\n', '\0');
261 261
262 response_.request_time = base::Time::Now(); 262 response_.request_time = base::Time::Now();
263 if (!t->request_time.is_null()) 263 if (!t->request_time.is_null())
264 response_.request_time = t->request_time; 264 response_.request_time = t->request_time;
265 265
266 response_.was_cached = false; 266 response_.was_cached = false;
267 response_.network_accessed = true;
267 268
268 response_.response_time = base::Time::Now(); 269 response_.response_time = base::Time::Now();
269 if (!t->response_time.is_null()) 270 if (!t->response_time.is_null())
270 response_.response_time = t->response_time; 271 response_.response_time = t->response_time;
271 272
272 response_.headers = new net::HttpResponseHeaders(header_data); 273 response_.headers = new net::HttpResponseHeaders(header_data);
273 response_.vary_data.Init(*request, *response_.headers); 274 response_.vary_data.Init(*request, *response_.headers);
274 response_.ssl_info.cert_status = t->cert_status; 275 response_.ssl_info.cert_status = t->cert_status;
275 data_ = resp_data; 276 data_ = resp_data;
276 277
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 409
409 if (rv > 0) 410 if (rv > 0)
410 content.append(buf->data(), rv); 411 content.append(buf->data(), rv);
411 else if (rv < 0) 412 else if (rv < 0)
412 return rv; 413 return rv;
413 } while (rv > 0); 414 } while (rv > 0);
414 415
415 result->swap(content); 416 result->swap(content);
416 return net::OK; 417 return net::OK;
417 } 418 }
OLDNEW
« no previous file with comments | « net/http/http_response_info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698