OLD | NEW |
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 "mojo/public/cpp/application/application.h" | 5 #include "mojo/public/cpp/application/application.h" |
6 #include "mojo/services/public/cpp/view_manager/node.h" | 6 #include "mojo/services/public/cpp/view_manager/node.h" |
7 #include "mojo/services/public/cpp/view_manager/types.h" | 7 #include "mojo/services/public/cpp/view_manager/types.h" |
8 #include "mojo/services/public/cpp/view_manager/view.h" | 8 #include "mojo/services/public/cpp/view_manager/view.h" |
9 #include "mojo/services/public/cpp/view_manager/view_manager.h" | 9 #include "mojo/services/public/cpp/view_manager/view_manager.h" |
10 #include "mojo/services/public/cpp/view_manager/view_manager_delegate.h" | 10 #include "mojo/services/public/cpp/view_manager/view_manager_delegate.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 for (;;) { | 31 for (;;) { |
32 char buf[512]; | 32 char buf[512]; |
33 uint32_t num_bytes = sizeof(buf); | 33 uint32_t num_bytes = sizeof(buf); |
34 MojoResult result = ReadDataRaw( | 34 MojoResult result = ReadDataRaw( |
35 response_body_stream.get(), | 35 response_body_stream.get(), |
36 buf, | 36 buf, |
37 &num_bytes, | 37 &num_bytes, |
38 MOJO_READ_DATA_FLAG_NONE); | 38 MOJO_READ_DATA_FLAG_NONE); |
39 if (result == MOJO_RESULT_SHOULD_WAIT) { | 39 if (result == MOJO_RESULT_SHOULD_WAIT) { |
40 Wait(response_body_stream.get(), | 40 Wait(response_body_stream.get(), |
41 MOJO_WAIT_FLAG_READABLE, | 41 MOJO_HANDLE_SIGNAL_READABLE, |
42 MOJO_DEADLINE_INDEFINITE); | 42 MOJO_DEADLINE_INDEFINITE); |
43 } else if (result == MOJO_RESULT_OK) { | 43 } else if (result == MOJO_RESULT_OK) { |
44 fwrite(buf, num_bytes, 1, stdout); | 44 fwrite(buf, num_bytes, 1, stdout); |
45 } else { | 45 } else { |
46 break; | 46 break; |
47 } | 47 } |
48 } | 48 } |
49 printf("\n>>>> EOF <<<<\n\n"); | 49 printf("\n>>>> EOF <<<<\n\n"); |
50 | 50 |
51 UpdateView(); | 51 UpdateView(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 } | 91 } |
92 | 92 |
93 } | 93 } |
94 | 94 |
95 // static | 95 // static |
96 Application* Application::Create() { | 96 Application* Application::Create() { |
97 return new examples::HTMLViewer; | 97 return new examples::HTMLViewer; |
98 } | 98 } |
99 | 99 |
100 } | 100 } |
OLD | NEW |