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

Side by Side Diff: native_client_sdk/src/examples/api/vpn_provider/example.js

Issue 1731273002: ppapi: PPB_VpnProvider: Add a simple NaCl SDK example. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@vpn-ppapi
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
binji 2016/02/24 19:23:08 2016, and remove (c)
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // This function is called by common.js when the NaCl module is
6 // loaded.
7 function moduleDidLoad() {
8 // Once we load, hide the plugin. In this example, we don't display anything
9 // in the plugin, so it is fine to hide it.
10 common.hideModule();
11
12 // After the NaCl module has loaded, common.naclModule is a reference to the
13 // NaCl module's <embed> element.
14 //
15 // postMessage sends a message to it.
16 // common.naclModule.postMessage('hello');
17 }
18
19 function load_me() {
binji 2016/02/24 19:23:08 nit: loadMe (and unloadMe below)
20 common.naclModule.postMessage('hello');
21
22 document.getElementById("load").disabled = true;
23 document.getElementById("unload").disabled = false;
24 }
25 function unload_me() {
26 common.naclModule.postMessage('bye');
27
28 document.getElementById("load").disabled = false;
29 document.getElementById("unload").disabled = true;
30 }
31
32 // This function is called by common.js when a message is received from the
33 // NaCl module.
34 function handleMessage(message) {
35 var logEl = document.getElementById('log');
36 logEl.textContent += message.data;
37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698