OLD | NEW |
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // Same as BindToCommandLinePlatformChannel(), but receives a |handle| instead | 50 // Same as BindToCommandLinePlatformChannel(), but receives a |handle| instead |
51 // of looking for one on the command line. | 51 // of looking for one on the command line. |
52 void BindToMessagePipe(mojo::ScopedMessagePipeHandle handle); | 52 void BindToMessagePipe(mojo::ScopedMessagePipeHandle handle); |
53 | 53 |
54 private: | 54 private: |
55 explicit MojoShellConnectionImpl(bool external); | 55 explicit MojoShellConnectionImpl(bool external); |
56 ~MojoShellConnectionImpl() override; | 56 ~MojoShellConnectionImpl() override; |
57 | 57 |
58 // mojo::ShellClient: | 58 // mojo::ShellClient: |
59 void Initialize(mojo::Connector* connector, const std::string& url, | 59 void Initialize(mojo::Connector* connector, const std::string& url, |
60 uint32_t id, uint32_t user_id) override; | 60 const std::string& user_id, uint32_t id) override; |
61 bool AcceptConnection(mojo::Connection* connection) override; | 61 bool AcceptConnection(mojo::Connection* connection) override; |
62 | 62 |
63 // MojoShellConnection: | 63 // MojoShellConnection: |
64 mojo::Connector* GetConnector() override; | 64 mojo::Connector* GetConnector() override; |
65 bool UsingExternalShell() const override; | 65 bool UsingExternalShell() const override; |
66 void AddListener(Listener* listener) override; | 66 void AddListener(Listener* listener) override; |
67 void RemoveListener(Listener* listener) override; | 67 void RemoveListener(Listener* listener) override; |
68 | 68 |
69 // Blocks the calling thread until a connection to the spawning shell is | 69 // Blocks the calling thread until a connection to the spawning shell is |
70 // established, an Application request from it is bound, and the Initialize() | 70 // established, an Application request from it is bound, and the Initialize() |
71 // method on that application is called. | 71 // method on that application is called. |
72 void WaitForShell(mojo::ScopedMessagePipeHandle handle); | 72 void WaitForShell(mojo::ScopedMessagePipeHandle handle); |
73 | 73 |
74 bool external_; | 74 bool external_; |
75 bool initialized_; | 75 bool initialized_; |
76 scoped_ptr<mojo::shell::RunnerConnection> runner_connection_; | 76 scoped_ptr<mojo::shell::RunnerConnection> runner_connection_; |
77 scoped_ptr<mojo::ShellConnection> shell_connection_; | 77 scoped_ptr<mojo::ShellConnection> shell_connection_; |
78 std::vector<Listener*> listeners_; | 78 std::vector<Listener*> listeners_; |
79 | 79 |
80 DISALLOW_COPY_AND_ASSIGN(MojoShellConnectionImpl); | 80 DISALLOW_COPY_AND_ASSIGN(MojoShellConnectionImpl); |
81 }; | 81 }; |
82 | 82 |
83 } // namespace content | 83 } // namespace content |
84 | 84 |
85 #endif // CONTENT_COMMON_MOJO_SHELL_CONNECTION_IMPL_H_ | 85 #endif // CONTENT_COMMON_MOJO_SHELL_CONNECTION_IMPL_H_ |
OLD | NEW |