OLD | NEW |
---|---|
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <pthread.h> | 5 #include <pthread.h> |
6 #include <unistd.h> | 6 #include <unistd.h> |
7 | 7 |
8 #include <sstream> | 8 #include <sstream> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "native_client/src/untrusted/irt/irt.h" | 11 #include "native_client/src/untrusted/irt/irt.h" |
12 | 12 |
13 #include "ppapi/cpp/completion_callback.h" | 13 #include "ppapi/cpp/completion_callback.h" |
14 #include "ppapi/cpp/instance.h" | 14 #include "ppapi/cpp/instance.h" |
15 #include "ppapi/cpp/module.h" | 15 #include "ppapi/cpp/module.h" |
16 #include "ppapi/cpp/tcp_socket.h" | 16 #include "ppapi/cpp/tcp_socket.h" |
17 #include "ppapi/cpp/var.h" | 17 #include "ppapi/cpp/var.h" |
18 #include "ppapi/utility/completion_callback_factory.h" | 18 #include "ppapi/utility/completion_callback_factory.h" |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 std::string g_last_error; | 22 std::string g_last_error; |
23 pp::Instance* g_instance = NULL; | 23 pp::Instance* g_instance = NULL; |
24 | 24 |
25 // This should be the same as FileDescriptorSet::kMaxDescriptorsPerMessage in | 25 // This should be the same as MessageAttachmentSet::kMaxDescriptorsPerMessage in |
26 // ipc/file_descriptor_set_posix.h. | 26 // ipc/ipc_message_attachment_set.h. |
27 // TODO(yusukes): Once all the NaCl toolchains support C++11, Add | 27 // TODO(yusukes): Once all the NaCl toolchains support C++11, Add |
Mark Seaborn
2015/03/16 17:06:50
Which NaCl toolchains does "ipc/file_descriptor_se
Yusuke Sato
2015/03/16 21:27:28
At least '../../../native_client/build/build_nexe.
| |
28 // #include "ipc/file_descriptor_set_posix.h" and remove the constant. | 28 // #include "ipc/file_descriptor_set_posix.h" and remove the constant. |
29 const size_t kMaxDescriptorsPerMessage = 7; | 29 const size_t kMaxDescriptorsPerMessage = 128; |
30 | 30 |
31 // Returns true if the resource file whose name is |key| exists and its content | 31 // Returns true if the resource file whose name is |key| exists and its content |
32 // matches |content|. | 32 // matches |content|. |
33 bool LoadManifestInternal(nacl_irt_resource_open* nacl_irt_resource_open, | 33 bool LoadManifestInternal(nacl_irt_resource_open* nacl_irt_resource_open, |
34 const std::string& key, | 34 const std::string& key, |
35 const std::string& content) { | 35 const std::string& content) { |
36 int desc; | 36 int desc; |
37 int error; | 37 int error; |
38 error = nacl_irt_resource_open->open_resource(key.c_str(), &desc); | 38 error = nacl_irt_resource_open->open_resource(key.c_str(), &desc); |
39 if (0 != error) { | 39 if (0 != error) { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 | 159 |
160 } // namespace | 160 } // namespace |
161 | 161 |
162 namespace pp { | 162 namespace pp { |
163 | 163 |
164 Module* CreateModule() { | 164 Module* CreateModule() { |
165 return new MyModule(); | 165 return new MyModule(); |
166 } | 166 } |
167 | 167 |
168 } // namespace pp | 168 } // namespace pp |
OLD | NEW |