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

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

Issue 9572001: Do cookie checks in NetworkDelegate instead of the URLRequest::Delegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing Created 8 years, 9 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
« no previous file with comments | « content/browser/renderer_host/resource_dispatcher_host.cc ('k') | content/common/net/url_fetcher_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/resource_request_info_impl.cc
diff --git a/content/browser/renderer_host/resource_request_info_impl.cc b/content/browser/renderer_host/resource_request_info_impl.cc
index 817815a7fecbc5d5aad81ed3ef960896257863a2..92c9240b136fbc3dbbd3c2d1af914213355da925 100644
--- a/content/browser/renderer_host/resource_request_info_impl.cc
+++ b/content/browser/renderer_host/resource_request_info_impl.cc
@@ -7,6 +7,7 @@
#include "content/browser/renderer_host/resource_handler.h"
#include "content/browser/ssl/ssl_client_auth_handler.h"
#include "content/browser/worker_host/worker_service_impl.h"
+#include "content/common/net/url_request_user_data.h"
#include "content/public/browser/resource_dispatcher_host_login_delegate.h"
#include "net/url_request/url_request.h"
#include "webkit/blob/blob_data.h"
@@ -47,6 +48,21 @@ void ResourceRequestInfo::AllocateForTesting(
info->AssociateWithRequest(request);
}
+// static
+bool ResourceRequestInfo::GetRenderViewForRequest(
+ const net::URLRequest* request,
+ int* render_process_id,
+ int* render_view_id) {
+ URLRequestUserData* user_data = static_cast<URLRequestUserData*>(
+ request->GetUserData(URLRequestUserData::kUserDataKey));
+ if (!user_data)
+ return false;
+ *render_process_id = user_data->render_process_id();
+ *render_view_id = user_data->render_view_id();
+ return true;
+}
+
+
ResourceRequestInfoImpl::ResourceRequestInfoImpl(
ResourceHandler* handler,
ProcessType process_type,
@@ -171,6 +187,13 @@ bool ResourceRequestInfoImpl::GetAssociatedRenderView(
void ResourceRequestInfoImpl::AssociateWithRequest(net::URLRequest* request) {
request->SetUserData(NULL, this);
+ int render_process_id;
+ int render_view_id;
+ if (GetAssociatedRenderView(&render_process_id, &render_view_id)) {
+ request->SetUserData(
+ URLRequestUserData::kUserDataKey,
+ new URLRequestUserData(render_process_id, render_view_id));
+ }
}
void ResourceRequestInfoImpl::set_resource_handler(
« no previous file with comments | « content/browser/renderer_host/resource_dispatcher_host.cc ('k') | content/common/net/url_fetcher_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698