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

Side by Side Diff: mojo/public/bindings/lib/sync_dispatcher.cc

Issue 220243007: Mojo: Move mojo/public/bindings/lib to mojo/public/cpp/bindings/lib. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « mojo/public/bindings/lib/shared_ptr.h ('k') | mojo/public/bindings/tests/array_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "mojo/public/cpp/bindings/sync_dispatcher.h"
6
7 #include <stdlib.h>
8
9 #include "mojo/public/cpp/bindings/message.h"
10
11 namespace mojo {
12
13 bool WaitForMessageAndDispatch(MessagePipeHandle handle,
14 MessageReceiver* receiver) {
15 while (true) {
16 bool result;
17 MojoResult rv = ReadAndDispatchMessage(handle, receiver, &result);
18 if (rv == MOJO_RESULT_OK)
19 return result;
20 if (rv == MOJO_RESULT_SHOULD_WAIT)
21 rv = Wait(handle, MOJO_WAIT_FLAG_READABLE, MOJO_DEADLINE_INDEFINITE);
22 if (rv != MOJO_RESULT_OK)
23 return false;
24 }
25 }
26
27 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/bindings/lib/shared_ptr.h ('k') | mojo/public/bindings/tests/array_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698