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

Unified Diff: mojo/examples/sample_app/sample_app.cc

Issue 51373002: NativeViewport (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nl Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/mojo.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/sample_app/sample_app.cc
diff --git a/mojo/examples/sample_app/sample_app.cc b/mojo/examples/sample_app/sample_app.cc
index 820bdd4d95fbdca8fe666eb538ad1e16bd1e506c..f4a729971bc4736e18dbb6b3b4a71e6e79313879 100644
--- a/mojo/examples/sample_app/sample_app.cc
+++ b/mojo/examples/sample_app/sample_app.cc
@@ -4,8 +4,8 @@
#include <stdio.h>
-#include "base/basictypes.h"
#include "mojo/public/system/core.h"
+#include "mojo/public/system/macros.h"
#include "mojo/system/core_impl.h"
#if defined(OS_WIN)
@@ -52,18 +52,21 @@ class SampleMessageWaiter {
}
void WaitAndRead() {
- MojoResult result = mojo::Wait(pipe_, MOJO_WAIT_FLAG_READABLE, 100);
- if (result < MOJO_RESULT_OK) {
- // Failure...
+ for (int i = 0; i < 100;) {
+ MojoResult result = mojo::Wait(pipe_, MOJO_WAIT_FLAG_READABLE, 100);
+ if (result < MOJO_RESULT_OK) {
+ // Failure...
+ continue;
+ }
+ ++i;
+ Read();
}
-
- Read();
}
private:
-
mojo::Handle pipe_;
- DISALLOW_COPY_AND_ASSIGN(SampleMessageWaiter);
+
+ MOJO_DISALLOW_COPY_AND_ASSIGN(SampleMessageWaiter);
};
extern "C" SAMPLE_APP_EXPORT MojoResult CDECL MojoMain(
« no previous file with comments | « no previous file | mojo/mojo.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698