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

Unified Diff: src/trusted/plugin/ppapi/browser_interface_ppapi.cc

Issue 3119028: Use console.log to report NaCl errors in Chrome instead of alerts (Closed) Base URL: http://nativeclient.googlecode.com/svn/trunk/src/native_client/
Patch Set: '' Created 10 years, 4 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
Index: src/trusted/plugin/ppapi/browser_interface_ppapi.cc
===================================================================
--- src/trusted/plugin/ppapi/browser_interface_ppapi.cc (revision 3042)
+++ src/trusted/plugin/ppapi/browser_interface_ppapi.cc (working copy)
@@ -23,6 +23,7 @@
namespace {
+// TODO(polina): this function should return pp::Var
bool GetWindow(plugin::InstanceIdentifier instance_id, pp::Var* window) {
pp::Instance* instance = plugin::InstanceIdentifierToPPInstance(instance_id);
*window = instance->GetWindowObject();
@@ -63,6 +64,16 @@
return exception.is_void();
}
+bool BrowserInterfacePpapi::AddToConsole(InstanceIdentifier instance_id,
+ const nacl::string& text) {
+ pp::Var window;
+ if (!GetWindow(instance_id, &window)) {
+ return false;
+ }
+ pp::Var exception;
+ window.GetProperty("console", &exception).Call("log", text, &exception);
+ return exception.is_void();
+}
bool BrowserInterfacePpapi::EvalString(InstanceIdentifier instance_id,
const nacl::string& expression) {

Powered by Google App Engine
This is Rietveld 408576698