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

Unified Diff: examples/device_name/device_name.cc

Issue 772393003: Android handler: inject the application loading part from the shell .so. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Address Ben's comment. Created 6 years 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 | « no previous file | mojo/shell/BUILD.gn » ('j') | mojo/shell/BUILD.gn » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/device_name/device_name.cc
diff --git a/examples/device_name/device_name.cc b/examples/device_name/device_name.cc
index eb219e9ee2b1342ed5bbc400402720e97efda7ba..0f5ecd85268b0b56859175f628dc5fd52ae8b50a 100644
--- a/examples/device_name/device_name.cc
+++ b/examples/device_name/device_name.cc
@@ -26,6 +26,7 @@
#include "base/android/jni_string.h"
#include "jni/DeviceName_jni.h"
#include "mojo/public/c/system/main.h"
+#include "mojo/public/cpp/system/core.h"
namespace mojo {
@@ -55,9 +56,18 @@ std::string GetApplicationClassName() {
} // namespace mojo
MojoResult MojoMain(MojoHandle shell_handle) {
+ // Call a Java function to demonstrate that the JNI was correctly set up.
LOG(INFO) << "Device name: " << mojo::examples::GetDeviceName();
+
+ // Call a function that uses the application context to demonstate that it was
+ // properly set.
LOG(INFO) << "Application class: "
<< mojo::examples::GetApplicationClassName();
+
+ // Call a Mojo core function to demonstrate that the thunks were properly set.
+ MojoTimeTicks ticks = MojoGetTimeTicksNow();
+ LOG(INFO) << "Timeticks: " << ticks;
+
return MOJO_RESULT_OK;
}
« no previous file with comments | « no previous file | mojo/shell/BUILD.gn » ('j') | mojo/shell/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698