Index: third_party/mojo/src/mojo/edk/system/connection_manager.h |
diff --git a/third_party/mojo/src/mojo/edk/system/connection_manager.h b/third_party/mojo/src/mojo/edk/system/connection_manager.h |
index 5923c75322f2cde4e796b3e33eb73947159c83b3..c92a121aab7560c776cf069a28c2d6a2ab8672a6 100644 |
--- a/third_party/mojo/src/mojo/edk/system/connection_manager.h |
+++ b/third_party/mojo/src/mojo/edk/system/connection_manager.h |
@@ -5,12 +5,9 @@ |
#ifndef MOJO_EDK_SYSTEM_CONNECTION_MANAGER_H_ |
#define MOJO_EDK_SYSTEM_CONNECTION_MANAGER_H_ |
-#include <ostream> |
- |
#include "mojo/edk/system/connection_identifier.h" |
#include "mojo/edk/system/process_identifier.h" |
#include "mojo/edk/system/system_impl_export.h" |
-#include "mojo/edk/system/thread_annotations.h" |
#include "mojo/public/cpp/system/macros.h" |
namespace mojo { |
@@ -62,23 +59,13 @@ |
// slave). |
class MOJO_SYSTEM_IMPL_EXPORT ConnectionManager { |
public: |
- enum class Result { |
- FAILURE = 0, |
- SUCCESS, |
- // These results are used for |Connect()| (which also uses |FAILURE|, but |
- // not |SUCCESS|). |
- SUCCESS_CONNECT_SAME_PROCESS, |
- SUCCESS_CONNECT_NEW_CONNECTION, |
- SUCCESS_CONNECT_REUSE_CONNECTION |
- }; |
- |
virtual ~ConnectionManager() {} |
ConnectionIdentifier GenerateConnectionIdentifier(); |
// Shuts down this connection manager. No other methods may be called after |
// this is (or while it is being) called. |
- virtual void Shutdown() MOJO_NOT_THREAD_SAFE = 0; |
+ virtual void Shutdown() = 0; |
// TODO(vtl): Add a "get my own process identifier" method? |
@@ -98,14 +85,14 @@ |
virtual bool CancelConnect(const ConnectionIdentifier& connection_id) = 0; |
// Connects a pending connection; to be called only after both parties have |
- // called |AllowConnect()|. On success, |Result::SUCCESS_CONNECT_...| is |
- // returned and |peer_process_identifier| is set to an unique identifier for |
- // the peer process. In the case of |SUCCESS_CONNECT_SAME_PROCESS|, |
- // |*platform_handle| is set to a suitable native handle connecting the two |
- // parties. |
- virtual Result Connect(const ConnectionIdentifier& connection_id, |
- ProcessIdentifier* peer_process_identifier, |
- embedder::ScopedPlatformHandle* platform_handle) = 0; |
+ // called |AllowConnect()|. On success, |peer_process_identifier| is set to an |
+ // unique identifier for the peer process, and if the peer process is not the |
+ // same as the calling process then |*platform_handle| is set to a suitable |
+ // native handle connecting the two parties (if the two parties are the same |
+ // process, then |*platform_handle| is reset to be invalid). |
+ virtual bool Connect(const ConnectionIdentifier& connection_id, |
+ ProcessIdentifier* peer_process_identifier, |
+ embedder::ScopedPlatformHandle* platform_handle) = 0; |
protected: |
// |platform_support| must be valid and remain alive until after |Shutdown()| |
@@ -119,13 +106,6 @@ |
MOJO_DISALLOW_COPY_AND_ASSIGN(ConnectionManager); |
}; |
-// So logging macros and |DCHECK_EQ()|, etc. work. |
-MOJO_SYSTEM_IMPL_EXPORT inline std::ostream& operator<<( |
- std::ostream& out, |
- ConnectionManager::Result result) { |
- return out << static_cast<int>(result); |
-} |
- |
} // namespace system |
} // namespace mojo |