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

Unified Diff: third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr_info.h

Issue 975973002: Update mojo sdk to rev f68e697e389943cd9bf9652397312280e96b127a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: shake fist at msvc Created 5 years, 10 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: third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr_info.h
diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr_info.h b/third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr_info.h
new file mode 100644
index 0000000000000000000000000000000000000000..4f61915fb2a2528c77a723f81d01f0ba47384cac
--- /dev/null
+++ b/third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr_info.h
@@ -0,0 +1,58 @@
+// Copyright 2015 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_INTERFACE_PTR_INFO_H_
+#define MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_PTR_INFO_H_
+
+#include "mojo/public/cpp/system/macros.h"
+#include "mojo/public/cpp/system/message_pipe.h"
+
+namespace mojo {
+
+// InterfacePtrInfo stores necessary information to communicate with a remote
+// interface implementation, which could be used to construct an InterfacePtr.
+template <typename Interface>
+class InterfacePtrInfo {
+ MOJO_MOVE_ONLY_TYPE(InterfacePtrInfo);
+
+ public:
+ InterfacePtrInfo() : version_(0u) {}
+
+ InterfacePtrInfo(ScopedMessagePipeHandle handle, uint32_t version)
+ : handle_(handle.Pass()), version_(version) {}
+
+ InterfacePtrInfo(InterfacePtrInfo&& other)
+ : handle_(other.handle_.Pass()), version_(other.version_) {
+ other.version_ = 0u;
+ }
+
+ ~InterfacePtrInfo() {}
+
+ InterfacePtrInfo& operator=(InterfacePtrInfo&& other) {
+ if (this != &other) {
+ handle_ = other.handle_.Pass();
+ version_ = other.version_;
+ other.version_ = 0u;
+ }
+
+ return *this;
+ }
+
+ bool is_valid() const { return handle_.is_valid(); }
+
+ ScopedMessagePipeHandle PassHandle() { return handle_.Pass(); }
+ const ScopedMessagePipeHandle& handle() const { return handle_; }
+ void set_handle(ScopedMessagePipeHandle handle) { handle_ = handle.Pass(); }
+
+ uint32_t version() const { return version_; }
+ void set_version(uint32_t version) { version_ = version; }
+
+ private:
+ ScopedMessagePipeHandle handle_;
+ uint32_t version_;
+};
+
+} // namespace mojo
+
+#endif // MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_PTR_INFO_H_
« no previous file with comments | « third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h ('k') | third_party/mojo/src/mojo/public/cpp/bindings/lib/TODO » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698