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 "ppapi/nacl_irt/manifest_service.h" | 5 #include "ppapi/nacl_irt/manifest_service.h" |
6 | 6 |
7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.h" |
8 #include "ipc/ipc_channel_handle.h" | 8 #include "ipc/ipc_channel_handle.h" |
9 #include "ipc/ipc_channel_proxy.h" | 9 #include "ipc/ipc_channel_proxy.h" |
10 #include "ipc/ipc_sync_message_filter.h" | 10 #include "ipc/ipc_sync_message_filter.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 if (!filter_->Send(new PpapiHostMsg_OpenResource( | 97 if (!filter_->Send(new PpapiHostMsg_OpenResource( |
98 std::string(kFilePrefix) + file, | 98 std::string(kFilePrefix) + file, |
99 &ipc_fd, | 99 &ipc_fd, |
100 &file_token_lo, | 100 &file_token_lo, |
101 &file_token_hi))) { | 101 &file_token_hi))) { |
102 LOG(ERROR) << "ManifestService::OpenResource failed:" << file; | 102 LOG(ERROR) << "ManifestService::OpenResource failed:" << file; |
103 *fd = -1; | 103 *fd = -1; |
104 return false; | 104 return false; |
105 } | 105 } |
106 | 106 |
107 #if defined(OS_NACL) | 107 #if defined(OS_NACL_SFI) |
108 // File tokens are used internally by NaClIPCAdapter and should have | 108 // File tokens are used internally by NaClIPCAdapter and should have |
109 // been cleared from the message when it is received here. | 109 // been cleared from the message when it is received here. |
110 // Note that, on Non-SFI NaCl, the IPC channel is directly connected to the | 110 // Note that, on Non-SFI NaCl, the IPC channel is directly connected to the |
111 // renderer process, so NaClIPCAdapter does not work. It means, | 111 // renderer process, so NaClIPCAdapter does not work. It means, |
112 // file_token_{lo,hi} fields may be properly filled, although it is just | 112 // file_token_{lo,hi} fields may be properly filled, although it is just |
113 // ignored here. | 113 // ignored here. |
114 CHECK(file_token_lo == 0); | 114 CHECK(file_token_lo == 0); |
115 CHECK(file_token_hi == 0); | 115 CHECK(file_token_hi == 0); |
116 #endif | 116 #endif |
117 | 117 |
(...skipping 14 matching lines...) Expand all Loading... |
132 | 132 |
133 ManifestService* manifest_service = GetManifestService(); | 133 ManifestService* manifest_service = GetManifestService(); |
134 if (manifest_service == NULL || | 134 if (manifest_service == NULL || |
135 !manifest_service->OpenResource(file, fd)) { | 135 !manifest_service->OpenResource(file, fd)) { |
136 return NACL_ABI_EIO; | 136 return NACL_ABI_EIO; |
137 } | 137 } |
138 return (*fd == -1) ? NACL_ABI_ENOENT : 0; | 138 return (*fd == -1) ? NACL_ABI_ENOENT : 0; |
139 } | 139 } |
140 | 140 |
141 } // namespace ppapi | 141 } // namespace ppapi |
OLD | NEW |