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

Unified Diff: mojo/public/cpp/bindings/lib/synchronous_connector.h

Issue 2250183003: Make the fuchsia mojo/public repo the source of truth. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 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
Index: mojo/public/cpp/bindings/lib/synchronous_connector.h
diff --git a/mojo/public/cpp/bindings/lib/synchronous_connector.h b/mojo/public/cpp/bindings/lib/synchronous_connector.h
deleted file mode 100644
index c3828c18bcf2b9670b4b89f0045d5bfc87262880..0000000000000000000000000000000000000000
--- a/mojo/public/cpp/bindings/lib/synchronous_connector.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2016 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 MOJO_PUBLIC_CPP_BINDINGS_LIB_SYNCHRONOUS_CONNECTOR_H_
-#define MOJO_PUBLIC_CPP_BINDINGS_LIB_SYNCHRONOUS_CONNECTOR_H_
-
-#include "mojo/public/cpp/bindings/message.h"
-#include "mojo/public/cpp/system/macros.h"
-#include "mojo/public/cpp/system/message_pipe.h"
-
-namespace mojo {
-namespace internal {
-
-// This class is responsible for performing synchronous read/write operations on
-// a MessagePipe. Notably, this interface allows us to make synchronous
-// request/response operations on messages: write a message (that expects a
-// response message), wait on the message pipe, and read the response.
-class SynchronousConnector {
- public:
- explicit SynchronousConnector(ScopedMessagePipeHandle handle);
- ~SynchronousConnector();
-
- // This will mutate the message by moving the handles out of it. |msg_to_send|
- // must be non-null. Returns true on a successful write.
- bool Write(Message* msg_to_send);
-
- // This method blocks indefinitely until a message is received. |received_msg|
- // must be non-null and be empty. Returns true on a successful read.
- // TODO(vardhan): Add a timeout mechanism.
- bool BlockingRead(Message* received_msg);
-
- ScopedMessagePipeHandle PassHandle() { return std::move(handle_); }
-
- // Returns true if the underlying MessagePipe is valid.
- bool is_valid() const { return handle_.is_valid(); }
-
- private:
- ScopedMessagePipeHandle handle_;
-
- MOJO_DISALLOW_COPY_AND_ASSIGN(SynchronousConnector);
-};
-
-} // namespace internal
-} // namespace mojo
-
-#endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_SYNCHRONOUS_CONNECTOR_H_
« no previous file with comments | « mojo/public/cpp/bindings/lib/string_serialization.cc ('k') | mojo/public/cpp/bindings/lib/synchronous_connector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698