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

Unified Diff: ios/web/webui/mojo_facade.mm

Issue 2618693004: Mojo JS bindings: make sure that console.log() could be used in the bindings. (Closed)
Patch Set: . Created 3 years, 11 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 | « ios/web/webui/mojo_facade.h ('k') | ios/web/webui/mojo_js_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/webui/mojo_facade.mm
diff --git a/ios/web/webui/mojo_facade.mm b/ios/web/webui/mojo_facade.mm
index bc9b59e031c2fcde9e4a435161377f1c902ad5d8..4300a1b0a45ddaf285944d19568e92eb395d69b3 100644
--- a/ios/web/webui/mojo_facade.mm
+++ b/ios/web/webui/mojo_facade.mm
@@ -9,6 +9,7 @@
#import "base/ios/block_types.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
+#include "base/logging.h"
#import "base/mac/bind_objc_block.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
@@ -70,6 +71,8 @@ std::string MojoFacade::HandleMojoMessage(
result = HandleSupportWatch(args.get());
} else if (name == "support.cancelWatch") {
result = HandleSupportCancelWatch(args.get());
+ } else if (name == "console.log") {
+ result = HandleConsoleLog(args.get());
}
if (!result) {
@@ -270,4 +273,12 @@ std::unique_ptr<base::Value> MojoFacade::HandleSupportCancelWatch(
return nullptr;
}
+std::unique_ptr<base::Value> MojoFacade::HandleConsoleLog(
+ const base::DictionaryValue* args) {
+ std::string message;
+ CHECK(args->GetString("message", &message));
+ LOG(INFO) << message;
+ return nullptr;
+}
+
} // namespace web
« no previous file with comments | « ios/web/webui/mojo_facade.h ('k') | ios/web/webui/mojo_js_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698