Index: content/browser/webui/url_data_manager_backend.cc |
diff --git a/content/browser/webui/url_data_manager_backend.cc b/content/browser/webui/url_data_manager_backend.cc |
index 102f61c92787cdc68a3004e242092f82c82fd607..30f633e2a55075718035ad456a1a7e68e7a23e9e 100644 |
--- a/content/browser/webui/url_data_manager_backend.cc |
+++ b/content/browser/webui/url_data_manager_backend.cc |
@@ -28,6 +28,7 @@ |
#include "content/browser/webui/url_data_source_impl.h" |
#include "content/public/browser/browser_thread.h" |
#include "content/public/browser/content_browser_client.h" |
+#include "content/public/browser/resource_request_info.h" |
#include "content/public/common/url_constants.h" |
#include "googleurl/src/url_util.h" |
#include "net/base/io_buffer.h" |
@@ -506,11 +507,17 @@ bool URLDataManagerBackend::StartRequest(const net::URLRequest* request, |
job->set_deny_xframe_options( |
source->source()->ShouldDenyXFrameOptions()); |
+ // Look up additional request info to pass down. |
+ int render_process_id = -1; |
+ int render_view_id = -1; |
+ const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); |
+ if (info) |
jam
2013/04/17 00:45:09
when could this be null?
I'm not sure this can ac
Jered
2013/04/17 01:03:08
How about this way? I think it's clearer anyway.
|
+ info->GetAssociatedRenderView(&render_process_id, &render_view_id); |
+ |
// Forward along the request to the data source. |
MessageLoop* target_message_loop = |
source->source()->MessageLoopForRequestPath(path); |
if (!target_message_loop) { |
- bool is_incognito = job->is_incognito(); |
job->MimeTypeAvailable(source->source()->GetMimeType(path)); |
// Eliminate potentially dangling pointer to avoid future use. |
job = NULL; |
@@ -519,7 +526,7 @@ bool URLDataManagerBackend::StartRequest(const net::URLRequest* request, |
// on for this path. Call directly into it from this thread, the IO |
// thread. |
source->source()->StartDataRequest( |
- path, is_incognito, |
+ path, render_process_id, render_view_id, |
base::Bind(&URLDataSourceImpl::SendResponse, source, request_id)); |
} else { |
// URLRequestChromeJob should receive mime type before data. This |
@@ -537,8 +544,8 @@ bool URLDataManagerBackend::StartRequest(const net::URLRequest* request, |
target_message_loop->PostTask( |
FROM_HERE, |
base::Bind(&URLDataManagerBackend::CallStartRequest, |
- make_scoped_refptr(source), path, job->is_incognito(), |
- request_id)); |
+ make_scoped_refptr(source), path, render_process_id, |
+ render_view_id, request_id)); |
} |
return true; |
} |
@@ -546,11 +553,13 @@ bool URLDataManagerBackend::StartRequest(const net::URLRequest* request, |
void URLDataManagerBackend::CallStartRequest( |
scoped_refptr<URLDataSourceImpl> source, |
const std::string& path, |
- bool is_incognito, |
+ int render_process_id, |
+ int render_view_id, |
int request_id) { |
source->source()->StartDataRequest( |
path, |
- is_incognito, |
+ render_process_id, |
+ render_view_id, |
base::Bind(&URLDataSourceImpl::SendResponse, source, request_id)); |
} |