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

Side by Side Diff: mojo/public/cpp/bindings/lib/connector.cc

Issue 830593003: Update mojo sdk to rev 9fbbc4f0fef1187312316c0ed992342474e139f1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cherry-pick mojo 9d3b8dd17f12d20035a14737fdc38dd926890ff8 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
« no previous file with comments | « mojo/public/cpp/bindings/BUILD.gn ('k') | mojo/public/cpp/bindings/lib/union_accessor.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "mojo/public/cpp/bindings/lib/connector.h" 5 #include "mojo/public/cpp/bindings/lib/connector.h"
6 6
7 #include "mojo/public/cpp/bindings/error_handler.h" 7 #include "mojo/public/cpp/bindings/error_handler.h"
8 #include "mojo/public/cpp/environment/logging.h" 8 #include "mojo/public/cpp/environment/logging.h"
9 9
10 namespace mojo { 10 namespace mojo {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 CancelWait(); 44 CancelWait();
45 return message_pipe_.Pass(); 45 return message_pipe_.Pass();
46 } 46 }
47 47
48 bool Connector::WaitForIncomingMessage() { 48 bool Connector::WaitForIncomingMessage() {
49 if (error_) 49 if (error_)
50 return false; 50 return false;
51 51
52 MojoResult rv = Wait(message_pipe_.get(), 52 MojoResult rv = Wait(message_pipe_.get(),
53 MOJO_HANDLE_SIGNAL_READABLE, 53 MOJO_HANDLE_SIGNAL_READABLE,
54 MOJO_DEADLINE_INDEFINITE); 54 MOJO_DEADLINE_INDEFINITE,
55 nullptr);
55 if (rv != MOJO_RESULT_OK) { 56 if (rv != MOJO_RESULT_OK) {
56 NotifyError(); 57 NotifyError();
57 return false; 58 return false;
58 } 59 }
59 mojo_ignore_result(ReadSingleMessage(&rv)); 60 mojo_ignore_result(ReadSingleMessage(&rv));
60 return (rv == MOJO_RESULT_OK); 61 return (rv == MOJO_RESULT_OK);
61 } 62 }
62 63
63 bool Connector::Accept(Message* message) { 64 bool Connector::Accept(Message* message) {
64 MOJO_CHECK(message_pipe_.is_valid()); 65 MOJO_CHECK(message_pipe_.is_valid());
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 198
198 void Connector::NotifyError() { 199 void Connector::NotifyError() {
199 error_ = true; 200 error_ = true;
200 CancelWait(); 201 CancelWait();
201 if (error_handler_) 202 if (error_handler_)
202 error_handler_->OnConnectionError(); 203 error_handler_->OnConnectionError();
203 } 204 }
204 205
205 } // namespace internal 206 } // namespace internal
206 } // namespace mojo 207 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/BUILD.gn ('k') | mojo/public/cpp/bindings/lib/union_accessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698