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

Side by Side Diff: mojo/examples/image_viewer/image_viewer.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/html_viewer/html_viewer.cc ('k') | mojo/examples/wget/wget.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 <algorithm> 5 #include <algorithm>
6 6
7 #include "base/strings/string_tokenizer.h" 7 #include "base/strings/string_tokenizer.h"
8 #include "mojo/public/cpp/application/application.h" 8 #include "mojo/public/cpp/application/application.h"
9 #include "mojo/services/public/cpp/view_manager/node.h" 9 #include "mojo/services/public/cpp/view_manager/node.h"
10 #include "mojo/services/public/cpp/view_manager/types.h" 10 #include "mojo/services/public/cpp/view_manager/types.h"
(...skipping 25 matching lines...) Expand all
36 uint32_t bytes_remaining = content_length; 36 uint32_t bytes_remaining = content_length;
37 uint32_t num_bytes = bytes_remaining; 37 uint32_t num_bytes = bytes_remaining;
38 while (bytes_remaining > 0) { 38 while (bytes_remaining > 0) {
39 MojoResult result = ReadDataRaw( 39 MojoResult result = ReadDataRaw(
40 response_body_stream.get(), 40 response_body_stream.get(),
41 buf, 41 buf,
42 &num_bytes, 42 &num_bytes,
43 MOJO_READ_DATA_FLAG_NONE); 43 MOJO_READ_DATA_FLAG_NONE);
44 if (result == MOJO_RESULT_SHOULD_WAIT) { 44 if (result == MOJO_RESULT_SHOULD_WAIT) {
45 Wait(response_body_stream.get(), 45 Wait(response_body_stream.get(),
46 MOJO_WAIT_FLAG_READABLE, 46 MOJO_HANDLE_SIGNAL_READABLE,
47 MOJO_DEADLINE_INDEFINITE); 47 MOJO_DEADLINE_INDEFINITE);
48 } else if (result == MOJO_RESULT_OK) { 48 } else if (result == MOJO_RESULT_OK) {
49 buf += num_bytes; 49 buf += num_bytes;
50 num_bytes = bytes_remaining -= num_bytes; 50 num_bytes = bytes_remaining -= num_bytes;
51 } else { 51 } else {
52 break; 52 break;
53 } 53 }
54 } 54 }
55 55
56 SkBitmap bitmap; 56 SkBitmap bitmap;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 } 128 }
129 129
130 } // namespace examples 130 } // namespace examples
131 131
132 // static 132 // static
133 Application* Application::Create() { 133 Application* Application::Create() {
134 return new examples::ImageViewer; 134 return new examples::ImageViewer;
135 } 135 }
136 136
137 } // namespace mojo 137 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/examples/html_viewer/html_viewer.cc ('k') | mojo/examples/wget/wget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698