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

Unified Diff: content/browser/renderer_host/resource_dispatcher_host_impl.cc

Issue 10414035: Move TransferNavigationResourceThrottle to content since that's where it belongs. This is a step in… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/resource_dispatcher_host_impl.cc
===================================================================
--- content/browser/renderer_host/resource_dispatcher_host_impl.cc (revision 138143)
+++ content/browser/renderer_host/resource_dispatcher_host_impl.cc (working copy)
@@ -39,7 +39,7 @@
#include "content/browser/renderer_host/redirect_to_file_resource_handler.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/renderer_host/resource_message_filter.h"
-#include "content/public/browser/resource_request_details.h"
+#include "content/browser/renderer_host/transfer_navigation_resource_throttle.h"
#include "content/browser/renderer_host/resource_request_info_impl.h"
#include "content/browser/renderer_host/sync_resource_handler.h"
#include "content/browser/renderer_host/throttling_resource_handler.h"
@@ -58,6 +58,7 @@
#include "content/public/browser/render_view_host_delegate.h"
#include "content/public/browser/resource_dispatcher_host_delegate.h"
#include "content/public/browser/resource_dispatcher_host_login_delegate.h"
+#include "content/public/browser/resource_request_details.h"
#include "content/public/browser/resource_throttle.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/process_type.h"
@@ -898,24 +899,33 @@
// Insert a buffered event handler before the actual one.
handler = new BufferedResourceHandler(handler, this, request);
+ ScopedVector<ResourceThrottle> throttles;
darin (slow to review) 2012/05/22 05:23:06 not sure if it is worth it, but it would be less c
jam 2012/05/22 15:01:36 Done.
+ if (request_data.resource_type == ResourceType::MAIN_FRAME)
+ throttles.push_back(new TransferNavigationResourceThrottle(request));
+
if (delegate_) {
bool is_continuation_of_transferred_request =
(deferred_request != NULL);
- ScopedVector<ResourceThrottle> throttles;
+ ScopedVector<ResourceThrottle> embedder_throttles;
delegate_->RequestBeginning(request,
resource_context,
request_data.resource_type,
child_id,
route_id,
is_continuation_of_transferred_request,
- &throttles);
- if (!throttles.empty()) {
- handler = new ThrottlingResourceHandler(this, handler, child_id,
- request_id, throttles.Pass());
- }
+ &embedder_throttles);
+ throttles.insert(
+ throttles.end(), embedder_throttles.begin(), embedder_throttles.end());
+ embedder_throttles.weak_erase(
+ embedder_throttles.begin(), embedder_throttles.end());
}
+ if (!throttles.empty()) {
+ handler = new ThrottlingResourceHandler(this, handler, child_id, request_id,
+ throttles.Pass());
+ }
+
bool allow_download = request_data.allow_download &&
ResourceType::IsFrame(request_data.resource_type);
// Make extra info and read footer (contains request ID).

Powered by Google App Engine
This is Rietveld 408576698