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

Side by Side Diff: mojo/examples/wget/wget.cc

Issue 336313007: Mojo: Rename MOJO_WAIT_FLAG_... -> MOJO_HANDLE_SIGNAL_.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 6 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/examples/image_viewer/image_viewer.cc ('k') | mojo/public/c/system/tests/core_perftest.cc » ('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 #include <stdio.h> 5 #include <stdio.h>
6 6
7 #include "mojo/public/cpp/application/application.h" 7 #include "mojo/public/cpp/application/application.h"
8 #include "mojo/services/public/interfaces/network/network_service.mojom.h" 8 #include "mojo/services/public/interfaces/network/network_service.mojom.h"
9 #include "mojo/services/public/interfaces/network/url_loader.mojom.h" 9 #include "mojo/services/public/interfaces/network/url_loader.mojom.h"
10 10
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 for (;;) { 82 for (;;) {
83 char buf[512]; 83 char buf[512];
84 uint32_t num_bytes = sizeof(buf); 84 uint32_t num_bytes = sizeof(buf);
85 MojoResult result = ReadDataRaw( 85 MojoResult result = ReadDataRaw(
86 response_body_stream_.get(), 86 response_body_stream_.get(),
87 buf, 87 buf,
88 &num_bytes, 88 &num_bytes,
89 MOJO_READ_DATA_FLAG_NONE); 89 MOJO_READ_DATA_FLAG_NONE);
90 if (result == MOJO_RESULT_SHOULD_WAIT) { 90 if (result == MOJO_RESULT_SHOULD_WAIT) {
91 Wait(response_body_stream_.get(), 91 Wait(response_body_stream_.get(),
92 MOJO_WAIT_FLAG_READABLE, 92 MOJO_HANDLE_SIGNAL_READABLE,
93 MOJO_DEADLINE_INDEFINITE); 93 MOJO_DEADLINE_INDEFINITE);
94 } else if (result == MOJO_RESULT_OK) { 94 } else if (result == MOJO_RESULT_OK) {
95 fwrite(buf, num_bytes, 1, stdout); 95 fwrite(buf, num_bytes, 1, stdout);
96 } else { 96 } else {
97 break; 97 break;
98 } 98 }
99 } 99 }
100 100
101 printf("\n>>> EOF <<<\n"); 101 printf("\n>>> EOF <<<\n");
102 } 102 }
103 103
104 NetworkServicePtr network_service_; 104 NetworkServicePtr network_service_;
105 URLLoaderPtr url_loader_; 105 URLLoaderPtr url_loader_;
106 ScopedDataPipeConsumerHandle response_body_stream_; 106 ScopedDataPipeConsumerHandle response_body_stream_;
107 }; 107 };
108 108
109 } // namespace examples 109 } // namespace examples
110 110
111 // static 111 // static
112 Application* Application::Create() { 112 Application* Application::Create() {
113 return new examples::WGetApp(); 113 return new examples::WGetApp();
114 } 114 }
115 115
116 } // namespace mojo 116 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/examples/image_viewer/image_viewer.cc ('k') | mojo/public/c/system/tests/core_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698