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

Side by Side Diff: native_client_sdk/src/examples/websocket/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 // Called by the common.js module. 5 // Called by the common.js module.
6 function attachListeners() { 6 function attachListeners() {
7 document.getElementById('connectForm').addEventListener('submit', doConnect); 7 document.getElementById('connectForm').addEventListener('submit', doConnect);
8 document.getElementById('sendForm').addEventListener('submit', doSend); 8 document.getElementById('sendForm').addEventListener('submit', doSend);
9 document.getElementById('closeButton').addEventListener('click', doClose); 9 document.getElementById('closeButton').addEventListener('click', doClose);
10 } 10 }
(...skipping 16 matching lines...) Expand all
27 // Send a request message. See also websocket.cc for the request format. 27 // Send a request message. See also websocket.cc for the request format.
28 var message = document.getElementById('message').value; 28 var message = document.getElementById('message').value;
29 common.naclModule.postMessage('s;' + message); 29 common.naclModule.postMessage('s;' + message);
30 event.preventDefault(); 30 event.preventDefault();
31 } 31 }
32 32
33 function doClose() { 33 function doClose() {
34 // Send a request message. See also websocket.cc for the request format. 34 // Send a request message. See also websocket.cc for the request format.
35 common.naclModule.postMessage('c;'); 35 common.naclModule.postMessage('c;');
36 } 36 }
37
38 function handleMessage(message) {
39 common.logMessage(message.data + '\n');
40 }
OLDNEW
« no previous file with comments | « native_client_sdk/src/examples/websocket/example.dsc ('k') | native_client_sdk/src/examples/websocket/index.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698