diff options
author | rvargas <rvargas@chromium.org> | 2015-03-31 21:10:12 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-01 04:11:15 +0000 |
commit | f8d789c4558c7575f4d388d44730d18fdf15772c (patch) | |
tree | 54807f725d613c10d0026a98cedb89189bef1a06 /extensions/browser/extension_function_dispatcher.cc | |
parent | d65edb7b2d228497056e18100c882f7cf7d59c36 (diff) | |
download | chromium_src-f8d789c4558c7575f4d388d44730d18fdf15772c.zip chromium_src-f8d789c4558c7575f4d388d44730d18fdf15772c.tar.gz chromium_src-f8d789c4558c7575f4d388d44730d18fdf15772c.tar.bz2 |
Remove uses of KillProcess.
BUG=417532
Review URL: https://codereview.chromium.org/1035323002
Cr-Commit-Position: refs/heads/master@{#323179}
Diffstat (limited to 'extensions/browser/extension_function_dispatcher.cc')
-rw-r--r-- | extensions/browser/extension_function_dispatcher.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/extensions/browser/extension_function_dispatcher.cc b/extensions/browser/extension_function_dispatcher.cc index fcf4ab4..1fa43ec 100644 --- a/extensions/browser/extension_function_dispatcher.cc +++ b/extensions/browser/extension_function_dispatcher.cc @@ -84,19 +84,19 @@ base::LazyInstance<Static> g_global_io_data = LAZY_INSTANCE_INITIALIZER; // Kills the specified process because it sends us a malformed message. // Track the specific function's |histogram_value|, as this may indicate a bug // in that API's implementation on the renderer. -void KillBadMessageSender(base::ProcessHandle process, +void KillBadMessageSender(const base::Process& process, functions::HistogramValue histogram_value) { NOTREACHED(); content::RecordAction(base::UserMetricsAction("BadMessageTerminate_EFD")); UMA_HISTOGRAM_ENUMERATION("Extensions.BadMessageFunctionName", histogram_value, functions::ENUM_BOUNDARY); - if (process) - base::KillProcess(process, content::RESULT_CODE_KILLED_BAD_MESSAGE, false); + if (process.IsValid()) + process.Terminate(content::RESULT_CODE_KILLED_BAD_MESSAGE, false); } void CommonResponseCallback(IPC::Sender* ipc_sender, int routing_id, - base::ProcessHandle peer_process, + const base::Process& peer_process, int request_id, ExtensionFunction::ResponseType type, const base::ListValue& results, @@ -136,8 +136,10 @@ void IOThreadResponseCallback( if (!ipc_sender.get()) return; - CommonResponseCallback(ipc_sender.get(), routing_id, ipc_sender->PeerHandle(), - request_id, type, results, error, histogram_value); + base::Process peer_process = + base::Process::DeprecatedGetProcessFromHandle(ipc_sender->PeerHandle()); + CommonResponseCallback(ipc_sender.get(), routing_id, peer_process, request_id, + type, results, error, histogram_value); } } // namespace @@ -184,9 +186,11 @@ class ExtensionFunctionDispatcher::UIThreadResponseCallbackWrapper const base::ListValue& results, const std::string& error, functions::HistogramValue histogram_value) { + base::Process process = base::Process::DeprecatedGetProcessFromHandle( + render_view_host_->GetProcess()->GetHandle()); CommonResponseCallback(render_view_host_, render_view_host_->GetRoutingID(), - render_view_host_->GetProcess()->GetHandle(), - request_id, type, results, error, histogram_value); + process, request_id, type, results, error, + histogram_value); } base::WeakPtr<ExtensionFunctionDispatcher> dispatcher_; |