| 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..374570ea4b9f3837d8a4fbe8c2d1ed721682fe03 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"
|
| @@ -87,6 +88,21 @@ void URLToRequest(const GURL& url, std::string* source_name,
|
| path->assign(spec.substr(offset));
|
| }
|
|
|
| +// Fills extra request fields struct from |request|.
|
| +void FillExtraRequestInfo(
|
| + bool is_incognito,
|
| + const net::URLRequest* request,
|
| + URLDataSource::ExtraRequestInfo* request_info) {
|
| + request_info->is_incognito = is_incognito;
|
| + request_info->render_process_id = -1;
|
| + request_info->render_view_id = -1;
|
| + const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request);
|
| + if (info) {
|
| + info->GetAssociatedRenderView(&request_info->render_process_id,
|
| + &request_info->render_view_id);
|
| + }
|
| +}
|
| +
|
| } // namespace
|
|
|
| // URLRequestChromeJob is a net::URLRequestJob that manages running
|
| @@ -506,11 +522,14 @@ bool URLDataManagerBackend::StartRequest(const net::URLRequest* request,
|
| job->set_deny_xframe_options(
|
| source->source()->ShouldDenyXFrameOptions());
|
|
|
| + // Add extra info for the request.
|
| + URLDataSource::ExtraRequestInfo request_info;
|
| + FillExtraRequestInfo(job->is_incognito(), request, &request_info);
|
| +
|
| // 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 +538,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, request_info,
|
| base::Bind(&URLDataSourceImpl::SendResponse, source, request_id));
|
| } else {
|
| // URLRequestChromeJob should receive mime type before data. This
|
| @@ -537,7 +556,7 @@ 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(),
|
| + make_scoped_refptr(source), path, request_info,
|
| request_id));
|
| }
|
| return true;
|
| @@ -546,11 +565,11 @@ bool URLDataManagerBackend::StartRequest(const net::URLRequest* request,
|
| void URLDataManagerBackend::CallStartRequest(
|
| scoped_refptr<URLDataSourceImpl> source,
|
| const std::string& path,
|
| - bool is_incognito,
|
| + const URLDataSource::ExtraRequestInfo& info,
|
| int request_id) {
|
| source->source()->StartDataRequest(
|
| path,
|
| - is_incognito,
|
| + info,
|
| base::Bind(&URLDataSourceImpl::SendResponse, source, request_id));
|
| }
|
|
|
|
|