summaryrefslogtreecommitdiff
path: root/ppapi
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2013-07-23 11:17:05 +0100
committerBen Murdoch <benm@google.com>2013-07-23 11:17:05 +0100
commitca12bfac764ba476d6cd062bf1dde12cc64c3f40 (patch)
tree1cd09db25ea5de98e73c8efbe572e103daee8b2b /ppapi
parentfcb3e05bdd21d752df9c3dff28b6bbf29b5b733b (diff)
downloadchromium_org-ca12bfac764ba476d6cd062bf1dde12cc64c3f40.tar.gz
Merge from Chromium at DEPS revision r213057
This commit was generated by merge_to_master.py. Change-Id: I3e2e2506eb9b0080157e9c5f133559df3e600388
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/api/private/ppb_nacl_private.idl3
-rw-r--r--ppapi/c/private/ppb_nacl_private.h4
-rw-r--r--ppapi/native_client/src/trusted/plugin/arch_arm/sandbox_isa.cc2
-rw-r--r--ppapi/native_client/src/trusted/plugin/arch_x86/sandbox_isa.cc2
-rw-r--r--ppapi/native_client/src/trusted/plugin/file_downloader.cc8
-rw-r--r--ppapi/native_client/src/trusted/plugin/file_downloader.h2
-rw-r--r--ppapi/native_client/src/trusted/plugin/file_utils.cc2
-rw-r--r--ppapi/native_client/src/trusted/plugin/json_manifest.cc34
-rw-r--r--ppapi/native_client/src/trusted/plugin/json_manifest.h2
-rw-r--r--ppapi/native_client/src/trusted/plugin/local_temp_file.cc7
-rw-r--r--ppapi/native_client/src/trusted/plugin/module_ppapi.cc5
-rw-r--r--ppapi/native_client/src/trusted/plugin/nacl_entry_points.h3
-rw-r--r--ppapi/native_client/src/trusted/plugin/nacl_http_response_headers.cc2
-rw-r--r--ppapi/native_client/src/trusted/plugin/nacl_http_response_headers_unittest.cc2
-rw-r--r--ppapi/native_client/src/trusted/plugin/nacl_subprocess.cc6
-rw-r--r--ppapi/native_client/src/trusted/plugin/nacl_subprocess.h4
-rw-r--r--ppapi/native_client/src/trusted/plugin/plugin.cc24
-rw-r--r--ppapi/native_client/src/trusted/plugin/plugin.gyp3
-rw-r--r--ppapi/native_client/src/trusted/plugin/plugin.h11
-rw-r--r--ppapi/native_client/src/trusted/plugin/plugin_error.h20
-rw-r--r--ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc19
-rw-r--r--ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h17
-rw-r--r--ppapi/native_client/src/trusted/plugin/pnacl_options.cc25
-rw-r--r--ppapi/native_client/src/trusted/plugin/pnacl_options.h12
-rw-r--r--ppapi/native_client/src/trusted/plugin/pnacl_resources.cc15
-rw-r--r--ppapi/native_client/src/trusted/plugin/pnacl_resources.h16
-rw-r--r--ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc38
-rw-r--r--ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h5
-rw-r--r--ppapi/native_client/src/trusted/plugin/scriptable_plugin.cc6
-rw-r--r--ppapi/native_client/src/trusted/plugin/scriptable_plugin.h2
-rw-r--r--ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc17
-rw-r--r--ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h3
-rw-r--r--ppapi/native_client/src/trusted/plugin/service_runtime.cc29
-rw-r--r--ppapi/native_client/src/trusted/plugin/service_runtime.h3
-rw-r--r--ppapi/native_client/src/trusted/plugin/srpc_client.cc8
-rw-r--r--ppapi/native_client/src/trusted/plugin/srpc_client.h2
-rw-r--r--ppapi/native_client/src/trusted/plugin/srpc_params.cc2
-rw-r--r--ppapi/native_client/src/trusted/plugin/temporary_file.cc7
-rw-r--r--ppapi/native_client/src/trusted/plugin/utility.cc2
-rw-r--r--ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c6
-rw-r--r--ppapi/proxy/browser_font_resource_trusted.cc2
-rw-r--r--ppapi/proxy/pdf_resource.cc2
-rw-r--r--ppapi/proxy/plugin_main_nacl.cc16
-rw-r--r--ppapi/proxy/ppapi_messages.h7
-rw-r--r--ppapi/proxy/ppb_image_data_proxy.cc2
-rw-r--r--ppapi/shared_impl/private/ppb_char_set_shared.cc8
-rw-r--r--ppapi/tests/test_instance_deprecated.cc41
-rw-r--r--ppapi/tests/test_instance_deprecated.h2
-rw-r--r--ppapi/tests/test_post_message.cc3
49 files changed, 259 insertions, 204 deletions
diff --git a/ppapi/api/private/ppb_nacl_private.idl b/ppapi/api/private/ppb_nacl_private.idl
index 5de847c418..c420e74cb3 100644
--- a/ppapi/api/private/ppb_nacl_private.idl
+++ b/ppapi/api/private/ppb_nacl_private.idl
@@ -57,7 +57,8 @@ interface PPB_NaCl_Private {
[in] PP_Bool enable_ppapi_dev,
[in] PP_Bool enable_dyncode_syscalls,
[in] PP_Bool enable_exception_handling,
- [out] mem_t imc_handle);
+ [out] mem_t imc_handle,
+ [out] PP_Var error_message);
/* This function starts the IPC proxy so the nexe can communicate with the
* browser. Returns PP_NACL_OK on success, otherwise a result code indicating
diff --git a/ppapi/c/private/ppb_nacl_private.h b/ppapi/c/private/ppb_nacl_private.h
index cde1a984d9..9648831f61 100644
--- a/ppapi/c/private/ppb_nacl_private.h
+++ b/ppapi/c/private/ppb_nacl_private.h
@@ -13,6 +13,7 @@
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_macros.h"
#include "ppapi/c/pp_stdint.h"
+#include "ppapi/c/pp_var.h"
#define PPB_NACL_PRIVATE_INTERFACE_1_0 "PPB_NaCl_Private;1.0"
#define PPB_NACL_PRIVATE_INTERFACE PPB_NACL_PRIVATE_INTERFACE_1_0
@@ -83,7 +84,8 @@ struct PPB_NaCl_Private_1_0 {
PP_Bool enable_ppapi_dev,
PP_Bool enable_dyncode_syscalls,
PP_Bool enable_exception_handling,
- void* imc_handle);
+ void* imc_handle,
+ struct PP_Var* error_message);
/* This function starts the IPC proxy so the nexe can communicate with the
* browser. Returns PP_NACL_OK on success, otherwise a result code indicating
* the failure. PP_NACL_FAILED is returned if LaunchSelLdr wasn't called with
diff --git a/ppapi/native_client/src/trusted/plugin/arch_arm/sandbox_isa.cc b/ppapi/native_client/src/trusted/plugin/arch_arm/sandbox_isa.cc
index 01b87695d5..108f49be22 100644
--- a/ppapi/native_client/src/trusted/plugin/arch_arm/sandbox_isa.cc
+++ b/ppapi/native_client/src/trusted/plugin/arch_arm/sandbox_isa.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "native_client/src/trusted/plugin/nexe_arch.h"
+#include "ppapi/native_client/src/trusted/plugin/nexe_arch.h"
namespace {
// The list of supported ISA strings for ARM. See issue:
diff --git a/ppapi/native_client/src/trusted/plugin/arch_x86/sandbox_isa.cc b/ppapi/native_client/src/trusted/plugin/arch_x86/sandbox_isa.cc
index f71c2becba..3f5ab0db24 100644
--- a/ppapi/native_client/src/trusted/plugin/arch_x86/sandbox_isa.cc
+++ b/ppapi/native_client/src/trusted/plugin/arch_x86/sandbox_isa.cc
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "native_client/src/trusted/plugin/nexe_arch.h"
#include "native_client/src/trusted/platform_qualify/nacl_os_qualify.h"
+#include "ppapi/native_client/src/trusted/plugin/nexe_arch.h"
namespace {
// The list of supported ISA strings for x86. See issue:
diff --git a/ppapi/native_client/src/trusted/plugin/file_downloader.cc b/ppapi/native_client/src/trusted/plugin/file_downloader.cc
index b66a267de1..d7be3b4221 100644
--- a/ppapi/native_client/src/trusted/plugin/file_downloader.cc
+++ b/ppapi/native_client/src/trusted/plugin/file_downloader.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "native_client/src/trusted/plugin/file_downloader.h"
+#include "ppapi/native_client/src/trusted/plugin/file_downloader.h"
#include <stdio.h>
#include <string.h>
@@ -11,15 +11,15 @@
#include "native_client/src/include/portability_io.h"
#include "native_client/src/shared/platform/nacl_check.h"
#include "native_client/src/shared/platform/nacl_time.h"
-#include "native_client/src/trusted/plugin/callback_source.h"
-#include "native_client/src/trusted/plugin/plugin.h"
-#include "native_client/src/trusted/plugin/utility.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/ppb_file_io.h"
#include "ppapi/cpp/file_io.h"
#include "ppapi/cpp/file_ref.h"
#include "ppapi/cpp/url_request_info.h"
#include "ppapi/cpp/url_response_info.h"
+#include "ppapi/native_client/src/trusted/plugin/callback_source.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin.h"
+#include "ppapi/native_client/src/trusted/plugin/utility.h"
namespace {
diff --git a/ppapi/native_client/src/trusted/plugin/file_downloader.h b/ppapi/native_client/src/trusted/plugin/file_downloader.h
index f72e7179a8..e84e636868 100644
--- a/ppapi/native_client/src/trusted/plugin/file_downloader.h
+++ b/ppapi/native_client/src/trusted/plugin/file_downloader.h
@@ -9,7 +9,6 @@
#include "native_client/src/include/nacl_macros.h"
#include "native_client/src/include/nacl_string.h"
-#include "native_client/src/trusted/plugin/callback_source.h"
#include "native_client/src/trusted/validator/nacl_file_info.h"
#include "ppapi/c/private/pp_file_handle.h"
#include "ppapi/c/trusted/ppb_file_io_trusted.h"
@@ -18,6 +17,7 @@
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/url_loader.h"
#include "ppapi/cpp/url_response_info.h"
+#include "ppapi/native_client/src/trusted/plugin/callback_source.h"
#include "ppapi/utility/completion_callback_factory.h"
namespace plugin {
diff --git a/ppapi/native_client/src/trusted/plugin/file_utils.cc b/ppapi/native_client/src/trusted/plugin/file_utils.cc
index 50600a2a20..d83432785b 100644
--- a/ppapi/native_client/src/trusted/plugin/file_utils.cc
+++ b/ppapi/native_client/src/trusted/plugin/file_utils.cc
@@ -4,7 +4,7 @@
// Some common file utilities for plugin code.
-#include "native_client/src/trusted/plugin/file_utils.h"
+#include "ppapi/native_client/src/trusted/plugin/file_utils.h"
#include <fcntl.h>
#include <stdio.h>
diff --git a/ppapi/native_client/src/trusted/plugin/json_manifest.cc b/ppapi/native_client/src/trusted/plugin/json_manifest.cc
index d69605970b..12d3c10d19 100644
--- a/ppapi/native_client/src/trusted/plugin/json_manifest.cc
+++ b/ppapi/native_client/src/trusted/plugin/json_manifest.cc
@@ -6,7 +6,7 @@
#include <algorithm>
-#include "native_client/src/trusted/plugin/json_manifest.h"
+#include "ppapi/native_client/src/trusted/plugin/json_manifest.h"
#include <stdlib.h>
@@ -15,11 +15,11 @@
#include "native_client/src/include/nacl_string.h"
#include "native_client/src/include/portability.h"
#include "native_client/src/shared/platform/nacl_check.h"
-#include "native_client/src/trusted/plugin/plugin_error.h"
-#include "native_client/src/trusted/plugin/pnacl_options.h"
-#include "native_client/src/trusted/plugin/utility.h"
#include "ppapi/cpp/dev/url_util_dev.h"
#include "ppapi/cpp/var.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin_error.h"
+#include "ppapi/native_client/src/trusted/plugin/pnacl_options.h"
+#include "ppapi/native_client/src/trusted/plugin/utility.h"
#include "third_party/jsoncpp/source/include/json/reader.h"
namespace plugin {
@@ -40,10 +40,12 @@ const char* const kPortableKey = "portable";
const char* const kPnaclTranslateKey = "pnacl-translate";
const char* const kUrlKey = "url";
-// Pnacl keys
-const char* const kOptLevelKey = "-O";
+// PNaCl keys
+const char* const kOptLevelKey = "optlevel";
+// DEPRECATED! TODO(jvoung): remove the error message after launch.
+const char* const kOptLevelKeyDeprecated = "-O";
-// Sample NaCL manifest file:
+// Sample NaCl manifest file:
// {
// "program": {
// "x86-32": {"url": "myprogram_x86-32.nexe"},
@@ -75,7 +77,7 @@ const char* const kOptLevelKey = "-O";
// "portable": {
// "pnacl-translate": {
// "url": "myprogram.pexe",
-// "-O": 0
+// "optlevel": 0
// }
// }
// },
@@ -211,6 +213,14 @@ bool IsValidUrlSpec(const Json::Value& url_spec,
*error_string = error_stream.str();
return false;
}
+ if (url_spec.isMember(kOptLevelKeyDeprecated)) {
+ nacl::stringstream error_stream;
+ error_stream << parent_key << " property '" << container_key <<
+ "' has deprecated key '" << kOptLevelKeyDeprecated <<
+ "' please use '" << kOptLevelKey << "' instead.";
+ *error_string = error_stream.str();
+ return false;
+ }
return true;
}
@@ -363,11 +373,9 @@ void GrabUrlAndPnaclOptions(const Json::Value& url_spec,
PnaclOptions* pnacl_options) {
*url = url_spec[kUrlKey].asString();
if (url_spec.isMember(kOptLevelKey)) {
- uint32_t opt_raw = url_spec[kOptLevelKey].asUInt();
- // Clamp the opt value to fit into an int8_t.
- if (opt_raw > 3)
- opt_raw = 3;
- pnacl_options->set_opt_level(static_cast<int8_t>(opt_raw));
+ int32_t opt_raw = url_spec[kOptLevelKey].asInt();
+ // set_opt_level will normalize the values.
+ pnacl_options->set_opt_level(opt_raw);
}
}
diff --git a/ppapi/native_client/src/trusted/plugin/json_manifest.h b/ppapi/native_client/src/trusted/plugin/json_manifest.h
index 102d055f3f..24dd28a163 100644
--- a/ppapi/native_client/src/trusted/plugin/json_manifest.h
+++ b/ppapi/native_client/src/trusted/plugin/json_manifest.h
@@ -15,7 +15,7 @@
#include "native_client/src/include/nacl_macros.h"
#include "native_client/src/include/nacl_string.h"
-#include "native_client/src/trusted/plugin/manifest.h"
+#include "ppapi/native_client/src/trusted/plugin/manifest.h"
#include "third_party/jsoncpp/source/include/json/value.h"
namespace pp {
diff --git a/ppapi/native_client/src/trusted/plugin/local_temp_file.cc b/ppapi/native_client/src/trusted/plugin/local_temp_file.cc
index d9f911c774..bee15eeafb 100644
--- a/ppapi/native_client/src/trusted/plugin/local_temp_file.cc
+++ b/ppapi/native_client/src/trusted/plugin/local_temp_file.cc
@@ -2,18 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "native_client/src/trusted/plugin/local_temp_file.h"
+#include "ppapi/native_client/src/trusted/plugin/local_temp_file.h"
#include "native_client/src/include/portability_io.h"
#include "native_client/src/shared/platform/nacl_check.h"
-#include "native_client/src/trusted/plugin/plugin.h"
-#include "native_client/src/trusted/plugin/utility.h"
#include "ppapi/c/ppb_file_io.h"
#include "ppapi/cpp/file_io.h"
#include "ppapi/cpp/file_ref.h"
#include "ppapi/cpp/file_system.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin.h"
+#include "ppapi/native_client/src/trusted/plugin/utility.h"
+
//////////////////////////////////////////////////////////////////////
// Local temporary file access.
//////////////////////////////////////////////////////////////////////
diff --git a/ppapi/native_client/src/trusted/plugin/module_ppapi.cc b/ppapi/native_client/src/trusted/plugin/module_ppapi.cc
index e1a5782455..7f26587629 100644
--- a/ppapi/native_client/src/trusted/plugin/module_ppapi.cc
+++ b/ppapi/native_client/src/trusted/plugin/module_ppapi.cc
@@ -7,12 +7,13 @@
#include "native_client/src/shared/imc/nacl_imc_c.h"
#include "native_client/src/shared/platform/nacl_time.h"
#include "native_client/src/trusted/desc/nrd_all_modules.h"
-#include "native_client/src/trusted/plugin/nacl_entry_points.h"
-#include "native_client/src/trusted/plugin/plugin.h"
#include "ppapi/c/private/ppb_nacl_private.h"
#include "ppapi/cpp/module.h"
+#include "ppapi/native_client/src/trusted/plugin/nacl_entry_points.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin.h"
+
namespace plugin {
class ModulePpapi : public pp::Module {
diff --git a/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h b/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h
index 6079820c70..33e4f774ed 100644
--- a/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h
+++ b/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h
@@ -24,7 +24,8 @@ typedef PP_NaClResult (*LaunchNaClProcessFunc)(
PP_Bool enable_ppapi_dev,
PP_Bool enable_dyncode_syscalls,
PP_Bool enable_exception_handling,
- NaClHandle* result_socket);
+ NaClHandle* result_socket,
+ struct PP_Var* error_message);
extern LaunchNaClProcessFunc launch_nacl_process;
diff --git a/ppapi/native_client/src/trusted/plugin/nacl_http_response_headers.cc b/ppapi/native_client/src/trusted/plugin/nacl_http_response_headers.cc
index bad629aa0d..16fa18fba2 100644
--- a/ppapi/native_client/src/trusted/plugin/nacl_http_response_headers.cc
+++ b/ppapi/native_client/src/trusted/plugin/nacl_http_response_headers.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "native_client/src/trusted/plugin/nacl_http_response_headers.h"
+#include "ppapi/native_client/src/trusted/plugin/nacl_http_response_headers.h"
#include <algorithm>
#include <sstream>
diff --git a/ppapi/native_client/src/trusted/plugin/nacl_http_response_headers_unittest.cc b/ppapi/native_client/src/trusted/plugin/nacl_http_response_headers_unittest.cc
index 12d1f12755..ea66f4614a 100644
--- a/ppapi/native_client/src/trusted/plugin/nacl_http_response_headers_unittest.cc
+++ b/ppapi/native_client/src/trusted/plugin/nacl_http_response_headers_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "native_client/src/trusted/plugin/nacl_http_response_headers.h"
+#include "ppapi/native_client/src/trusted/plugin/nacl_http_response_headers.h"
#include <string>
diff --git a/ppapi/native_client/src/trusted/plugin/nacl_subprocess.cc b/ppapi/native_client/src/trusted/plugin/nacl_subprocess.cc
index 4b4c066ca2..275104f6dd 100644
--- a/ppapi/native_client/src/trusted/plugin/nacl_subprocess.cc
+++ b/ppapi/native_client/src/trusted/plugin/nacl_subprocess.cc
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "native_client/src/trusted/plugin/nacl_subprocess.h"
+#include "ppapi/native_client/src/trusted/plugin/nacl_subprocess.h"
#include <stdarg.h>
#include "native_client/src/shared/srpc/nacl_srpc.h"
-#include "native_client/src/trusted/plugin/plugin_error.h"
-#include "native_client/src/trusted/plugin/srpc_params.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin_error.h"
+#include "ppapi/native_client/src/trusted/plugin/srpc_params.h"
namespace plugin {
diff --git a/ppapi/native_client/src/trusted/plugin/nacl_subprocess.h b/ppapi/native_client/src/trusted/plugin/nacl_subprocess.h
index 22676d12b5..a5380375ff 100644
--- a/ppapi/native_client/src/trusted/plugin/nacl_subprocess.h
+++ b/ppapi/native_client/src/trusted/plugin/nacl_subprocess.h
@@ -17,8 +17,8 @@
#include "native_client/src/include/nacl_string.h"
#include "native_client/src/include/portability.h"
-#include "native_client/src/trusted/plugin/service_runtime.h"
-#include "native_client/src/trusted/plugin/srpc_client.h"
+#include "ppapi/native_client/src/trusted/plugin/service_runtime.h"
+#include "ppapi/native_client/src/trusted/plugin/srpc_client.h"
namespace plugin {
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc
index 21389137a0..09a07244cc 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.cc
+++ b/ppapi/native_client/src/trusted/plugin/plugin.cc
@@ -7,7 +7,7 @@
#pragma warning(disable : 4996)
#endif
-#include "native_client/src/trusted/plugin/plugin.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin.h"
#include <sys/stat.h>
#include <sys/types.h>
@@ -27,15 +27,6 @@
#include "native_client/src/shared/platform/nacl_check.h"
#include "native_client/src/trusted/desc/nacl_desc_wrapper.h"
#include "native_client/src/trusted/nonnacl_util/sel_ldr_launcher.h"
-#include "native_client/src/trusted/plugin/file_utils.h"
-#include "native_client/src/trusted/plugin/json_manifest.h"
-#include "native_client/src/trusted/plugin/nacl_entry_points.h"
-#include "native_client/src/trusted/plugin/nacl_subprocess.h"
-#include "native_client/src/trusted/plugin/nexe_arch.h"
-#include "native_client/src/trusted/plugin/plugin_error.h"
-#include "native_client/src/trusted/plugin/scriptable_plugin.h"
-#include "native_client/src/trusted/plugin/service_runtime.h"
-#include "native_client/src/trusted/plugin/utility.h"
#include "native_client/src/trusted/service_runtime/nacl_error_code.h"
#include "ppapi/c/dev/ppp_find_dev.h"
@@ -62,6 +53,16 @@
#include "ppapi/cpp/mouse_lock.h"
#include "ppapi/cpp/rect.h"
+#include "ppapi/native_client/src/trusted/plugin/file_utils.h"
+#include "ppapi/native_client/src/trusted/plugin/json_manifest.h"
+#include "ppapi/native_client/src/trusted/plugin/nacl_entry_points.h"
+#include "ppapi/native_client/src/trusted/plugin/nacl_subprocess.h"
+#include "ppapi/native_client/src/trusted/plugin/nexe_arch.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin_error.h"
+#include "ppapi/native_client/src/trusted/plugin/scriptable_plugin.h"
+#include "ppapi/native_client/src/trusted/plugin/service_runtime.h"
+#include "ppapi/native_client/src/trusted/plugin/utility.h"
+
namespace plugin {
namespace {
@@ -1414,7 +1415,8 @@ void Plugin::ReportLoadError(const ErrorInfo& error_info) {
nacl::string message = nacl::string("NaCl module load failed: ") +
error_info.message();
set_last_error_string(message);
- AddToConsole(message);
+ AddToConsole(nacl::string("NaCl module load failed: ") +
+ error_info.console_message());
// Inform JavaScript that loading encountered an error and is complete.
EnqueueProgressEvent(kProgressEventError);
EnqueueProgressEvent(kProgressEventLoadEnd);
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.gyp b/ppapi/native_client/src/trusted/plugin/plugin.gyp
index 2fb4018370..c932c2c40d 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.gyp
+++ b/ppapi/native_client/src/trusted/plugin/plugin.gyp
@@ -11,9 +11,6 @@
'variables': {
'target_base': 'none',
},
- 'include_dirs': [
- '<(DEPTH)/ppapi',
- ],
'target_conditions': [
['target_base=="ppNaClPlugin"', {
'sources': [
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.h b/ppapi/native_client/src/trusted/plugin/plugin.h
index e157dbac59..1e9e78003f 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.h
+++ b/ppapi/native_client/src/trusted/plugin/plugin.h
@@ -19,11 +19,6 @@
#include "native_client/src/include/nacl_macros.h"
#include "native_client/src/include/nacl_scoped_ptr.h"
#include "native_client/src/include/nacl_string.h"
-#include "native_client/src/trusted/plugin/file_downloader.h"
-#include "native_client/src/trusted/plugin/nacl_subprocess.h"
-#include "native_client/src/trusted/plugin/pnacl_coordinator.h"
-#include "native_client/src/trusted/plugin/service_runtime.h"
-#include "native_client/src/trusted/plugin/utility.h"
#include "native_client/src/trusted/validator/nacl_file_info.h"
#include "ppapi/c/private/ppb_nacl_private.h"
@@ -35,6 +30,12 @@
#include "ppapi/cpp/var.h"
#include "ppapi/cpp/view.h"
+#include "ppapi/native_client/src/trusted/plugin/file_downloader.h"
+#include "ppapi/native_client/src/trusted/plugin/nacl_subprocess.h"
+#include "ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h"
+#include "ppapi/native_client/src/trusted/plugin/service_runtime.h"
+#include "ppapi/native_client/src/trusted/plugin/utility.h"
+
struct NaClSrpcChannel;
namespace nacl {
diff --git a/ppapi/native_client/src/trusted/plugin/plugin_error.h b/ppapi/native_client/src/trusted/plugin/plugin_error.h
index f02ef837e5..9da77cab20 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin_error.h
+++ b/ppapi/native_client/src/trusted/plugin/plugin_error.h
@@ -115,6 +115,20 @@ class ErrorInfo {
void SetReport(PluginErrorCode error_code, const std::string& message) {
error_code_ = error_code;
message_ = message;
+ console_message_ = message;
+ }
+
+ // console_message is a part of the error that is logged to
+ // the JavaScript console but is not reported to JavaScript via
+ // the lastError property. This is used to report internal errors which
+ // may easily change in new versions of the browser and we don't want apps
+ // to come to depend on the details of these errors.
+ void SetReportWithConsoleOnlyError(PluginErrorCode error_code,
+ const std::string& message,
+ const std::string& console_message) {
+ error_code_ = error_code;
+ message_ = message;
+ console_message_ = message + "; " + console_message;
}
PluginErrorCode error_code() const {
@@ -123,15 +137,21 @@ class ErrorInfo {
void PrependMessage(const std::string& prefix) {
message_ = prefix + message_;
+ console_message_ = prefix + console_message_;
}
const std::string& message() const {
return message_;
}
+ const std::string& console_message() const {
+ return console_message_;
+ }
+
private:
PluginErrorCode error_code_;
std::string message_;
+ std::string console_message_;
NACL_DISALLOW_COPY_AND_ASSIGN(ErrorInfo);
};
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc
index 3f4cfab7eb..f446961088 100644
--- a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "native_client/src/trusted/plugin/pnacl_coordinator.h"
+#include "ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h"
#include <utility>
#include <vector>
@@ -10,14 +10,6 @@
#include "native_client/src/include/checked_cast.h"
#include "native_client/src/include/portability_io.h"
#include "native_client/src/shared/platform/nacl_check.h"
-#include "native_client/src/trusted/plugin/local_temp_file.h"
-#include "native_client/src/trusted/plugin/manifest.h"
-#include "native_client/src/trusted/plugin/nacl_http_response_headers.h"
-#include "native_client/src/trusted/plugin/plugin.h"
-#include "native_client/src/trusted/plugin/plugin_error.h"
-#include "native_client/src/trusted/plugin/pnacl_translate_thread.h"
-#include "native_client/src/trusted/plugin/service_runtime.h"
-#include "native_client/src/trusted/plugin/temporary_file.h"
#include "native_client/src/trusted/service_runtime/include/sys/stat.h"
#include "ppapi/c/pp_bool.h"
@@ -26,6 +18,15 @@
#include "ppapi/c/private/ppb_uma_private.h"
#include "ppapi/cpp/file_io.h"
+#include "ppapi/native_client/src/trusted/plugin/local_temp_file.h"
+#include "ppapi/native_client/src/trusted/plugin/manifest.h"
+#include "ppapi/native_client/src/trusted/plugin/nacl_http_response_headers.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin_error.h"
+#include "ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h"
+#include "ppapi/native_client/src/trusted/plugin/service_runtime.h"
+#include "ppapi/native_client/src/trusted/plugin/temporary_file.h"
+
namespace {
const char kPnaclTempDir[] = "/.pnacl";
const uint32_t kCopyBufSize = 512 << 10;
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h
index e33f426ffb..1cd430cfc7 100644
--- a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h
@@ -12,17 +12,8 @@
#include "native_client/src/include/nacl_macros.h"
#include "native_client/src/include/nacl_string.h"
#include "native_client/src/shared/platform/nacl_sync_raii.h"
-
#include "native_client/src/shared/srpc/nacl_srpc.h"
-
#include "native_client/src/trusted/desc/nacl_desc_wrapper.h"
-#include "native_client/src/trusted/plugin/callback_source.h"
-#include "native_client/src/trusted/plugin/file_downloader.h"
-#include "native_client/src/trusted/plugin/local_temp_file.h"
-#include "native_client/src/trusted/plugin/nacl_subprocess.h"
-#include "native_client/src/trusted/plugin/plugin_error.h"
-#include "native_client/src/trusted/plugin/pnacl_options.h"
-#include "native_client/src/trusted/plugin/pnacl_resources.h"
#include "ppapi/c/pp_file_info.h"
#include "ppapi/c/trusted/ppb_file_io_trusted.h"
@@ -31,6 +22,14 @@
#include "ppapi/cpp/file_ref.h"
#include "ppapi/cpp/file_system.h"
+#include "ppapi/native_client/src/trusted/plugin/callback_source.h"
+#include "ppapi/native_client/src/trusted/plugin/file_downloader.h"
+#include "ppapi/native_client/src/trusted/plugin/local_temp_file.h"
+#include "ppapi/native_client/src/trusted/plugin/nacl_subprocess.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin_error.h"
+#include "ppapi/native_client/src/trusted/plugin/pnacl_options.h"
+#include "ppapi/native_client/src/trusted/plugin/pnacl_resources.h"
+
namespace plugin {
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_options.cc b/ppapi/native_client/src/trusted/plugin/pnacl_options.cc
index 0648b59e79..0e684bb58e 100644
--- a/ppapi/native_client/src/trusted/plugin/pnacl_options.cc
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_options.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "native_client/src/trusted/plugin/pnacl_options.h"
+#include "ppapi/native_client/src/trusted/plugin/pnacl_options.h"
#include <iterator>
#include <vector>
@@ -26,8 +26,7 @@ nacl::string ReplaceBadFSChars(nacl::string str,
namespace plugin {
-// Default to -O0 for now.
-PnaclOptions::PnaclOptions() : translate_(false), opt_level_(0) { }
+PnaclOptions::PnaclOptions() : translate_(false), opt_level_(2) { }
PnaclOptions::~PnaclOptions() {
}
@@ -51,28 +50,22 @@ nacl::string PnaclOptions::GetCacheKey() const {
return key;
}
-void PnaclOptions::set_opt_level(int8_t l) {
- if (l < 0) {
+void PnaclOptions::set_opt_level(int32_t l) {
+ if (l <= 0) {
opt_level_ = 0;
return;
}
- if (l > 3) {
- opt_level_ = 3;
- return;
- }
- opt_level_ = l;
+ // Currently only allow 0 or 2, since that is what we test.
+ opt_level_ = 2;
}
std::vector<char> PnaclOptions::GetOptCommandline() const {
std::vector<char> result;
nacl::string str;
- if (opt_level_ != -1) {
- nacl::stringstream ss;
- // Cast as int so that it doesn't think it's a char.
- ss << "-O" << static_cast<int>(opt_level_);
- str = ss.str();
- }
+ nacl::stringstream ss;
+ ss << "-O" << opt_level_;
+ str = ss.str();
std::copy(str.begin(), str.end(), std::back_inserter(result));
result.push_back('\x00');
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_options.h b/ppapi/native_client/src/trusted/plugin/pnacl_options.h
index 3845c87b9d..f998b2c46c 100644
--- a/ppapi/native_client/src/trusted/plugin/pnacl_options.h
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_options.h
@@ -29,20 +29,14 @@ class PnaclOptions {
// as well as the commandline options).
nacl::string GetCacheKey() const;
- // Return true if the manifest did not specify any special options
- // (just using the default).
- bool HasDefaultOpts() const {
- return opt_level_ == -1;
- }
-
// Return a character array of \x00 delimited commandline options.
std::vector<char> GetOptCommandline() const;
bool translate() const { return translate_; }
void set_translate(bool t) { translate_ = t; }
- uint8_t opt_level() const { return opt_level_; }
- void set_opt_level(int8_t l);
+ int32_t opt_level() const { return opt_level_; }
+ void set_opt_level(int32_t l);
void set_cache_validators(const nacl::string& c) {
cache_validators_ = c;
@@ -53,7 +47,7 @@ class PnaclOptions {
// Currently the default copy constructor is good enough, but
// double-check that it is the case when more fields are added.
bool translate_;
- int8_t opt_level_;
+ int32_t opt_level_;
nacl::string cache_validators_;
};
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_resources.cc b/ppapi/native_client/src/trusted/plugin/pnacl_resources.cc
index 4b5e4f680d..6ba90c83f1 100644
--- a/ppapi/native_client/src/trusted/plugin/pnacl_resources.cc
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_resources.cc
@@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "native_client/src/trusted/plugin/pnacl_resources.h"
+#include "ppapi/native_client/src/trusted/plugin/pnacl_resources.h"
#include "native_client/src/include/portability_io.h"
#include "native_client/src/shared/platform/nacl_check.h"
#include "native_client/src/trusted/desc/nacl_desc_wrapper.h"
-#include "native_client/src/trusted/plugin/file_utils.h"
-#include "native_client/src/trusted/plugin/manifest.h"
-#include "native_client/src/trusted/plugin/plugin.h"
-#include "native_client/src/trusted/plugin/pnacl_coordinator.h"
-#include "native_client/src/trusted/plugin/utility.h"
#include "ppapi/c/pp_errors.h"
+#include "ppapi/native_client/src/trusted/plugin/file_utils.h"
+#include "ppapi/native_client/src/trusted/plugin/manifest.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin.h"
+#include "ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h"
+#include "ppapi/native_client/src/trusted/plugin/utility.h"
#include "third_party/jsoncpp/source/include/json/reader.h"
#include "third_party/jsoncpp/source/include/json/value.h"
@@ -21,9 +21,6 @@ namespace plugin {
static const char kPnaclComponentScheme[] = "pnacl-component://";
const char PnaclUrls::kResourceInfoUrl[] = "pnacl.json";
-const char PnaclResources::kDefaultLlcName[] = "llc.nexe";
-const char PnaclResources::kDefaultLdName[] = "ld.nexe";
-
nacl::string PnaclUrls::GetBaseUrl() {
return nacl::string(kPnaclComponentScheme);
}
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_resources.h b/ppapi/native_client/src/trusted/plugin/pnacl_resources.h
index 10dbd35428..f514b687e0 100644
--- a/ppapi/native_client/src/trusted/plugin/pnacl_resources.h
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_resources.h
@@ -11,12 +11,13 @@
#include "native_client/src/include/nacl_macros.h"
#include "native_client/src/include/nacl_string.h"
#include "native_client/src/trusted/desc/nacl_desc_wrapper.h"
-#include "native_client/src/trusted/plugin/nexe_arch.h"
-#include "native_client/src/trusted/plugin/plugin_error.h"
#include "ppapi/c/private/pp_file_handle.h"
#include "ppapi/cpp/completion_callback.h"
+#include "ppapi/native_client/src/trusted/plugin/nexe_arch.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin_error.h"
+
namespace plugin {
class Manifest;
@@ -55,9 +56,7 @@ class PnaclResources {
const Manifest* manifest)
: plugin_(plugin),
coordinator_(coordinator),
- manifest_(manifest),
- llc_tool_name(kDefaultLlcName),
- ld_tool_name(kDefaultLdName) {
+ manifest_(manifest) {
}
virtual ~PnaclResources();
@@ -98,13 +97,6 @@ class PnaclResources {
// once all_loaded_callback_ has been invoked.
std::map<nacl::string, nacl::DescWrapper*> resource_wrappers_;
- // The names of the llc and ld nexes are read from the resource info file.
- // These are default values if the resource file does not contain the names.
- // TODO(eliben): this should be eventually removed, once all nacl deps
- // propagate - the names should always exist in the resource info JSON file.
- static const char kDefaultLlcName[];
- static const char kDefaultLdName[];
-
// Tool names for llc and ld; read from the resource info file.
nacl::string llc_tool_name;
nacl::string ld_tool_name;
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc b/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc
index 9dd26734e1..2df745721c 100644
--- a/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc
@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "native_client/src/trusted/plugin/pnacl_translate_thread.h"
+#include "ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h"
#include "native_client/src/trusted/desc/nacl_desc_wrapper.h"
-#include "native_client/src/trusted/plugin/plugin.h"
-#include "native_client/src/trusted/plugin/plugin_error.h"
-#include "native_client/src/trusted/plugin/pnacl_resources.h"
-#include "native_client/src/trusted/plugin/srpc_params.h"
-#include "native_client/src/trusted/plugin/temporary_file.h"
-#include "native_client/src/trusted/plugin/utility.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin_error.h"
+#include "ppapi/native_client/src/trusted/plugin/pnacl_resources.h"
+#include "ppapi/native_client/src/trusted/plugin/srpc_params.h"
+#include "ppapi/native_client/src/trusted/plugin/temporary_file.h"
+#include "ppapi/native_client/src/trusted/plugin/utility.h"
namespace plugin {
@@ -153,22 +153,14 @@ void PnaclTranslateThread::DoTranslate() {
int64_t compile_start_time = NaClGetTimeOfDayMicroseconds();
bool init_success;
- if (pnacl_options_->HasDefaultOpts()) {
- PLUGIN_PRINTF(("PnaclCoordinator: StreamInit with default options\n"));
- init_success = llc_subprocess_->InvokeSrpcMethod("StreamInit",
- "h",
- &params,
- llc_out_file->desc());
- } else {
- std::vector<char> options = pnacl_options_->GetOptCommandline();
- init_success = llc_subprocess_->InvokeSrpcMethod(
- "StreamInitWithOverrides",
- "hC",
- &params,
- llc_out_file->desc(),
- &options[0],
- options.size());
- }
+ std::vector<char> options = pnacl_options_->GetOptCommandline();
+ init_success = llc_subprocess_->InvokeSrpcMethod(
+ "StreamInitWithOverrides",
+ "hC",
+ &params,
+ llc_out_file->desc(),
+ &options[0],
+ options.size());
if (!init_success) {
if (llc_subprocess_->srpc_client()->GetLastError() ==
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h b/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h
index 117ee381be..31981ebdec 100644
--- a/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h
@@ -13,11 +13,12 @@
#include "native_client/src/include/nacl_string.h"
#include "native_client/src/shared/platform/nacl_threads.h"
#include "native_client/src/shared/platform/nacl_sync_checked.h"
-#include "native_client/src/trusted/plugin/plugin_error.h"
-#include "native_client/src/trusted/plugin/service_runtime.h"
#include "ppapi/cpp/completion_callback.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin_error.h"
+#include "ppapi/native_client/src/trusted/plugin/service_runtime.h"
+
namespace nacl {
class DescWrapper;
}
diff --git a/ppapi/native_client/src/trusted/plugin/scriptable_plugin.cc b/ppapi/native_client/src/trusted/plugin/scriptable_plugin.cc
index ca2233a7fd..99144b53fa 100644
--- a/ppapi/native_client/src/trusted/plugin/scriptable_plugin.cc
+++ b/ppapi/native_client/src/trusted/plugin/scriptable_plugin.cc
@@ -4,7 +4,7 @@
// Scriptable plugin implementation.
-#include "native_client/src/trusted/plugin/scriptable_plugin.h"
+#include "ppapi/native_client/src/trusted/plugin/scriptable_plugin.h"
#include <string.h>
@@ -17,8 +17,8 @@
#include "native_client/src/include/portability.h"
#include "native_client/src/shared/platform/nacl_check.h"
#include "native_client/src/shared/srpc/nacl_srpc.h"
-#include "native_client/src/trusted/plugin/plugin.h"
-#include "native_client/src/trusted/plugin/utility.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin.h"
+#include "ppapi/native_client/src/trusted/plugin/utility.h"
namespace plugin {
diff --git a/ppapi/native_client/src/trusted/plugin/scriptable_plugin.h b/ppapi/native_client/src/trusted/plugin/scriptable_plugin.h
index a02734407d..d9b000dd1b 100644
--- a/ppapi/native_client/src/trusted/plugin/scriptable_plugin.h
+++ b/ppapi/native_client/src/trusted/plugin/scriptable_plugin.h
@@ -12,9 +12,9 @@
#include "native_client/src/include/nacl_macros.h"
#include "native_client/src/include/portability.h"
-#include "native_client/src/trusted/plugin/utility.h"
#include "ppapi/cpp/dev/scriptable_object_deprecated.h"
#include "ppapi/cpp/private/var_private.h"
+#include "ppapi/native_client/src/trusted/plugin/utility.h"
namespace plugin {
diff --git a/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc b/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc
index 47187d92fd..bd68de5cec 100644
--- a/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc
+++ b/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc
@@ -3,9 +3,10 @@
// found in the LICENSE file.
#include "native_client/src/include/nacl_macros.h"
-#include "native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h"
+#include "ppapi/native_client/src/trusted/plugin/nacl_entry_points.h"
+#include "ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h"
-#include "native_client/src/trusted/plugin/nacl_entry_points.h"
+#include "ppapi/cpp/var.h"
LaunchNaClProcessFunc launch_nacl_process = NULL;
@@ -22,9 +23,12 @@ bool SelLdrLauncherChrome::Start(PP_Instance instance,
bool uses_ppapi,
bool enable_ppapi_dev,
bool enable_dyncode_syscalls,
- bool enable_exception_handling) {
+ bool enable_exception_handling,
+ nacl::string* error_message) {
+ *error_message = "";
if (!launch_nacl_process)
return false;
+ PP_Var var_error_message;
// send a synchronous message to the browser process
if (launch_nacl_process(instance,
url,
@@ -33,7 +37,12 @@ bool SelLdrLauncherChrome::Start(PP_Instance instance,
PP_FromBool(enable_ppapi_dev),
PP_FromBool(enable_dyncode_syscalls),
PP_FromBool(enable_exception_handling),
- &channel_) != PP_NACL_OK) {
+ &channel_,
+ &var_error_message) != PP_NACL_OK) {
+ pp::Var var_error_message_cpp(pp::PASS_REF, var_error_message);
+ if (var_error_message_cpp.is_string()) {
+ *error_message = var_error_message_cpp.AsString();
+ }
return false;
}
return true;
diff --git a/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h b/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h
index 6861622369..a64c66b46b 100644
--- a/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h
+++ b/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h
@@ -19,7 +19,8 @@ class SelLdrLauncherChrome : public nacl::SelLdrLauncherBase {
bool uses_ppapi,
bool enable_ppapi_dev,
bool enable_dyncode_syscalls,
- bool enable_exception_handling);
+ bool enable_exception_handling,
+ nacl::string* error_message);
};
} // namespace plugin
diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.cc b/ppapi/native_client/src/trusted/plugin/service_runtime.cc
index f13b3217f9..f908f8bdbf 100644
--- a/ppapi/native_client/src/trusted/plugin/service_runtime.cc
+++ b/ppapi/native_client/src/trusted/plugin/service_runtime.cc
@@ -6,7 +6,7 @@
#define NACL_LOG_MODULE_NAME "Plugin::ServiceRuntime"
-#include "native_client/src/trusted/plugin/service_runtime.h"
+#include "ppapi/native_client/src/trusted/plugin/service_runtime.h"
#include <string.h>
#include <set>
@@ -32,7 +32,6 @@
#include "native_client/src/trusted/desc/nacl_desc_io.h"
#include "native_client/src/trusted/desc/nrd_xfer.h"
#include "native_client/src/trusted/nonnacl_util/sel_ldr_launcher.h"
-#include "native_client/src/trusted/plugin/manifest.h"
// This is here due to a Windows API collision; plugin.h through
// file_downloader.h transitively includes Instance.h which defines a
@@ -41,15 +40,8 @@
#undef PostMessage
#endif
#include "native_client/src/public/imc_types.h"
-#include "native_client/src/trusted/plugin/plugin.h"
-#include "native_client/src/trusted/plugin/plugin_error.h"
-#include "native_client/src/trusted/plugin/pnacl_coordinator.h"
-#include "native_client/src/trusted/plugin/pnacl_resources.h"
-#include "native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h"
-#include "native_client/src/trusted/plugin/srpc_client.h"
#include "native_client/src/trusted/service_runtime/nacl_error_code.h"
#include "native_client/src/trusted/validator/nacl_file_info.h"
-#include "native_client/src/trusted/weak_ref/call_on_main_thread.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/trusted/ppb_file_io_trusted.h"
@@ -57,6 +49,15 @@
#include "ppapi/cpp/completion_callback.h"
#include "ppapi/cpp/file_io.h"
+#include "ppapi/native_client/src/trusted/plugin/manifest.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin_error.h"
+#include "ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h"
+#include "ppapi/native_client/src/trusted/plugin/pnacl_resources.h"
+#include "ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h"
+#include "ppapi/native_client/src/trusted/plugin/srpc_client.h"
+#include "ppapi/native_client/src/trusted/weak_ref/call_on_main_thread.h"
+
namespace {
// For doing crude quota enforcement on writes to temp files.
@@ -727,17 +728,21 @@ bool ServiceRuntime::StartSelLdr(const SelLdrStartParams& params) {
"ServiceRuntime: failed to create sel_ldr launcher");
return false;
}
+ nacl::string error_message;
bool started = tmp_subprocess->Start(plugin_->pp_instance(),
params.url.c_str(),
params.uses_irt,
params.uses_ppapi,
params.enable_dev_interfaces,
params.enable_dyncode_syscalls,
- params.enable_exception_handling);
+ params.enable_exception_handling,
+ &error_message);
if (!started) {
NaClLog(LOG_ERROR, "ServiceRuntime::Start (start failed)\n");
- params.error_info->SetReport(ERROR_SEL_LDR_LAUNCH,
- "ServiceRuntime: failed to start");
+ params.error_info->SetReportWithConsoleOnlyError(
+ ERROR_SEL_LDR_LAUNCH,
+ "ServiceRuntime: failed to start",
+ error_message);
return false;
}
diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.h b/ppapi/native_client/src/trusted/plugin/service_runtime.h
index de505a42e7..ee97710047 100644
--- a/ppapi/native_client/src/trusted/plugin/service_runtime.h
+++ b/ppapi/native_client/src/trusted/plugin/service_runtime.h
@@ -20,13 +20,14 @@
#include "native_client/src/shared/srpc/nacl_srpc.h"
#include "native_client/src/trusted/desc/nacl_desc_wrapper.h"
#include "native_client/src/trusted/nonnacl_util/sel_ldr_launcher.h"
-#include "native_client/src/trusted/plugin/utility.h"
#include "native_client/src/trusted/reverse_service/reverse_service.h"
#include "native_client/src/trusted/weak_ref/weak_ref.h"
#include "ppapi/c/trusted/ppb_file_io_trusted.h"
#include "ppapi/cpp/completion_callback.h"
+#include "ppapi/native_client/src/trusted/plugin/utility.h"
+
struct NaClFileInfo;
namespace nacl {
diff --git a/ppapi/native_client/src/trusted/plugin/srpc_client.cc b/ppapi/native_client/src/trusted/plugin/srpc_client.cc
index e22ed34c0f..94bb910e91 100644
--- a/ppapi/native_client/src/trusted/plugin/srpc_client.cc
+++ b/ppapi/native_client/src/trusted/plugin/srpc_client.cc
@@ -4,14 +4,14 @@
* found in the LICENSE file.
*/
-#include "native_client/src/trusted/plugin/srpc_client.h"
+#include "ppapi/native_client/src/trusted/plugin/srpc_client.h"
#include <string.h>
#include "native_client/src/shared/platform/nacl_log.h"
-#include "native_client/src/trusted/plugin/plugin.h"
-#include "native_client/src/trusted/plugin/srpc_params.h"
-#include "native_client/src/trusted/plugin/utility.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin.h"
+#include "ppapi/native_client/src/trusted/plugin/srpc_params.h"
+#include "ppapi/native_client/src/trusted/plugin/utility.h"
namespace plugin {
diff --git a/ppapi/native_client/src/trusted/plugin/srpc_client.h b/ppapi/native_client/src/trusted/plugin/srpc_client.h
index 34b2b0de1d..02fe1da5e1 100644
--- a/ppapi/native_client/src/trusted/plugin/srpc_client.h
+++ b/ppapi/native_client/src/trusted/plugin/srpc_client.h
@@ -13,8 +13,8 @@
#include <map>
#include "native_client/src/include/nacl_macros.h"
#include "native_client/src/include/nacl_string.h"
-#include "native_client/src/trusted/plugin/utility.h"
#include "native_client/src/shared/srpc/nacl_srpc.h"
+#include "ppapi/native_client/src/trusted/plugin/utility.h"
namespace nacl {
class DescWrapper;
diff --git a/ppapi/native_client/src/trusted/plugin/srpc_params.cc b/ppapi/native_client/src/trusted/plugin/srpc_params.cc
index de484fb1eb..593fe94dc8 100644
--- a/ppapi/native_client/src/trusted/plugin/srpc_params.cc
+++ b/ppapi/native_client/src/trusted/plugin/srpc_params.cc
@@ -5,7 +5,7 @@
*/
-#include "native_client/src/trusted/plugin/srpc_params.h"
+#include "ppapi/native_client/src/trusted/plugin/srpc_params.h"
#include <stdlib.h>
diff --git a/ppapi/native_client/src/trusted/plugin/temporary_file.cc b/ppapi/native_client/src/trusted/plugin/temporary_file.cc
index 321616c416..ac02db2f75 100644
--- a/ppapi/native_client/src/trusted/plugin/temporary_file.cc
+++ b/ppapi/native_client/src/trusted/plugin/temporary_file.cc
@@ -2,12 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "native_client/src/trusted/plugin/temporary_file.h"
+#include "ppapi/native_client/src/trusted/plugin/temporary_file.h"
#include "native_client/src/include/portability_io.h"
#include "native_client/src/shared/platform/nacl_check.h"
-#include "native_client/src/trusted/plugin/plugin.h"
-#include "native_client/src/trusted/plugin/utility.h"
#include "native_client/src/trusted/service_runtime/include/sys/stat.h"
#include "ppapi/cpp/core.h"
@@ -15,6 +13,9 @@
#include "ppapi/cpp/module.h"
#include "ppapi/c/private/pp_file_handle.h"
+#include "ppapi/native_client/src/trusted/plugin/plugin.h"
+#include "ppapi/native_client/src/trusted/plugin/utility.h"
+
//////////////////////////////////////////////////////////////////////
// Temporary file access.
diff --git a/ppapi/native_client/src/trusted/plugin/utility.cc b/ppapi/native_client/src/trusted/plugin/utility.cc
index d504a1d8ac..1458e185ce 100644
--- a/ppapi/native_client/src/trusted/plugin/utility.cc
+++ b/ppapi/native_client/src/trusted/plugin/utility.cc
@@ -8,7 +8,7 @@
#include <stdlib.h>
#include <string.h>
-#include "native_client/src/trusted/plugin/utility.h"
+#include "ppapi/native_client/src/trusted/plugin/utility.h"
namespace plugin {
diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
index 8dd5c63f8f..ec358bf053 100644
--- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
+++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
@@ -2743,9 +2743,9 @@ static void Pnacl_M13_PPB_Instance_Private_ExecuteScript(struct PP_Var* _struct_
/* Begin wrapper methods for PPB_NaCl_Private_1_0 */
-static PP_NaClResult Pnacl_M13_PPB_NaCl_Private_LaunchSelLdr(PP_Instance instance, const char* alleged_url, PP_Bool uses_irt, PP_Bool uses_ppapi, PP_Bool enable_ppapi_dev, PP_Bool enable_dyncode_syscalls, PP_Bool enable_exception_handling, void* imc_handle) {
+static PP_NaClResult Pnacl_M13_PPB_NaCl_Private_LaunchSelLdr(PP_Instance instance, const char* alleged_url, PP_Bool uses_irt, PP_Bool uses_ppapi, PP_Bool enable_ppapi_dev, PP_Bool enable_dyncode_syscalls, PP_Bool enable_exception_handling, void* imc_handle, struct PP_Var* error_message) {
const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface;
- return iface->LaunchSelLdr(instance, alleged_url, uses_irt, uses_ppapi, enable_ppapi_dev, enable_dyncode_syscalls, enable_exception_handling, imc_handle);
+ return iface->LaunchSelLdr(instance, alleged_url, uses_irt, uses_ppapi, enable_ppapi_dev, enable_dyncode_syscalls, enable_exception_handling, imc_handle, error_message);
}
static PP_NaClResult Pnacl_M13_PPB_NaCl_Private_StartPpapiProxy(PP_Instance instance) {
@@ -4567,7 +4567,7 @@ struct PPB_Instance_Private_0_1 Pnacl_Wrappers_PPB_Instance_Private_0_1 = {
};
struct PPB_NaCl_Private_1_0 Pnacl_Wrappers_PPB_NaCl_Private_1_0 = {
- .LaunchSelLdr = (PP_NaClResult (*)(PP_Instance instance, const char* alleged_url, PP_Bool uses_irt, PP_Bool uses_ppapi, PP_Bool enable_ppapi_dev, PP_Bool enable_dyncode_syscalls, PP_Bool enable_exception_handling, void* imc_handle))&Pnacl_M13_PPB_NaCl_Private_LaunchSelLdr,
+ .LaunchSelLdr = (PP_NaClResult (*)(PP_Instance instance, const char* alleged_url, PP_Bool uses_irt, PP_Bool uses_ppapi, PP_Bool enable_ppapi_dev, PP_Bool enable_dyncode_syscalls, PP_Bool enable_exception_handling, void* imc_handle, struct PP_Var* error_message))&Pnacl_M13_PPB_NaCl_Private_LaunchSelLdr,
.StartPpapiProxy = (PP_NaClResult (*)(PP_Instance instance))&Pnacl_M13_PPB_NaCl_Private_StartPpapiProxy,
.UrandomFD = (int32_t (*)(void))&Pnacl_M13_PPB_NaCl_Private_UrandomFD,
.Are3DInterfacesDisabled = (PP_Bool (*)(void))&Pnacl_M13_PPB_NaCl_Private_Are3DInterfacesDisabled,
diff --git a/ppapi/proxy/browser_font_resource_trusted.cc b/ppapi/proxy/browser_font_resource_trusted.cc
index 33b858e847..b8bc8759d4 100644
--- a/ppapi/proxy/browser_font_resource_trusted.cc
+++ b/ppapi/proxy/browser_font_resource_trusted.cc
@@ -20,7 +20,7 @@
#include "third_party/WebKit/public/web/WebFont.h"
#include "third_party/WebKit/public/web/WebFontDescription.h"
#include "third_party/WebKit/public/web/WebTextRun.h"
-#include "third_party/icu/public/common/unicode/ubidi.h"
+#include "third_party/icu/source/common/unicode/ubidi.h"
#include "third_party/skia/include/core/SkRect.h"
using ppapi::StringVar;
diff --git a/ppapi/proxy/pdf_resource.cc b/ppapi/proxy/pdf_resource.cc
index 122b88c662..8e0a2e0bbf 100644
--- a/ppapi/proxy/pdf_resource.cc
+++ b/ppapi/proxy/pdf_resource.cc
@@ -14,7 +14,7 @@
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/proxy/ppb_image_data_proxy.h"
#include "ppapi/shared_impl/var.h"
-#include "third_party/icu/public/i18n/unicode/usearch.h"
+#include "third_party/icu/source/i18n/unicode/usearch.h"
namespace ppapi {
namespace proxy {
diff --git a/ppapi/proxy/plugin_main_nacl.cc b/ppapi/proxy/plugin_main_nacl.cc
index ab71dcfb55..f00d371bfa 100644
--- a/ppapi/proxy/plugin_main_nacl.cc
+++ b/ppapi/proxy/plugin_main_nacl.cc
@@ -246,21 +246,7 @@ void PpapiPluginRegisterThreadCreator(
ppapi::PPB_Audio_Shared::SetThreadFunctions(thread_functions);
}
-int IrtInit() {
- static int initialized = 0;
- if (initialized) {
- return 0;
- }
- if (!NaClSrpcModuleInit()) {
- return 1;
- }
- initialized = 1;
- return 0;
-}
-
int PpapiPluginMain() {
- IrtInit();
-
// Though it isn't referenced here, we must instantiate an AtExitManager.
base::AtExitManager exit_manager;
base::MessageLoop loop;
@@ -292,7 +278,5 @@ int PpapiPluginMain() {
loop.Run();
- NaClSrpcModuleFini();
-
return 0;
}
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h
index b8e7456cce..051655a430 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -1405,6 +1405,13 @@ IPC_MESSAGE_CONTROL0(PpapiPluginMsg_FileIO_RequestOSFileHandleReply)
IPC_MESSAGE_CONTROL0(PpapiPluginMsg_FileIO_GeneralReply)
// FileRef
+// Creates a FileRef to a path on an external file system. This message may
+// only be sent from the renderer.
+IPC_MESSAGE_CONTROL1(PpapiHostMsg_FileRef_CreateExternal,
+ base::FilePath /* external_path */)
+
+// Creates a FileRef to a path on an internal file system. This message may
+// be sent from the renderer or the plugin.
IPC_MESSAGE_CONTROL2(PpapiHostMsg_FileRef_CreateInternal,
PP_Resource /* file_system */,
std::string /* internal_path */)
diff --git a/ppapi/proxy/ppb_image_data_proxy.cc b/ppapi/proxy/ppb_image_data_proxy.cc
index ab61c7befb..0ed3c24a37 100644
--- a/ppapi/proxy/ppb_image_data_proxy.cc
+++ b/ppapi/proxy/ppb_image_data_proxy.cc
@@ -150,7 +150,7 @@ scoped_refptr<ImageData> ImageDataInstanceCache::Get(
for (int i = 0; i < kCacheSize; i++) {
if (!images_[i].usable)
continue;
- if (!images_[i].image->type() == type)
+ if (images_[i].image->type() != type)
continue;
const PP_ImageDataDesc& desc = images_[i].image->desc();
if (desc.format == format &&
diff --git a/ppapi/shared_impl/private/ppb_char_set_shared.cc b/ppapi/shared_impl/private/ppb_char_set_shared.cc
index 5ce51a6c8f..2fda8aac55 100644
--- a/ppapi/shared_impl/private/ppb_char_set_shared.cc
+++ b/ppapi/shared_impl/private/ppb_char_set_shared.cc
@@ -9,10 +9,10 @@
#include "base/i18n/icu_string_conversions.h"
#include "ppapi/c/dev/ppb_memory_dev.h"
#include "ppapi/thunk/thunk.h"
-#include "third_party/icu/public/common/unicode/ucnv.h"
-#include "third_party/icu/public/common/unicode/ucnv_cb.h"
-#include "third_party/icu/public/common/unicode/ucnv_err.h"
-#include "third_party/icu/public/common/unicode/ustring.h"
+#include "third_party/icu/source/common/unicode/ucnv.h"
+#include "third_party/icu/source/common/unicode/ucnv_cb.h"
+#include "third_party/icu/source/common/unicode/ucnv_err.h"
+#include "third_party/icu/source/common/unicode/ustring.h"
namespace ppapi {
diff --git a/ppapi/tests/test_instance_deprecated.cc b/ppapi/tests/test_instance_deprecated.cc
index 48e8dbb45c..b69f4276f0 100644
--- a/ppapi/tests/test_instance_deprecated.cc
+++ b/ppapi/tests/test_instance_deprecated.cc
@@ -68,7 +68,6 @@ InstanceSO::~InstanceSO() {
// TODO(dmichael): It would probably be best to make in-process consistent
// with out-of-process. That would mean that the instance
// would already be destroyed at this point.
- pp::Var exception;
pp::Var ret = test_instance_->instance()->ExecuteScript(
"document.getElementById('container').instance_object_destroyed=true;");
} else {
@@ -127,12 +126,24 @@ bool TestInstance::Init() {
}
TestInstance::~TestInstance() {
+ // Save the fact that we were destroyed in sessionStorage. This tests that
+ // we can ExecuteScript at instance destruction without crashing. It also
+ // allows us to check that ExecuteScript will run and succeed in certain
+ // cases. In particular, when the instance is destroyed by normal DOM
+ // deletion, ExecuteScript will actually work. See
+ // TestExecuteScriptInInstanceShutdown for that test. Note, however, that
+ // ExecuteScript will *not* have an effect when the instance is destroyed
+ // because the renderer was shut down.
+ pp::Var ret = instance()->ExecuteScript(
+ "sessionStorage.setItem('instance_destroyed', 'true');");
}
void TestInstance::RunTests(const std::string& filter) {
RUN_TEST(ExecuteScript, filter);
RUN_TEST(RecursiveObjects, filter);
RUN_TEST(LeakedObjectDestructors, filter);
+ RUN_TEST(SetupExecuteScriptAtInstanceShutdown, filter);
+ RUN_TEST(ExecuteScriptAtInstanceShutdown, filter);
}
void TestInstance::LeakReferenceAndIgnore(const pp::Var& leaked) {
@@ -245,3 +256,31 @@ std::string TestInstance::TestLeakedObjectDestructors() {
PASS();
}
+std::string TestInstance::TestSetupExecuteScriptAtInstanceShutdown() {
+ // This test only exists so that it can be run before
+ // TestExecuteScriptAtInstanceShutdown. See the comment for that test.
+ pp::Var exception;
+ pp::Var result = instance()->ExecuteScript(
+ "sessionStorage.removeItem('instance_destroyed');", &exception);
+ ASSERT_TRUE(exception.is_undefined());
+ ASSERT_TRUE(result.is_undefined());
+ PASS();
+}
+
+std::string TestInstance::TestExecuteScriptAtInstanceShutdown() {
+ // This test relies on the previous test being run in the same browser
+ // session, but in such a way that the instance is destroyed. See
+ // chrome/test/ppapi/ppapi_browsertest.cc for how the navigation happens.
+ //
+ // Given those constraints, ~TestInstance should have been invoked to set
+ // instance_destroyed in sessionStorage. So all we have to do is make sure
+ // that it was set as expected.
+ pp::Var result = instance()->ExecuteScript(
+ "sessionStorage.getItem('instance_destroyed');");
+ ASSERT_TRUE(result.is_string());
+ ASSERT_EQ(std::string("true"), result.AsString());
+ instance()->ExecuteScript("sessionStorage.removeItem('instance_destroyed');");
+
+ PASS();
+}
+
diff --git a/ppapi/tests/test_instance_deprecated.h b/ppapi/tests/test_instance_deprecated.h
index eba2909899..dfccd13893 100644
--- a/ppapi/tests/test_instance_deprecated.h
+++ b/ppapi/tests/test_instance_deprecated.h
@@ -34,6 +34,8 @@ class TestInstance : public TestCase {
std::string TestExecuteScript();
std::string TestRecursiveObjects();
std::string TestLeakedObjectDestructors();
+ std::string TestSetupExecuteScriptAtInstanceShutdown();
+ std::string TestExecuteScriptAtInstanceShutdown();
// Value written by set_string which is called by the ScriptableObject. This
// allows us to keep track of what was called.
diff --git a/ppapi/tests/test_post_message.cc b/ppapi/tests/test_post_message.cc
index 36101fb0c8..b1e30b23a2 100644
--- a/ppapi/tests/test_post_message.cc
+++ b/ppapi/tests/test_post_message.cc
@@ -145,6 +145,9 @@ TestPostMessage::TestPostMessage(TestingInstance* instance)
}
TestPostMessage::~TestPostMessage() {
+ instance_->PostMessage(pp::Var("This isn't guaranteed to be received, but "
+ "shouldn't cause a crash."));
+
// Remove the special listener that only responds to a FINISHED_WAITING
// string. See Init for where it gets added.
std::string js_code;