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

Side by Side Diff: content/browser/renderer_host/sync_resource_handler.cc

Issue 10827103: Speculative resource prefetching - fixing missing navigations due to server side redirects. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Passing redirect_url as an argument to ResourceDispatcherHostDelegate::OnRequestRedirected. Created 8 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
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 "content/browser/renderer_host/sync_resource_handler.h" 5 #include "content/browser/renderer_host/sync_resource_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/browser/debugger/devtools_netlog_observer.h" 8 #include "content/browser/debugger/devtools_netlog_observer.h"
9 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" 9 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h"
10 #include "content/browser/renderer_host/resource_message_filter.h" 10 #include "content/browser/renderer_host/resource_message_filter.h"
(...skipping 30 matching lines...) Expand all
41 uint64 size) { 41 uint64 size) {
42 return true; 42 return true;
43 } 43 }
44 44
45 bool SyncResourceHandler::OnRequestRedirected( 45 bool SyncResourceHandler::OnRequestRedirected(
46 int request_id, 46 int request_id,
47 const GURL& new_url, 47 const GURL& new_url,
48 ResourceResponse* response, 48 ResourceResponse* response,
49 bool* defer) { 49 bool* defer) {
50 if (rdh_->delegate()) { 50 if (rdh_->delegate()) {
51 rdh_->delegate()->OnRequestRedirected(request_, filter_->resource_context(), 51 rdh_->delegate()->OnRequestRedirected(new_url,
James Hawkins 2012/08/02 18:17:50 Optional nit: Condense parameters to save lines.
Shishir 2012/08/02 18:25:43 Done.
52 request_,
53 filter_->resource_context(),
52 response); 54 response);
53 } 55 }
54 56
55 DevToolsNetLogObserver::PopulateResponseInfo(request_, response); 57 DevToolsNetLogObserver::PopulateResponseInfo(request_, response);
56 // TODO(darin): It would be much better if this could live in WebCore, but 58 // TODO(darin): It would be much better if this could live in WebCore, but
57 // doing so requires API changes at all levels. Similar code exists in 59 // doing so requires API changes at all levels. Similar code exists in
58 // WebCore/platform/network/cf/ResourceHandleCFNet.cpp :-( 60 // WebCore/platform/network/cf/ResourceHandleCFNet.cpp :-(
59 if (new_url.GetOrigin() != result_.final_url.GetOrigin()) { 61 if (new_url.GetOrigin() != result_.final_url.GetOrigin()) {
60 LOG(ERROR) << "Cross origin redirect denied"; 62 LOG(ERROR) << "Cross origin redirect denied";
61 return false; 63 return false;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 result_.encoded_data_length = 122 result_.encoded_data_length =
121 DevToolsNetLogObserver::GetAndResetEncodedDataLength(request_); 123 DevToolsNetLogObserver::GetAndResetEncodedDataLength(request_);
122 124
123 ResourceHostMsg_SyncLoad::WriteReplyParams(result_message_, result_); 125 ResourceHostMsg_SyncLoad::WriteReplyParams(result_message_, result_);
124 filter_->Send(result_message_); 126 filter_->Send(result_message_);
125 result_message_ = NULL; 127 result_message_ = NULL;
126 return true; 128 return true;
127 } 129 }
128 130
129 } // namespace content 131 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698