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

Unified Diff: native_client_sdk/src/examples/trace_events/example.js

Issue 12212198: Add C++ Trace Event support to PPAPI/NaCl SDK (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: brettw feedback Created 7 years, 10 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: native_client_sdk/src/examples/trace_events/example.js
diff --git a/native_client_sdk/src/examples/trace_events/example.js b/native_client_sdk/src/examples/trace_events/example.js
new file mode 100644
index 0000000000000000000000000000000000000000..60e232e13c721d4ef0e47e8aa394ba3f453a0ada
--- /dev/null
+++ b/native_client_sdk/src/examples/trace_events/example.js
@@ -0,0 +1,37 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Called by the common.js module.
+function moduleDidLoad() {
+ // The module is not hidden by default so we can easily see if the plugin
+ // failed to load.
+ common.hideModule();
+}
+
+// Called by the common.js module.
+function attachListeners() {
+ document.getElementById('runthreadedtask').addEventListener('click',
+ runthreadedtask);
+ document.getElementById('sendasynctrace').addEventListener('click',
+ sendasynctrace);
+}
+
+function runthreadedtask() {
+ common.naclModule.postMessage('runthreadedtask');
+}
+
+function sendasynctrace() {
+ var async_button = document.getElementById('sendasynctrace');
+ if (async_button.value == 'Send trace begin') {
+ common.naclModule.postMessage('sendasyncbegin');
+ async_button.value = 'Send trace end';
+ } else {
+ common.naclModule.postMessage('sendasyncend');
+ async_button.value = 'Send trace begin';
+ }
+}
+
+// Called by the common.js module.
+function handleMessage(message_event) {
+}
« no previous file with comments | « native_client_sdk/src/examples/trace_events/example.dsc ('k') | native_client_sdk/src/examples/trace_events/index.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698