summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorteravest <teravest@chromium.org>2014-09-03 16:48:28 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-03 23:54:11 +0000
commit6993b87a3ec9f5af3741acbb3bc53a73b0dd6a23 (patch)
tree93949934774d34502e8693052562d623b4e2f00e /ppapi
parentb8729366a6d05e96f6283b077e500b1d882abfe7 (diff)
downloadchromium_src-6993b87a3ec9f5af3741acbb3bc53a73b0dd6a23.zip
chromium_src-6993b87a3ec9f5af3741acbb3bc53a73b0dd6a23.tar.gz
chromium_src-6993b87a3ec9f5af3741acbb3bc53a73b0dd6a23.tar.bz2
Drop NaCl support for posting stdout/stderr to JS.
After sending an email to the native-client-discuss list, it was determined that this feature for redirecting stdout and stderr to JavaScript isn't very useful. This drops support for that feature; a follow up change to the NaCl repository will remove support there (and the SRPC message). BUG=406558 Review URL: https://codereview.chromium.org/513273003 Cr-Commit-Position: refs/heads/master@{#293224}
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/api/private/ppb_nacl_private.idl6
-rw-r--r--ppapi/c/private/ppb_nacl_private.h6
-rw-r--r--ppapi/native_client/src/trusted/plugin/service_runtime.cc5
-rw-r--r--ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c6
-rw-r--r--ppapi/native_client/tests/nacl_browser/inbrowser_test_runner/nacl.scons4
-rw-r--r--ppapi/native_client/tests/nacl_browser/inbrowser_test_runner/test_runner.html59
-rw-r--r--ppapi/native_client/tests/nacl_browser/inbrowser_test_runner/test_runner_ppapi.c7
7 files changed, 9 insertions, 84 deletions
diff --git a/ppapi/api/private/ppb_nacl_private.idl b/ppapi/api/private/ppb_nacl_private.idl
index cb5cc4e..e777527 100644
--- a/ppapi/api/private/ppb_nacl_private.idl
+++ b/ppapi/api/private/ppb_nacl_private.idl
@@ -344,12 +344,6 @@ interface PPB_NaCl_Private {
// http://llvm.org/docs/CommandGuide/llc.html#cmdoption-mattr
PP_Var GetCpuFeatureAttrs();
- /* Posts a message to the JavaScript object for the given instance.
- * This method may be called on any thread.
- */
- void PostMessageToJavaScript([in] PP_Instance instance,
- [in] str_t message);
-
/* Downloads the .nexe file at the given URL to a file, and sets |file_info|
* to information for a handle to a file containing its contents.
* If metadata for identity-based validation caching is available
diff --git a/ppapi/c/private/ppb_nacl_private.h b/ppapi/c/private/ppb_nacl_private.h
index 3e5b71d..b28dff2 100644
--- a/ppapi/c/private/ppb_nacl_private.h
+++ b/ppapi/c/private/ppb_nacl_private.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From private/ppb_nacl_private.idl modified Thu Aug 21 11:14:10 2014. */
+/* From private/ppb_nacl_private.idl modified Wed Aug 27 13:55:13 2014. */
#ifndef PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_
#define PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_
@@ -354,10 +354,6 @@ struct PPB_NaCl_Private_1_0 {
* of attributes supported by LLVM in its -mattr= option:
* http://llvm.org/docs/CommandGuide/llc.html#cmdoption-mattr */
struct PP_Var (*GetCpuFeatureAttrs)(void);
- /* Posts a message to the JavaScript object for the given instance.
- * This method may be called on any thread.
- */
- void (*PostMessageToJavaScript)(PP_Instance instance, const char* message);
/* Downloads the .nexe file at the given URL to a file, and sets |file_info|
* to information for a handle to a file containing its contents.
* If metadata for identity-based validation caching is available
diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.cc b/ppapi/native_client/src/trusted/plugin/service_runtime.cc
index ffce563..b162f62 100644
--- a/ppapi/native_client/src/trusted/plugin/service_runtime.cc
+++ b/ppapi/native_client/src/trusted/plugin/service_runtime.cc
@@ -84,9 +84,8 @@ void PluginReverseInterface::ShutDown() {
}
void PluginReverseInterface::DoPostMessage(nacl::string message) {
- std::string full_message = std::string("DEBUG_POSTMESSAGE:") + message;
- GetNaClInterface()->PostMessageToJavaScript(pp_instance_,
- full_message.c_str());
+ // This feature is no longer used.
+ // TODO(teravest): Remove this once this is gone from nacl::ReverseInterface.
}
void PluginReverseInterface::StartupInitializationComplete() {
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 3c3dd81..73c18d8 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
@@ -3577,11 +3577,6 @@ static void Pnacl_M25_PPB_NaCl_Private_GetCpuFeatureAttrs(struct PP_Var* _struct
*_struct_result = iface->GetCpuFeatureAttrs();
}
-static void Pnacl_M25_PPB_NaCl_Private_PostMessageToJavaScript(PP_Instance instance, const char* message) {
- const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface;
- iface->PostMessageToJavaScript(instance, message);
-}
-
static void Pnacl_M25_PPB_NaCl_Private_DownloadNexe(PP_Instance instance, const char* url, struct PP_NaClFileInfo* file_info, struct PP_CompletionCallback* callback) {
const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface;
iface->DownloadNexe(instance, url, file_info, *callback);
@@ -5430,7 +5425,6 @@ static const struct PPB_NaCl_Private_1_0 Pnacl_Wrappers_PPB_NaCl_Private_1_0 = {
.GetManifestProgramURL = (PP_Bool (*)(PP_Instance instance, struct PP_Var* full_url, struct PP_PNaClOptions* pnacl_options, PP_Bool* uses_nonsfi_mode))&Pnacl_M25_PPB_NaCl_Private_GetManifestProgramURL,
.GetPnaclResourceInfo = (PP_Bool (*)(PP_Instance instance, struct PP_Var* llc_tool_name, struct PP_Var* ld_tool_name))&Pnacl_M25_PPB_NaCl_Private_GetPnaclResourceInfo,
.GetCpuFeatureAttrs = (struct PP_Var (*)(void))&Pnacl_M25_PPB_NaCl_Private_GetCpuFeatureAttrs,
- .PostMessageToJavaScript = (void (*)(PP_Instance instance, const char* message))&Pnacl_M25_PPB_NaCl_Private_PostMessageToJavaScript,
.DownloadNexe = (void (*)(PP_Instance instance, const char* url, struct PP_NaClFileInfo* file_info, struct PP_CompletionCallback callback))&Pnacl_M25_PPB_NaCl_Private_DownloadNexe,
.ReportSelLdrStatus = (void (*)(PP_Instance instance, int32_t load_status, int32_t max_status))&Pnacl_M25_PPB_NaCl_Private_ReportSelLdrStatus,
.LogTranslateTime = (void (*)(const char* histogram_name, int64_t time_us))&Pnacl_M25_PPB_NaCl_Private_LogTranslateTime,
diff --git a/ppapi/native_client/tests/nacl_browser/inbrowser_test_runner/nacl.scons b/ppapi/native_client/tests/nacl_browser/inbrowser_test_runner/nacl.scons
index 898df47..af350fc 100644
--- a/ppapi/native_client/tests/nacl_browser/inbrowser_test_runner/nacl.scons
+++ b/ppapi/native_client/tests/nacl_browser/inbrowser_test_runner/nacl.scons
@@ -38,9 +38,7 @@ def AddTest(env, test_name, exe_list, parallel=False):
nmf_names=exe_list,
files=[env.File('test_runner.html')] + test_files,
map_files=[('nmf_test_list.js', nmf_list_js)],
- test_args=[('parallel', int(parallel))],
- osenv=['NACL_EXE_STDOUT=DEBUG_ONLY:dev://postmessage',
- 'NACL_EXE_STDERR=DEBUG_ONLY:dev://postmessage'])
+ test_args=[('parallel', int(parallel))])
# Disabled on Valgrind because of multiple nexes.
# TODO(eugenis): enable when Valgrind learns to autodetect the nexe name
diff --git a/ppapi/native_client/tests/nacl_browser/inbrowser_test_runner/test_runner.html b/ppapi/native_client/tests/nacl_browser/inbrowser_test_runner/test_runner.html
index e3220b3..5ecd04a 100644
--- a/ppapi/native_client/tests/nacl_browser/inbrowser_test_runner/test_runner.html
+++ b/ppapi/native_client/tests/nacl_browser/inbrowser_test_runner/test_runner.html
@@ -44,58 +44,11 @@ function addTest(tester, url) {
document.getElementById('scratch_space').removeChild(div);
};
- // This is the prefix prepended by NaCl's unofficial
- // "dev://postmessage" feature.
- var stdout_prefix = 'DEBUG_POSTMESSAGE:';
-
- // NaCl's "dev://postmessage" feature is unsynchronized, in the
- // sense that the DEBUG_POSTMESSAGE messages can arrive after the
- // test result event. As a workaround, we look for an
- // "END_OF_LOG" string that the nexe prints.
- var saw_end_of_log = false;
- var end_of_log_callbacks = [];
-
- var runEndOfLogCallbacks = function() {
- if (!saw_end_of_log) {
- saw_end_of_log = true;
- for (var i = 0; i < end_of_log_callbacks.length; i++) {
- end_of_log_callbacks[i]();
- }
- end_of_log_callbacks = [];
- }
- };
-
- var callAtEndOfLog = function(func) {
- if (saw_end_of_log) {
- func();
- } else {
- end_of_log_callbacks.push(func);
- // If we do not see the end of the log soon, end the test
- // anyway. This will happen if the nexe crashes or exits.
- window.setTimeout(status.wrap(function() {
- status.log('Did not see the END_OF_LOG message after timeout; ' +
- 'continuing anyway');
- runEndOfLogCallbacks();
- }), 500);
- }
- };
-
// Set up an event listener for success messages.
div.addEventListener('message', status.wrap(function(message_event) {
- if (message_event.data.substr(0, stdout_prefix.length) == stdout_prefix) {
- var msg = message_event.data.substr(stdout_prefix.length);
- if (msg == '\nEND_OF_LOG\n') {
- runEndOfLogCallbacks();
- } else {
- status.log(msg.replace(/\n/g, '\\n'));
- }
- } else {
- callAtEndOfLog(function() {
- status.assertEqual(message_event.data, 'passed');
- cleanup();
- status.pass();
- });
- }
+ status.assertEqual(message_event.data, 'passed');
+ cleanup();
+ status.pass();
}), true);
// Wait for the load event, which indicates successful loading.
@@ -106,10 +59,8 @@ function addTest(tester, url) {
}), true);
var onError = status.wrap(function(e) {
- callAtEndOfLog(function() {
- cleanup();
- status.fail(embed.lastError);
- });
+ cleanup();
+ status.fail(embed.lastError);
});
div.addEventListener('error', onError, true);
diff --git a/ppapi/native_client/tests/nacl_browser/inbrowser_test_runner/test_runner_ppapi.c b/ppapi/native_client/tests/nacl_browser/inbrowser_test_runner/test_runner_ppapi.c
index 0d57dfb..ea61366 100644
--- a/ppapi/native_client/tests/nacl_browser/inbrowser_test_runner/test_runner_ppapi.c
+++ b/ppapi/native_client/tests/nacl_browser/inbrowser_test_runner/test_runner_ppapi.c
@@ -121,13 +121,6 @@ static void PppMessagingHandleMessage(PP_Instance instance,
result = g_browser_var->VarFromUtf8(kFailed, strlen(kFailed));
}
- /*
- * This is a workaround for the problem that the messages sent by
- * the "dev://postmessage" are unsynchronized. The Javascript code
- * looks for this message before finishing the test.
- */
- fprintf(stderr, "\nEND_OF_LOG\n");
-
g_browser_messaging->PostMessage(instance, result);
}