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

Side by Side Diff: content/common/mojo/mojo_shell_connection_impl.h

Issue 1461243002: [OLD ATTEMPT, DO NOT REVIEW] mustash: Enable connections to mus from the Chrome renderer Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Invert connection creation flow. Needs lots of work. Created 5 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_COMMON_MOJO_SHELL_CONNECTION_IMPL_H_ 5 #ifndef CONTENT_COMMON_MOJO_SHELL_CONNECTION_IMPL_H_
6 #define CONTENT_COMMON_MOJO_SHELL_CONNECTION_IMPL_H_ 6 #define CONTENT_COMMON_MOJO_SHELL_CONNECTION_IMPL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 19 matching lines...) Expand all
30 // Creates an instance of this class and stuffs it in TLS on the calling 30 // Creates an instance of this class and stuffs it in TLS on the calling
31 // thread. Retrieve it using MojoShellConnection::Get(). Blocks the calling 31 // thread. Retrieve it using MojoShellConnection::Get(). Blocks the calling
32 // thread until calling GetApplication() will return an Initialized() 32 // thread until calling GetApplication() will return an Initialized()
33 // application with a bound ShellPtr. 33 // application with a bound ShellPtr.
34 static void Create(); 34 static void Create();
35 // Same as Create(), but receives a handle instead of looking for one on the 35 // Same as Create(), but receives a handle instead of looking for one on the
36 // command line. 36 // command line.
37 static void CreateWithMessagePipe(mojo::ScopedMessagePipeHandle handle); 37 static void CreateWithMessagePipe(mojo::ScopedMessagePipeHandle handle);
38 38
39 private: 39 private:
40 friend class MojoShellConnection;
41
40 MojoShellConnectionImpl(); 42 MojoShellConnectionImpl();
41 ~MojoShellConnectionImpl() override; 43 ~MojoShellConnectionImpl() override;
42 44
43 // mojo::ApplicationDelegate: 45 // mojo::ApplicationDelegate:
44 void Initialize(mojo::ApplicationImpl* application) override; 46 void Initialize(mojo::ApplicationImpl* application) override;
45 bool ConfigureIncomingConnection( 47 bool ConfigureIncomingConnection(
46 mojo::ApplicationConnection* connection) override; 48 mojo::ApplicationConnection* connection) override;
47 49
48 // MojoShellConnection: 50 // MojoShellConnection:
49 mojo::ApplicationImpl* GetApplication() override; 51 mojo::ApplicationImpl* GetApplication() override;
50 void AddListener(Listener* listener) override; 52 void AddListener(Listener* listener) override;
51 void RemoveListener(Listener* listener) override; 53 void RemoveListener(Listener* listener) override;
52 54
55 void OnDestroy();
56
53 // Blocks the calling thread until a connection to the spawning shell is 57 // Blocks the calling thread until a connection to the spawning shell is
54 // established, an Application request from it is bound, and the Initialize() 58 // established, an Application request from it is bound, and the Initialize()
55 // method on that application is called. 59 // method on that application is called.
56 void WaitForShell(mojo::ScopedMessagePipeHandle handle); 60 void WaitForShell(mojo::ScopedMessagePipeHandle handle);
57 61
58 bool initialized_; 62 bool initialized_;
59 scoped_ptr<mojo::runner::RunnerConnection> runner_connection_; 63 scoped_ptr<mojo::runner::RunnerConnection> runner_connection_;
60 scoped_ptr<mojo::ApplicationImpl> application_impl_; 64 scoped_ptr<mojo::ApplicationImpl> application_impl_;
61 std::vector<Listener*> listeners_; 65 std::vector<Listener*> listeners_;
62 66
63 DISALLOW_COPY_AND_ASSIGN(MojoShellConnectionImpl); 67 DISALLOW_COPY_AND_ASSIGN(MojoShellConnectionImpl);
64 }; 68 };
65 69
66 } // namespace content 70 } // namespace content
67 71
68 #endif // CONTENT_COMMON_MOJO_SHELL_CONNECTION_IMPL_H_ 72 #endif // CONTENT_COMMON_MOJO_SHELL_CONNECTION_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698