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

Unified Diff: content/child/mojo/mojo_application.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/child/child_thread_impl.cc ('k') | content/child/mojo/mojo_application.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/mojo/mojo_application.h
diff --git a/content/child/mojo/mojo_application.h b/content/child/mojo/mojo_application.h
index 68602c4fd36d892d966b4dc1a09031fdf6fbce58..34812120ba228069064fca6c2f417a9f7ea3241a 100644
--- a/content/child/mojo/mojo_application.h
+++ b/content/child/mojo/mojo_application.h
@@ -8,26 +8,44 @@
#include <string>
#include "base/macros.h"
+#include "content/common/mojo/channel_init.h"
#include "content/common/mojo/service_registry_impl.h"
+#include "ipc/ipc_platform_file.h"
+#include "mojo/public/cpp/system/message_pipe.h"
+
+namespace base {
+class SequencedTaskRunner;
+}
+
+namespace IPC {
+class Message;
+}
namespace content {
// MojoApplication represents the code needed to setup a child process as a
-// Mojo application. Instantiate MojoApplication and call InitWithToken() with
-// a token passed from the process host. It makes the ServiceRegistry interface
-// available.
+// Mojo application via Chrome IPC. Instantiate MojoApplication and call its
+// OnMessageReceived method to give it a shot at handling Chrome IPC messages.
+// It makes the ServiceRegistry interface available.
class MojoApplication {
public:
- MojoApplication();
+ explicit MojoApplication(
+ scoped_refptr<base::SequencedTaskRunner> io_task_runner);
virtual ~MojoApplication();
- // Initializes this MojoApplicaiton with a message pipe obtained using
- // |token|.
- void InitWithToken(const std::string& token);
+ // TODO(amistry): Remove OnMessageReceived() when all bootstrapping has
+ // migrated to these functions.
+ void InitWithToken(std::string token);
+
+ bool OnMessageReceived(const IPC::Message& msg);
ServiceRegistry* service_registry() { return &service_registry_; }
private:
+ void OnActivate(const IPC::PlatformFileForTransit& file);
+
+ scoped_refptr<base::SequencedTaskRunner> io_task_runner_;
+ ChannelInit channel_init_;
ServiceRegistryImpl service_registry_;
DISALLOW_COPY_AND_ASSIGN(MojoApplication);
« no previous file with comments | « content/child/child_thread_impl.cc ('k') | content/child/mojo/mojo_application.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698