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

Side by Side Diff: native_client_sdk/src/examples/hello_world/example.js

Issue 13488007: [NaCl SDK] Make the SDK examples buildable as a packaged app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix license headers Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var kMaxArraySize = 20;
6 var messageArray = new Array();
7
8 // Once we load, hide the plugin 5 // Once we load, hide the plugin
9 function moduleDidLoad() { 6 function moduleDidLoad() {
10 common.hideModule(); 7 common.hideModule();
11 } 8 }
12 9
13 // Called by the common.js module. 10 // Called by the common.js module.
14 function handleMessage(message) { 11 function handleMessage(message) {
15 // Show last |kMaxArraySize| events in html. 12 common.logMessage(message.data);
16 messageArray.push(message.data);
17 if (messageArray.length > kMaxArraySize) {
18 messageArray.shift();
19 }
20 var newData = messageArray.join('<BR>');
21 document.getElementById('outputString').innerHTML = newData;
22 // Print event to console.
23 console.log(message.data);
24 } 13 }
OLDNEW
« no previous file with comments | « native_client_sdk/src/examples/hello_world/example.dsc ('k') | native_client_sdk/src/examples/hello_world/index.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698