OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <fcntl.h> | 5 #include <fcntl.h> |
6 #include <pthread.h> | 6 #include <pthread.h> |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
11 | 11 |
12 #include <cstdlib> | 12 #include <cstdlib> |
13 #include <cstring> | 13 #include <cstring> |
14 #include <map> | 14 #include <map> |
15 #include <string> | 15 #include <string> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "nacl_mounts/kernel_wrap.h" | 18 #include "nacl_io/kernel_wrap.h" |
19 #include "nacl_mounts/nacl_mounts.h" | 19 #include "nacl_io/nacl_io.h" |
20 | 20 |
21 #include "ppapi/cpp/input_event.h" | 21 #include "ppapi/cpp/input_event.h" |
22 #include "ppapi/cpp/message_loop.h" | 22 #include "ppapi/cpp/message_loop.h" |
23 #include "ppapi/cpp/rect.h" | 23 #include "ppapi/cpp/rect.h" |
24 #include "ppapi/cpp/size.h" | 24 #include "ppapi/cpp/size.h" |
25 #include "ppapi/cpp/touch_point.h" | 25 #include "ppapi/cpp/touch_point.h" |
26 #include "ppapi/cpp/var.h" | 26 #include "ppapi/cpp/var.h" |
27 | 27 |
28 #include "ppapi_main/ppapi_event.h" | 28 #include "ppapi_main/ppapi_event.h" |
29 #include "ppapi_main/ppapi_instance.h" | 29 #include "ppapi_main/ppapi_instance.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 const char* stdin_path = GetProperty("pm_stdio", "/dev/null"); | 150 const char* stdin_path = GetProperty("pm_stdio", "/dev/null"); |
151 const char* stdout_path = GetProperty("pm_stdout", "/dev/console1"); | 151 const char* stdout_path = GetProperty("pm_stdout", "/dev/console1"); |
152 const char* stderr_path = GetProperty("pm_stderr", "/dev/console3"); | 152 const char* stderr_path = GetProperty("pm_stderr", "/dev/console3"); |
153 const char* queue_size = GetProperty("pm_queue_size", "1024"); | 153 const char* queue_size = GetProperty("pm_queue_size", "1024"); |
154 | 154 |
155 // Force a miniumum size of 4 | 155 // Force a miniumum size of 4 |
156 uint32_t queue_size_int = atoi(queue_size); | 156 uint32_t queue_size_int = atoi(queue_size); |
157 if (queue_size_int < 4) queue_size_int = 4; | 157 if (queue_size_int < 4) queue_size_int = 4; |
158 event_queue_.SetSize(queue_size_int); | 158 event_queue_.SetSize(queue_size_int); |
159 | 159 |
160 nacl_mounts_init_ppapi(PPAPI_GetInstanceId(), PPAPI_GetInterface); | 160 nacl_io_init_ppapi(PPAPI_GetInstanceId(), PPAPI_GetInterface); |
161 int fd0 = open(stdin_path, O_RDONLY); | 161 int fd0 = open(stdin_path, O_RDONLY); |
162 int fd1 = open(stdout_path, O_WRONLY); | 162 int fd1 = open(stdout_path, O_WRONLY); |
163 int fd2 = open(stderr_path, O_WRONLY); | 163 int fd2 = open(stderr_path, O_WRONLY); |
164 | 164 |
165 return (fd0 == 0) && (fd1 == 1) && (fd2 == 2); | 165 return (fd0 == 0) && (fd1 == 1) && (fd2 == 2); |
166 } | 166 } |
167 | 167 |
168 void PPAPIInstance::HandleMessage(const pp::Var& message) {} | 168 void PPAPIInstance::HandleMessage(const pp::Var& message) {} |
169 | 169 |
170 | 170 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 void PPAPIInstance::ReleaseInputEvent(PPAPIEvent* event) { | 257 void PPAPIInstance::ReleaseInputEvent(PPAPIEvent* event) { |
258 event_queue_.ReleaseTopMessage(event); | 258 event_queue_.ReleaseTopMessage(event); |
259 } | 259 } |
260 | 260 |
261 void PPAPIInstance::DidChangeView(const pp::View&) { | 261 void PPAPIInstance::DidChangeView(const pp::View&) { |
262 } | 262 } |
263 | 263 |
264 void PPAPIInstance::DidChangeFocus(bool focus) { | 264 void PPAPIInstance::DidChangeFocus(bool focus) { |
265 has_focus_ = focus; | 265 has_focus_ = focus; |
266 } | 266 } |
OLD | NEW |