Chromium Code Reviews| Index: chrome/browser/renderer_host/resource_dispatcher_host.cc |
| diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc |
| index 3d9221a3d9799d6a2df56df0967a4a49c02de0bc..aa00c8d196b0da128eb69385bef6c59c180ed1c6 100644 |
| --- a/chrome/browser/renderer_host/resource_dispatcher_host.cc |
| +++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc |
| @@ -196,8 +196,8 @@ std::vector<int> GetAllNetErrorCodes() { |
| } |
| #if defined(OS_WIN) |
| -#pragma warning (disable: 4748) |
| -#pragma optimize( "", off ) |
| +#pragma warning(disable: 4748) |
| +#pragma optimize("", off) |
| #endif |
| // Temporary experiment to help track down http://crbug.com/68766. |
| @@ -209,8 +209,8 @@ void CheckContextForBug68766(net::URLRequestContext* context) { |
| } |
| #if defined(OS_WIN) |
| -#pragma optimize( "", on ) |
| -#pragma warning (default: 4748) |
| +#pragma optimize("", on) |
| +#pragma warning(default: 4748) |
| #endif |
| } // namespace |
| @@ -528,8 +528,22 @@ void ResourceDispatcherHost::BeginRequest( |
| ApplyExtensionLocalizationFilter(request_data.url, request_data.resource_type, |
| extra_info); |
| SetRequestInfo(request, extra_info); // Request takes ownership. |
| + |
| + // Determine and store the child ID of the request originator |
| + // If we can't find an originator then we fall back to the ID of the |
| + // render process through which the request was received. |
|
awong
2011/01/27 21:03:07
drive-by style nit.
Add a newline before the TODO
|
| + // TODO(wez): This lookup is too expensive - need a FromPID()... |
| + int origin_child_id = child_id; |
| + for (BrowserChildProcessHost::Iterator i; !i.Done(); ++i) { |
|
brettw
2011/01/27 21:23:51
I don't think this approach is a good idea. It's b
|
| + base::ProcessHandle process_handle = (*i)->handle(); |
| + int pid = base::GetProcId(process_handle); |
| + if (pid == request_data.origin_pid) { |
| + origin_child_id = (*i)->id(); |
| + break; |
| + } |
| + } |
| chrome_browser_net::SetOriginProcessUniqueIDForRequest( |
| - request_data.origin_child_id, request); |
| + origin_child_id, request); |
| if (request->url().SchemeIs(chrome::kBlobScheme) && context) { |
| // Hang on to a reference to ensure the blob is not released prior |