Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(451)

Unified Diff: components/nacl/browser/nacl_process_host.h

Issue 1094653003: Refactor NaClProcessHost. Reduce chances to leak the resource. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/nacl/browser/nacl_process_host.h
diff --git a/components/nacl/browser/nacl_process_host.h b/components/nacl/browser/nacl_process_host.h
index 324db114e0201e94ac9686688618cc961a3c83b4..ce09d6b22ea705c1515c96828c631e92f075b882 100644
--- a/components/nacl/browser/nacl_process_host.h
+++ b/components/nacl/browser/nacl_process_host.h
@@ -112,6 +112,8 @@ class NaClProcessHost : public content::BrowserChildProcessHostDelegate {
content::BrowserPpapiHost* browser_ppapi_host() { return ppapi_host_.get(); }
private:
+ class ScopedChannelHandle;
+
void LaunchNaClGdb();
// Mark the process as using a particular GDB debug stub port and notify
@@ -142,18 +144,17 @@ class NaClProcessHost : public content::BrowserChildProcessHostDelegate {
bool enable_ppapi_proxy() { return render_view_id_ != 0; }
// Sends the reply message to the renderer who is waiting for the plugin
- // to load. Returns true on success.
- bool ReplyToRenderer(
- const IPC::ChannelHandle& ppapi_channel_handle,
- const IPC::ChannelHandle& trusted_channel_handle,
- const IPC::ChannelHandle& manifest_service_channel_handle);
+ // to load.
+ void ReplyToRenderer(ScopedChannelHandle ppapi_channel_handle,
+ ScopedChannelHandle trusted_channel_handle,
+ ScopedChannelHandle manifest_service_channel_handle);
// Sends the reply with error message to the renderer.
void SendErrorToRenderer(const std::string& error_message);
// Sends the reply message to the renderer. Either result or
// error message must be empty.
- void SendMessageToRenderer(const NaClLaunchResult& result,
+ bool SendMessageToRenderer(const NaClLaunchResult& result,
const std::string& error_message);
// Sends the message to the NaCl process to load the plugin. Returns true
« no previous file with comments | « no previous file | components/nacl/browser/nacl_process_host.cc » ('j') | components/nacl/browser/nacl_process_host.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698