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

Side by Side Diff: mojo/public/cpp/bindings/lib/interface_ptr_internal.h

Issue 1055703002: Gather trace data by waiting on handles with a fixed timeout (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: review feedback Created 5 years, 8 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
« no previous file with comments | « mojo/public/cpp/bindings/lib/connector.cc ('k') | mojo/public/cpp/bindings/lib/router.h » ('j') | 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_LIB_INTERFACE_PTR_INTERNAL_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_
7 7
8 #include <algorithm> // For |std::swap()|. 8 #include <algorithm> // For |std::swap()|.
9 9
10 #include "mojo/public/cpp/bindings/interface_ptr_info.h" 10 #include "mojo/public/cpp/bindings/interface_ptr_info.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 handle_ = info.PassHandle(); 61 handle_ = info.PassHandle();
62 waiter_ = waiter; 62 waiter_ = waiter;
63 version_ = info.version(); 63 version_ = info.version();
64 } 64 }
65 65
66 bool WaitForIncomingMethodCall() { 66 bool WaitForIncomingMethodCall() {
67 ConfigureProxyIfNecessary(); 67 ConfigureProxyIfNecessary();
68 68
69 MOJO_DCHECK(router_); 69 MOJO_DCHECK(router_);
70 return router_->WaitForIncomingMessage(); 70 return router_->WaitForIncomingMessage(MOJO_DEADLINE_INDEFINITE);
71 } 71 }
72 72
73 // After this method is called, the object is in an invalid state and 73 // After this method is called, the object is in an invalid state and
74 // shouldn't be reused. 74 // shouldn't be reused.
75 InterfacePtrInfo<Interface> PassInterface() { 75 InterfacePtrInfo<Interface> PassInterface() {
76 return InterfacePtrInfo<Interface>( 76 return InterfacePtrInfo<Interface>(
77 router_ ? router_->PassMessagePipe() : handle_.Pass(), version_); 77 router_ ? router_->PassMessagePipe() : handle_.Pass(), version_);
78 } 78 }
79 79
80 bool is_bound() const { return handle_.is_valid() || router_; } 80 bool is_bound() const { return handle_.is_valid() || router_; }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 uint32_t version_; 132 uint32_t version_;
133 133
134 MOJO_DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); 134 MOJO_DISALLOW_COPY_AND_ASSIGN(InterfacePtrState);
135 }; 135 };
136 136
137 } // namespace internal 137 } // namespace internal
138 } // namespace mojo 138 } // namespace mojo
139 139
140 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_ 140 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/connector.cc ('k') | mojo/public/cpp/bindings/lib/router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698