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

Side by Side Diff: mojo/public/cpp/bindings/interface_request.h

Issue 858103002: Remove [Client=] annotation from ServiceProvider (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase for trybots (no code changes from ps2) Created 5 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_
7 7
8 #include "mojo/public/cpp/bindings/interface_ptr.h" 8 #include "mojo/public/cpp/bindings/interface_ptr.h"
9 9
10 namespace mojo { 10 namespace mojo {
11 11
12 // Used in methods that return instances of remote objects. 12 // Used in methods that return instances of remote objects.
13 template <typename Interface> 13 template <typename Interface>
14 class InterfaceRequest { 14 class InterfaceRequest {
15 MOJO_MOVE_ONLY_TYPE(InterfaceRequest) 15 MOJO_MOVE_ONLY_TYPE(InterfaceRequest)
16 public: 16 public:
17 InterfaceRequest() {} 17 InterfaceRequest() {}
18 18
19 InterfaceRequest(decltype(nullptr)) {}
19 InterfaceRequest(InterfaceRequest&& other) { handle_ = other.handle_.Pass(); } 20 InterfaceRequest(InterfaceRequest&& other) { handle_ = other.handle_.Pass(); }
21 InterfaceRequest& operator=(decltype(nullptr)) {
22 handle_.reset();
23 return *this;
24 }
20 InterfaceRequest& operator=(InterfaceRequest&& other) { 25 InterfaceRequest& operator=(InterfaceRequest&& other) {
21 handle_ = other.handle_.Pass(); 26 handle_ = other.handle_.Pass();
22 return *this; 27 return *this;
23 } 28 }
24 29
25 // Returns true if the request has yet to be completed. 30 // Returns true if the request has yet to be completed.
26 bool is_pending() const { return handle_.is_valid(); } 31 bool is_pending() const { return handle_.is_valid(); }
27 32
28 void Bind(ScopedMessagePipeHandle handle) { handle_ = handle.Pass(); } 33 void Bind(ScopedMessagePipeHandle handle) { handle_ = handle.Pass(); }
29 34
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 template <typename Interface> 66 template <typename Interface>
62 InterfaceRequest<Interface> GetProxy(InterfacePtr<Interface>* ptr) { 67 InterfaceRequest<Interface> GetProxy(InterfacePtr<Interface>* ptr) {
63 MessagePipe pipe; 68 MessagePipe pipe;
64 ptr->Bind(pipe.handle0.Pass()); 69 ptr->Bind(pipe.handle0.Pass());
65 return MakeRequest<Interface>(pipe.handle1.Pass()); 70 return MakeRequest<Interface>(pipe.handle1.Pass());
66 } 71 }
67 72
68 } // namespace mojo 73 } // namespace mojo
69 74
70 #endif // MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_ 75 #endif // MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/application/service_provider_impl.h ('k') | mojo/public/interfaces/application/service_provider.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698