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

Side by Side Diff: webkit/glue/weburlloader_impl.cc

Issue 7601026: Use consistent timestamps for data: url request info. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
« no previous file with comments | « no previous file | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. 5 // An implementation of WebURLLoader in terms of ResourceLoaderBridge.
6 6
7 #include "webkit/glue/weburlloader_impl.h" 7 #include "webkit/glue/weburlloader_impl.h"
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 // Extracts the information from a data: url. 112 // Extracts the information from a data: url.
113 bool GetInfoFromDataURL(const GURL& url, 113 bool GetInfoFromDataURL(const GURL& url,
114 ResourceResponseInfo* info, 114 ResourceResponseInfo* info,
115 std::string* data, 115 std::string* data,
116 net::URLRequestStatus* status) { 116 net::URLRequestStatus* status) {
117 std::string mime_type; 117 std::string mime_type;
118 std::string charset; 118 std::string charset;
119 if (net::DataURL::Parse(url, &mime_type, &charset, data)) { 119 if (net::DataURL::Parse(url, &mime_type, &charset, data)) {
120 *status = net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0); 120 *status = net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0);
121 info->request_time = Time::Now(); 121 // Assure same time for all time fields of data: URLs.
122 info->response_time = Time::Now(); 122 Time now = Time::Now();
123 info->load_timing.base_time = now;
124 info->request_time = now;
125 info->response_time = now;
123 info->headers = NULL; 126 info->headers = NULL;
124 info->mime_type.swap(mime_type); 127 info->mime_type.swap(mime_type);
125 info->charset.swap(charset); 128 info->charset.swap(charset);
126 info->security_info.clear(); 129 info->security_info.clear();
127 info->content_length = -1; 130 info->content_length = -1;
128 info->encoded_data_length = 0; 131 info->encoded_data_length = 0;
129 info->load_timing.base_time = Time::Now();
130 132
131 return true; 133 return true;
132 } 134 }
133 135
134 *status = net::URLRequestStatus(net::URLRequestStatus::FAILED, 136 *status = net::URLRequestStatus(net::URLRequestStatus::FAILED,
135 net::ERR_INVALID_URL); 137 net::ERR_INVALID_URL);
136 return false; 138 return false;
137 } 139 }
138 140
139 typedef ResourceDevToolsInfo::HeadersVector HeadersVector; 141 typedef ResourceDevToolsInfo::HeadersVector HeadersVector;
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 723
722 void WebURLLoaderImpl::cancel() { 724 void WebURLLoaderImpl::cancel() {
723 context_->Cancel(); 725 context_->Cancel();
724 } 726 }
725 727
726 void WebURLLoaderImpl::setDefersLoading(bool value) { 728 void WebURLLoaderImpl::setDefersLoading(bool value) {
727 context_->SetDefersLoading(value); 729 context_->SetDefersLoading(value);
728 } 730 }
729 731
730 } // namespace webkit_glue 732 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698