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

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

Issue 721123004: Allow constructing a StrongBinding with an InterfacePtr* (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_STRONG_BINDING_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_STRONG_BINDING_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_STRONG_BINDING_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_STRONG_BINDING_H_
7 7
8 #include "mojo/public/c/environment/async_waiter.h" 8 #include "mojo/public/c/environment/async_waiter.h"
9 #include "mojo/public/cpp/bindings/binding.h" 9 #include "mojo/public/cpp/bindings/binding.h"
10 #include "mojo/public/cpp/bindings/error_handler.h" 10 #include "mojo/public/cpp/bindings/error_handler.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 StrongBinding( 44 StrongBinding(
45 Interface* impl, 45 Interface* impl,
46 ScopedMessagePipeHandle handle, 46 ScopedMessagePipeHandle handle,
47 const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) 47 const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter())
48 : StrongBinding(impl) { 48 : StrongBinding(impl) {
49 binding_.Bind(handle.Pass(), waiter); 49 binding_.Bind(handle.Pass(), waiter);
50 } 50 }
51 51
52 StrongBinding( 52 StrongBinding(
53 Interface* impl, 53 Interface* impl,
54 InterfacePtr<Interface>* ptr,
55 const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter())
56 : StrongBinding(impl) {
57 binding_.Bind(ptr, waiter);
58 }
59
60 StrongBinding(
61 Interface* impl,
54 InterfaceRequest<Interface> request, 62 InterfaceRequest<Interface> request,
55 const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) 63 const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter())
56 : StrongBinding(impl) { 64 : StrongBinding(impl) {
57 binding_.Bind(request.Pass(), waiter); 65 binding_.Bind(request.Pass(), waiter);
58 } 66 }
59 67
60 ~StrongBinding() override {} 68 ~StrongBinding() override {}
61 69
62 bool WaitForIncomingMethodCall() { 70 bool WaitForIncomingMethodCall() {
63 return binding_.WaitForIncomingMethodCall(); 71 return binding_.WaitForIncomingMethodCall();
(...skipping 15 matching lines...) Expand all
79 } 87 }
80 88
81 private: 89 private:
82 ErrorHandler* error_handler_ = nullptr; 90 ErrorHandler* error_handler_ = nullptr;
83 Binding<Interface> binding_; 91 Binding<Interface> binding_;
84 }; 92 };
85 93
86 } // namespace mojo 94 } // namespace mojo
87 95
88 #endif // MOJO_PUBLIC_CPP_BINDINGS_STRONG_BINDING_H_ 96 #endif // MOJO_PUBLIC_CPP_BINDINGS_STRONG_BINDING_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698