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

Unified Diff: mojo/public/bindings/interface.h

Issue 218613010: Mojo: Move mojo/public/bindings/*.h to mojo/public/cpp/bindings/*.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
« no previous file with comments | « mojo/public/bindings/generators/cpp_templates/module.h.tmpl ('k') | mojo/public/bindings/lib/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/interface.h
diff --git a/mojo/public/bindings/interface.h b/mojo/public/bindings/interface.h
deleted file mode 100644
index ff3f2970aa3e463af63567b61b6228cb68b9ba64..0000000000000000000000000000000000000000
--- a/mojo/public/bindings/interface.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright 2014 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_BINDINGS_INTERFACE_H_
-#define MOJO_PUBLIC_BINDINGS_INTERFACE_H_
-
-#include <assert.h>
-
-#include "mojo/public/bindings/message.h"
-#include "mojo/public/cpp/system/core.h"
-
-namespace mojo {
-
-
-// NoInterface is for use in cases when a non-existent or empty interface is
-// needed (e.g., when the Mojom "Peer" attribute is not present).
-
-class NoInterface;
-
-class NoInterfaceStub : public MessageReceiver {
- public:
- NoInterfaceStub(NoInterface* unused) {}
- virtual bool Accept(Message* message) MOJO_OVERRIDE;
- virtual bool AcceptWithResponder(Message* message, MessageReceiver* responder)
- MOJO_OVERRIDE;
-};
-
-class NoInterface {
- public:
- typedef NoInterfaceStub _Stub;
- typedef NoInterface _Peer;
-};
-
-
-// AnyInterface is for use in cases where any interface would do (e.g., see the
-// Shell::Connect method).
-
-typedef NoInterface AnyInterface;
-
-
-// InterfaceHandle<S>
-
-template <typename S>
-class InterfaceHandle : public MessagePipeHandle {
- public:
- InterfaceHandle() {}
- explicit InterfaceHandle(MojoHandle value) : MessagePipeHandle(value) {}
-};
-
-
-// Interface<S>
-
-template <typename S>
-struct Interface {
- typedef InterfaceHandle<S> Handle;
- typedef ScopedHandleBase<InterfaceHandle<S> > ScopedHandle;
-};
-
-template <>
-struct Interface<mojo::NoInterface> {
- typedef MessagePipeHandle Handle;
- typedef ScopedMessagePipeHandle ScopedHandle;
-};
-
-
-// InterfacePipe<S,P> is used to construct a MessagePipe with typed interfaces
-// on either end.
-
-template <typename S, typename P = typename S::_Peer>
-class InterfacePipe {
- public:
- InterfacePipe() {
- typename Interface<S>::Handle h0;
- typename Interface<P>::Handle h1;
- MojoResult result MOJO_ALLOW_UNUSED =
- MojoCreateMessagePipe(h0.mutable_value(), h1.mutable_value());
- assert(result == MOJO_RESULT_OK);
- handle_to_self.reset(h0);
- handle_to_peer.reset(h1);
- }
-
- typename Interface<S>::ScopedHandle handle_to_self;
- typename Interface<P>::ScopedHandle handle_to_peer;
-};
-
-// TODO(darin): Once we have the ability to use C++11 features, consider
-// defining a template alias for ScopedInterfaceHandle<S>.
-
-} // namespace mojo
-
-#endif // MOJO_PUBLIC_BINDINGS_SCOPED_INTERFACE_H_
« no previous file with comments | « mojo/public/bindings/generators/cpp_templates/module.h.tmpl ('k') | mojo/public/bindings/lib/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698