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

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 138513002: Plumb network stack information about existence of cached copy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to r248769. Created 6 years, 10 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" 7 #include "content/browser/loader/resource_dispatcher_host_impl.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 void AbortRequestBeforeItStarts(ResourceMessageFilter* filter, 151 void AbortRequestBeforeItStarts(ResourceMessageFilter* filter,
152 IPC::Message* sync_result, 152 IPC::Message* sync_result,
153 int request_id) { 153 int request_id) {
154 if (sync_result) { 154 if (sync_result) {
155 SyncLoadResult result; 155 SyncLoadResult result;
156 result.error_code = net::ERR_ABORTED; 156 result.error_code = net::ERR_ABORTED;
157 ResourceHostMsg_SyncLoad::WriteReplyParams(sync_result, result); 157 ResourceHostMsg_SyncLoad::WriteReplyParams(sync_result, result);
158 filter->Send(sync_result); 158 filter->Send(sync_result);
159 } else { 159 } else {
160 // Tell the renderer that this request was disallowed. 160 // Tell the renderer that this request was disallowed.
161 ResourceMsg_RequestCompleteData request_complete_data;
162 request_complete_data.error_code = net::ERR_ABORTED;
163 request_complete_data.was_ignored_by_handler = false;
164 request_complete_data.exists_in_cache = false;
165 // No security info needed, connection not established.
166 request_complete_data.completion_time = base::TimeTicks();
167
161 filter->Send(new ResourceMsg_RequestComplete( 168 filter->Send(new ResourceMsg_RequestComplete(
162 request_id, 169 request_id, request_complete_data));
163 net::ERR_ABORTED,
164 false,
165 std::string(), // No security info needed, connection not established.
166 base::TimeTicks()));
167 } 170 }
168 } 171 }
169 172
170 void SetReferrerForRequest(net::URLRequest* request, const Referrer& referrer) { 173 void SetReferrerForRequest(net::URLRequest* request, const Referrer& referrer) {
171 if (!referrer.url.is_valid() || 174 if (!referrer.url.is_valid() ||
172 CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoReferrers)) { 175 CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoReferrers)) {
173 request->SetReferrer(std::string()); 176 request->SetReferrer(std::string());
174 } else { 177 } else {
175 request->SetReferrer(referrer.url.spec()); 178 request->SetReferrer(referrer.url.spec());
176 } 179 }
(...skipping 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after
1980 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) 1983 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS)
1981 && !policy->CanReadRawCookies(child_id)) { 1984 && !policy->CanReadRawCookies(child_id)) {
1982 VLOG(1) << "Denied unauthorized request for raw headers"; 1985 VLOG(1) << "Denied unauthorized request for raw headers";
1983 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; 1986 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS;
1984 } 1987 }
1985 1988
1986 return load_flags; 1989 return load_flags;
1987 } 1990 }
1988 1991
1989 } // namespace content 1992 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/async_resource_handler.cc ('k') | content/child/npapi/plugin_url_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698