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

Unified Diff: mojo/common/channel_init.h

Issue 236813002: Move Mojo channel initialization closer to IPC::Channel setup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more missing deps Created 6 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
« no previous file with comments | « content/renderer/web_ui_setup_impl.cc ('k') | mojo/common/channel_init.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/common/channel_init.h
diff --git a/mojo/common/mojo_channel_init.h b/mojo/common/channel_init.h
similarity index 52%
rename from mojo/common/mojo_channel_init.h
rename to mojo/common/channel_init.h
index 8fa00941c28021e75997f9a0b934b321b53556d7..ca134cb233dc90d470a1a22b4e763cc581fc3225 100644
--- a/mojo/common/mojo_channel_init.h
+++ b/mojo/common/channel_init.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MOJO_COMMON_MOJO_CHANNEL_INIT_H_
-#define MOJO_COMMON_MOJO_CHANNEL_INIT_H_
+#ifndef MOJO_COMMON_CHANNEL_INIT_H_
+#define MOJO_COMMON_CHANNEL_INIT_H_
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
@@ -23,27 +23,23 @@ struct ChannelInfo;
namespace common {
-// MojoChannelInit handle creation (and destruction) of the mojo channel. It is
+// ChannelInit handle creation (and destruction) of the mojo channel. It is
// expected that this class is created and destroyed on the main thread.
-class MOJO_COMMON_EXPORT MojoChannelInit {
+class MOJO_COMMON_EXPORT ChannelInit {
public:
- MojoChannelInit();
- ~MojoChannelInit();
+ ChannelInit();
+ ~ChannelInit();
- // Inits the channel. This takes ownership of |file|.
- void Init(base::PlatformFile file,
- scoped_refptr<base::TaskRunner> io_thread_task_runner);
-
- bool is_handle_valid() const { return bootstrap_message_pipe_.is_valid(); }
-
- mojo::ScopedMessagePipeHandle bootstrap_message_pipe() {
- return bootstrap_message_pipe_.Pass();
- }
+ // Initializes the channel. This takes ownership of |file|. Returns the
+ // primordial MessagePipe for the channel.
+ mojo::ScopedMessagePipeHandle Init(
+ base::PlatformFile file,
+ scoped_refptr<base::TaskRunner> io_thread_task_runner);
private:
// Invoked on the main thread once the channel has been established.
static void OnCreatedChannel(
- base::WeakPtr<MojoChannelInit> host,
+ base::WeakPtr<ChannelInit> host,
scoped_refptr<base::TaskRunner> io_thread,
embedder::ChannelInfo* channel);
@@ -52,15 +48,12 @@ class MOJO_COMMON_EXPORT MojoChannelInit {
// If non-null the channel has been established.
embedder::ChannelInfo* channel_info_;
- // The handle from channel creation.
- mojo::ScopedMessagePipeHandle bootstrap_message_pipe_;
-
- base::WeakPtrFactory<MojoChannelInit> weak_factory_;
+ base::WeakPtrFactory<ChannelInit> weak_factory_;
- DISALLOW_COPY_AND_ASSIGN(MojoChannelInit);
+ DISALLOW_COPY_AND_ASSIGN(ChannelInit);
};
} // namespace common
} // namespace mojo
-#endif // MOJO_COMMON_MOJO_CHANNEL_INIT_H_
+#endif // MOJO_COMMON_CHANNEL_INIT_H_
« no previous file with comments | « content/renderer/web_ui_setup_impl.cc ('k') | mojo/common/channel_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698