| OLD | NEW |
| 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 "chrome/browser/nacl_host/nacl_host_message_filter.h" | 5 #include "chrome/browser/nacl_host/nacl_host_message_filter.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 IPC::Message* reply_msg) { | 81 IPC::Message* reply_msg) { |
| 82 NaClProcessHost* host = new NaClProcessHost( | 82 NaClProcessHost* host = new NaClProcessHost( |
| 83 GURL(launch_params.manifest_url), | 83 GURL(launch_params.manifest_url), |
| 84 launch_params.render_view_id, | 84 launch_params.render_view_id, |
| 85 launch_params.permission_bits, | 85 launch_params.permission_bits, |
| 86 launch_params.uses_irt, | 86 launch_params.uses_irt, |
| 87 launch_params.enable_dyncode_syscalls, | 87 launch_params.enable_dyncode_syscalls, |
| 88 launch_params.enable_exception_handling, | 88 launch_params.enable_exception_handling, |
| 89 off_the_record_, | 89 off_the_record_, |
| 90 profile_directory_); | 90 profile_directory_); |
| 91 base::FilePath manifest_url = GetManifestPath( | 91 base::FilePath manifest_url = |
| 92 extension_info_map_, | 92 GetManifestPath(extension_info_map_.get(), launch_params.manifest_url); |
| 93 launch_params.manifest_url); | |
| 94 host->Launch(this, reply_msg, manifest_url); | 93 host->Launch(this, reply_msg, manifest_url); |
| 95 } | 94 } |
| 96 | 95 |
| 97 void NaClHostMessageFilter::OnGetReadonlyPnaclFd( | 96 void NaClHostMessageFilter::OnGetReadonlyPnaclFd( |
| 98 const std::string& filename, IPC::Message* reply_msg) { | 97 const std::string& filename, IPC::Message* reply_msg) { |
| 99 // This posts a task to another thread, but the renderer will | 98 // This posts a task to another thread, but the renderer will |
| 100 // block until the reply is sent. | 99 // block until the reply is sent. |
| 101 nacl_file_host::GetReadonlyPnaclFd(this, filename, reply_msg); | 100 nacl_file_host::GetReadonlyPnaclFd(this, filename, reply_msg); |
| 102 } | 101 } |
| 103 | 102 |
| 104 void NaClHostMessageFilter::OnNaClCreateTemporaryFile( | 103 void NaClHostMessageFilter::OnNaClCreateTemporaryFile( |
| 105 IPC::Message* reply_msg) { | 104 IPC::Message* reply_msg) { |
| 106 nacl_file_host::CreateTemporaryFile(this, reply_msg); | 105 nacl_file_host::CreateTemporaryFile(this, reply_msg); |
| 107 } | 106 } |
| 108 | 107 |
| 109 void NaClHostMessageFilter::OnNaClErrorStatus(int render_view_id, | 108 void NaClHostMessageFilter::OnNaClErrorStatus(int render_view_id, |
| 110 int error_id) { | 109 int error_id) { |
| 111 // Currently there is only one kind of error status, for which | 110 // Currently there is only one kind of error status, for which |
| 112 // we want to show the user an infobar. | 111 // we want to show the user an infobar. |
| 113 ShowNaClInfobar(render_process_id_, render_view_id, error_id); | 112 ShowNaClInfobar(render_process_id_, render_view_id, error_id); |
| 114 } | 113 } |
| 115 | 114 |
| 116 void NaClHostMessageFilter::OnOpenNaClExecutable(int render_view_id, | 115 void NaClHostMessageFilter::OnOpenNaClExecutable(int render_view_id, |
| 117 const GURL& file_url, | 116 const GURL& file_url, |
| 118 IPC::Message* reply_msg) { | 117 IPC::Message* reply_msg) { |
| 119 nacl_file_host::OpenNaClExecutable(this, extension_info_map_, | 118 nacl_file_host::OpenNaClExecutable(this, extension_info_map_, |
| 120 render_view_id, file_url, reply_msg); | 119 render_view_id, file_url, reply_msg); |
| 121 } | 120 } |
| 122 #endif | 121 #endif |
| OLD | NEW |