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

Side by Side Diff: components/nacl/loader/nacl_listener.cc

Issue 292213002: Change to using nacl_file_info.h from src/public instead. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: might as well use helper to check Created 6 years, 7 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 | « components/nacl/loader/DEPS ('k') | components/nacl/loader/nacl_validation_query.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/nacl/loader/nacl_listener.h" 5 #include "components/nacl/loader/nacl_listener.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 9
10 #if defined(OS_POSIX) 10 #if defined(OS_POSIX)
11 #include <unistd.h> 11 #include <unistd.h>
12 #endif 12 #endif
13 13
14 #include "base/command_line.h" 14 #include "base/command_line.h"
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
17 #include "base/message_loop/message_loop.h" 17 #include "base/message_loop/message_loop.h"
18 #include "base/rand_util.h" 18 #include "base/rand_util.h"
19 #include "components/nacl/common/nacl_messages.h" 19 #include "components/nacl/common/nacl_messages.h"
20 #include "components/nacl/loader/nacl_ipc_adapter.h" 20 #include "components/nacl/loader/nacl_ipc_adapter.h"
21 #include "components/nacl/loader/nacl_validation_db.h" 21 #include "components/nacl/loader/nacl_validation_db.h"
22 #include "components/nacl/loader/nacl_validation_query.h" 22 #include "components/nacl/loader/nacl_validation_query.h"
23 #include "ipc/ipc_channel_handle.h" 23 #include "ipc/ipc_channel_handle.h"
24 #include "ipc/ipc_switches.h" 24 #include "ipc/ipc_switches.h"
25 #include "ipc/ipc_sync_channel.h" 25 #include "ipc/ipc_sync_channel.h"
26 #include "ipc/ipc_sync_message_filter.h" 26 #include "ipc/ipc_sync_message_filter.h"
27 #include "native_client/src/public/chrome_main.h" 27 #include "native_client/src/public/chrome_main.h"
28 #include "native_client/src/public/nacl_app.h" 28 #include "native_client/src/public/nacl_app.h"
29 #include "native_client/src/trusted/validator/nacl_file_info.h" 29 #include "native_client/src/public/nacl_file_info.h"
30 30
31 #if defined(OS_POSIX) 31 #if defined(OS_POSIX)
32 #include "base/file_descriptor_posix.h" 32 #include "base/file_descriptor_posix.h"
33 #endif 33 #endif
34 34
35 #if defined(OS_LINUX) 35 #if defined(OS_LINUX)
36 #include "components/nacl/loader/nonsfi/irt_random.h" 36 #include "components/nacl/loader/nonsfi/irt_random.h"
37 #include "components/nacl/loader/nonsfi/nonsfi_main.h" 37 #include "components/nacl/loader/nonsfi/nonsfi_main.h"
38 #include "content/public/common/child_process_sandbox_support_linux.h" 38 #include "content/public/common/child_process_sandbox_support_linux.h"
39 #include "ppapi/nacl_irt/plugin_startup.h" 39 #include "ppapi/nacl_irt/plugin_startup.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 // Caching is optional: NaCl will still work correctly if the IPC fails. 162 // Caching is optional: NaCl will still work correctly if the IPC fails.
163 if (!listener_->Send(new NaClProcessMsg_SetKnownToValidate(signature))) { 163 if (!listener_->Send(new NaClProcessMsg_SetKnownToValidate(signature))) {
164 LOG(ERROR) << "Failed to update NaCl validation cache."; 164 LOG(ERROR) << "Failed to update NaCl validation cache.";
165 } 165 }
166 } 166 }
167 167
168 virtual bool ResolveFileToken(struct NaClFileToken* file_token, 168 virtual bool ResolveFileToken(struct NaClFileToken* file_token,
169 int32* fd, std::string* path) OVERRIDE { 169 int32* fd, std::string* path) OVERRIDE {
170 *fd = -1; 170 *fd = -1;
171 *path = ""; 171 *path = "";
172 if (file_token->lo == 0 && file_token->hi == 0) { 172 if (!NaClFileTokenIsValid(file_token)) {
173 return false; 173 return false;
174 } 174 }
175 IPC::PlatformFileForTransit ipc_fd = IPC::InvalidPlatformFileForTransit(); 175 IPC::PlatformFileForTransit ipc_fd = IPC::InvalidPlatformFileForTransit();
176 base::FilePath ipc_path; 176 base::FilePath ipc_path;
177 if (!listener_->Send(new NaClProcessMsg_ResolveFileToken(file_token->lo, 177 if (!listener_->Send(new NaClProcessMsg_ResolveFileToken(file_token->lo,
178 file_token->hi, 178 file_token->hi,
179 &ipc_fd, 179 &ipc_fd,
180 &ipc_path))) { 180 &ipc_path))) {
181 return false; 181 return false;
182 } 182 }
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 args->debug_stub_server_port_selected_handler_func = 471 args->debug_stub_server_port_selected_handler_func =
472 DebugStubPortSelectedHandler; 472 DebugStubPortSelectedHandler;
473 #endif 473 #endif
474 #if defined(OS_LINUX) 474 #if defined(OS_LINUX)
475 args->prereserved_sandbox_size = prereserved_sandbox_size_; 475 args->prereserved_sandbox_size = prereserved_sandbox_size_;
476 #endif 476 #endif
477 477
478 NaClChromeMainStartApp(nap, args); 478 NaClChromeMainStartApp(nap, args);
479 NOTREACHED(); 479 NOTREACHED();
480 } 480 }
OLDNEW
« no previous file with comments | « components/nacl/loader/DEPS ('k') | components/nacl/loader/nacl_validation_query.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698