diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-31 17:27:45 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-31 17:27:45 +0000 |
commit | 76543b9c43515c8c68413b25d682b7c15a151905 (patch) | |
tree | 3fa26b07a2de8102561d5ded5828797fa9a375ab /chrome/browser/plugin_process_host.cc | |
parent | f341f8f58ceeae4efe38daf3c26ad4581f98fd2d (diff) | |
download | chromium_src-76543b9c43515c8c68413b25d682b7c15a151905.zip chromium_src-76543b9c43515c8c68413b25d682b7c15a151905.tar.gz chromium_src-76543b9c43515c8c68413b25d682b7c15a151905.tar.bz2 |
Replace the RenderProcessHost.PID function that returns the OS-generated
process ID with an internally-generated id() function. This allows us the
guarantee that the IDs are unique over the entire run of the application.
This also cleans up some code associated with managing the PID.
The main potentially interesting change is now the PID is set uniquely for
every creation of RenderProcessHost. It used to be set cleared if the process
went away, and re-set if the process was re-created. The ID generation is in
ChildProcesInfo so it is also unique between workers and plugins. I had to
change some significant things in resource_dispatcher_host_unittest to take
into account this new generation of IDs.
BUG=17828
TEST=none
Review URL: http://codereview.chromium.org/160203
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24899 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_process_host.cc')
-rw-r--r-- | chrome/browser/plugin_process_host.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc index 5987c5e..4bb2924 100644 --- a/chrome/browser/plugin_process_host.cc +++ b/chrome/browser/plugin_process_host.cc @@ -31,6 +31,7 @@ #include "chrome/browser/child_process_security_policy.h" #include "chrome/browser/chrome_plugin_browsing_context.h" #include "chrome/browser/chrome_thread.h" +#include "chrome/browser/net/url_request_tracking.h" #include "chrome/browser/plugin_service.h" #include "chrome/browser/profile.h" #include "chrome/browser/renderer_host/browser_render_process_host.h" @@ -114,19 +115,20 @@ class PluginDownloadUrlHelper : public URLRequest::Delegate { gfx::NativeWindow download_file_caller_window_; std::string download_url_; - int download_source_pid_; + int download_source_child_unique_id_; DISALLOW_EVIL_CONSTRUCTORS(PluginDownloadUrlHelper); }; PluginDownloadUrlHelper::PluginDownloadUrlHelper( const std::string& download_url, - int source_pid, gfx::NativeWindow caller_window) + int source_child_unique_id, + gfx::NativeWindow caller_window) : download_file_request_(NULL), download_file_buffer_(new net::IOBuffer(kDownloadFileBufferSize)), download_file_caller_window_(caller_window), download_url_(download_url), - download_source_pid_(source_pid) { + download_source_child_unique_id_(source_child_unique_id) { DCHECK(::IsWindow(caller_window)); memset(download_file_buffer_->data(), 0, kDownloadFileBufferSize); download_file_.reset(new net::FileStream()); @@ -140,8 +142,9 @@ PluginDownloadUrlHelper::~PluginDownloadUrlHelper() { } void PluginDownloadUrlHelper::InitiateDownload() { - download_file_request_= new URLRequest(GURL(download_url_), this); - download_file_request_->set_origin_pid(download_source_pid_); + download_file_request_ = new URLRequest(GURL(download_url_), this); + chrome_browser_net::SetOriginProcessUniqueIDForRequest( + download_source_child_unique_id_, download_file_request_); download_file_request_->set_context(Profile::GetDefaultRequestContext()); download_file_request_->Start(); } @@ -592,7 +595,7 @@ void PluginProcessHost::RequestPluginChannel( // a deadlock can occur if the plugin creation request from the renderer is // a result of a sync message by the plugin process. PluginProcessMsg_CreateChannel* msg = new PluginProcessMsg_CreateChannel( - renderer_message_filter->GetProcessId(), + renderer_message_filter->id(), renderer_message_filter->off_the_record()); msg->set_unblock(true); if (Send(msg)) { |