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

Unified Diff: content/common/mojo/channel_init.h

Issue 1892613003: Revert of Use a token to initialise ChannelMojo and MojoApplication everywhere. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/common/in_process_child_thread_params.cc ('k') | content/common/mojo/channel_init.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/mojo/channel_init.h
diff --git a/content/common/mojo/channel_init.h b/content/common/mojo/channel_init.h
new file mode 100644
index 0000000000000000000000000000000000000000..6b9daae2dd0535fb95ae7b0ae81973733d5a7cc1
--- /dev/null
+++ b/content/common/mojo/channel_init.h
@@ -0,0 +1,41 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_MOJO_CHANNEL_INIT_H_
+#define CONTENT_COMMON_MOJO_CHANNEL_INIT_H_
+
+#include "base/files/file.h"
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "content/common/content_export.h"
+#include "mojo/public/cpp/system/message_pipe.h"
+
+namespace base {
+class TaskRunner;
+}
+
+namespace content {
+
+// ChannelInit handles creation and destruction of the Mojo channel. It is not
+// thread-safe, but may be used on any single thread with a MessageLoop.
+//
+// TODO(rockot): Get rid of this class ASAP (i.e. once the patch which includes
+// this TODO has stuck for a bit) since it's no longer necessary.
+class CONTENT_EXPORT ChannelInit {
+ public:
+ ChannelInit();
+ ~ChannelInit();
+
+ // Initializes the channel. This takes ownership of |file|.
+ mojo::ScopedMessagePipeHandle Init(
+ base::PlatformFile file,
+ scoped_refptr<base::TaskRunner> io_thread_task_runner);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ChannelInit);
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_MOJO_CHANNEL_INIT_H_
« no previous file with comments | « content/common/in_process_child_thread_params.cc ('k') | content/common/mojo/channel_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698