summaryrefslogtreecommitdiffstats
path: root/chrome/service/service_utility_process_host.h
diff options
context:
space:
mode:
authorrvargas <rvargas@chromium.org>2014-11-18 12:44:11 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-18 20:44:38 +0000
commit5779b38e9f3fae82dbbed7219d96cdd19eef1813 (patch)
tree7153ea0bfb3b359f86fd9964975cfe492cd6c0a8 /chrome/service/service_utility_process_host.h
parent10be0065bb90a24353dbc53d9af7fdf04121645a (diff)
downloadchromium_src-5779b38e9f3fae82dbbed7219d96cdd19eef1813.zip
chromium_src-5779b38e9f3fae82dbbed7219d96cdd19eef1813.tar.gz
chromium_src-5779b38e9f3fae82dbbed7219d96cdd19eef1813.tar.bz2
Don't pass ProcessHandle through ChildProcessHostDelegate.
ChildProcessHostDelegate doesn't make clear what ownership rules apply to the process handle and as a result one of the implementations assume that the caller has to delete the handle (ServiceUtilityProcessHost) while the other one assumes that it does not (BrowserChildProcessHostImpl). On the other hand, one caller closes the handle (ChildProcessHostImpl) and the other does not (PpapiPluginProcessHost). This CL enforces the API of not transfering ownership when getting the process handle (as both implementations keep using the handle after they receive the call). BUG=417532 Review URL: https://codereview.chromium.org/725353003 Cr-Commit-Position: refs/heads/master@{#304664}
Diffstat (limited to 'chrome/service/service_utility_process_host.h')
-rw-r--r--chrome/service/service_utility_process_host.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/service/service_utility_process_host.h b/chrome/service/service_utility_process_host.h
index 6b320aa..db9d884 100644
--- a/chrome/service/service_utility_process_host.h
+++ b/chrome/service/service_utility_process_host.h
@@ -115,7 +115,7 @@ class ServiceUtilityProcessHost : public content::ChildProcessHostDelegate {
// ChildProcessHostDelegate implementation:
virtual void OnChildDisconnected() override;
virtual bool OnMessageReceived(const IPC::Message& message) override;
- virtual base::ProcessHandle GetHandle() const override;
+ virtual const base::Process& GetProcess() const override;
private:
// Starts a process. Returns true iff it succeeded.
@@ -124,7 +124,7 @@ class ServiceUtilityProcessHost : public content::ChildProcessHostDelegate {
// Launch the child process synchronously.
bool Launch(base::CommandLine* cmd_line, bool no_sandbox);
- base::ProcessHandle handle() const { return handle_; }
+ base::ProcessHandle handle() const { return process_.Handle(); }
void OnMetafileSpooled(bool success);
void OnPDFToEmfFinished(bool success);
@@ -143,7 +143,7 @@ class ServiceUtilityProcessHost : public content::ChildProcessHostDelegate {
const std::string& printer_name);
scoped_ptr<content::ChildProcessHost> child_process_host_;
- base::ProcessHandle handle_;
+ base::Process process_;
// A pointer to our client interface, who will be informed of progress.
scoped_refptr<Client> client_;
scoped_refptr<base::MessageLoopProxy> client_message_loop_proxy_;