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

Unified Diff: components/nacl/renderer/nexe_load_manager.cc

Issue 217133006: Pepper: Move LogToConsole to NexeLoadManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/nacl/renderer/nexe_load_manager.h ('k') | components/nacl/renderer/ppb_nacl_private_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/renderer/nexe_load_manager.cc
diff --git a/components/nacl/renderer/nexe_load_manager.cc b/components/nacl/renderer/nexe_load_manager.cc
index 123e471f1a67b83032c38fbab478afe382d47f6d..2fc7c53f95f996913b2e143863cd6d254a950c7f 100644
--- a/components/nacl/renderer/nexe_load_manager.cc
+++ b/components/nacl/renderer/nexe_load_manager.cc
@@ -97,7 +97,8 @@ NexeLoadManager::~NexeLoadManager() {
}
void NexeLoadManager::ReportLoadError(PP_NaClError error,
- const std::string& error_message) {
+ const std::string& error_message,
+ const std::string& console_message) {
// Check that we are on the main renderer thread.
DCHECK(content::RenderThread::Get());
@@ -108,9 +109,6 @@ void NexeLoadManager::ReportLoadError(PP_NaClError error,
sender->Send(
new NaClHostMsg_MissingArchError(GetRoutingID(pp_instance_)));
}
- // TODO(dmichael): Move the following actions here:
- // - Print error message to JavaScript console.
-
set_nacl_ready_state(PP_NACL_READY_STATE_DONE);
nexe_error_reported_ = true;
@@ -141,6 +139,8 @@ void NexeLoadManager::ReportLoadError(PP_NaClError error,
"NaCl.LoadStatus.Plugin.InstalledApp" :
"NaCl.LoadStatus.Plugin.NotInstalledApp";
HistogramEnumerate(uma_name, error, PP_NACL_ERROR_MAX);
+
+ LogToConsole(console_message);
}
void NexeLoadManager::DispatchEvent(const ProgressEvent &event) {
@@ -207,4 +207,9 @@ void NexeLoadManager::SetReadOnlyProperty(PP_Var key, PP_Var value) {
plugin_instance_->SetEmbedProperty(key, value);
}
+void NexeLoadManager::LogToConsole(const std::string& message) {
+ ppapi::PpapiGlobals::Get()->LogWithSource(
+ pp_instance_, PP_LOGLEVEL_LOG, std::string("NativeClient"), message);
+}
+
} // namespace nacl
« no previous file with comments | « components/nacl/renderer/nexe_load_manager.h ('k') | components/nacl/renderer/ppb_nacl_private_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698