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

Unified Diff: ipc/mojo/ipc_channel_mojo.h

Issue 599333002: ChannelMojo: Handle when ChannelMojo outlives ChannelMojoHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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: ipc/mojo/ipc_channel_mojo.h
diff --git a/ipc/mojo/ipc_channel_mojo.h b/ipc/mojo/ipc_channel_mojo.h
index 9964a8f80b74f5a82ff156d5e58c9d110208ef55..7aff3c99cca4a8386aa78bcc39e23845b193611d 100644
--- a/ipc/mojo/ipc_channel_mojo.h
+++ b/ipc/mojo/ipc_channel_mojo.h
@@ -62,7 +62,7 @@ class IPC_MOJO_EXPORT ChannelMojo : public Channel,
public MojoBootstrap::Delegate {
public:
// Create ChannelMojo. A bootstrap channel is created as well.
- // |host| must not be null.
+ // |host| must not be null for server channels.
static scoped_ptr<ChannelMojo> Create(ChannelMojoHost* host,
const ChannelHandle& channel_handle,
Mode mode,
@@ -117,6 +117,8 @@ class IPC_MOJO_EXPORT ChannelMojo : public Channel,
void OnPipeError(internal::MessagePipeReader* reader);
void set_peer_pid(base::ProcessId pid) { peer_pid_ = pid; }
+ void HostWasDestroyed();
viettrungluu 2014/09/25 19:38:34 I don't think this is used (or implemented).
Hajime Morrita 2014/09/25 22:00:03 Oops. Removed.
+
protected:
ChannelMojo(ChannelMojoHost* host,
const ChannelHandle& channel_handle,
@@ -136,7 +138,7 @@ class IPC_MOJO_EXPORT ChannelMojo : public Channel,
void InitControlReader(mojo::embedder::ScopedPlatformHandle handle);
scoped_ptr<MojoBootstrap> bootstrap_;
- ChannelMojoHost* const host_;
+ base::WeakPtr<ChannelMojoHost> host_;
Mode mode_;
Listener* listener_;
base::ProcessId peer_pid_;

Powered by Google App Engine
This is Rietveld 408576698