Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 // Start up the paint timer when the NaCl module has loaded. | |
| 6 function moduleDidLoad() { | |
| 7 setInterval(postPaintMessage, 5); | |
| 8 } | |
| 9 | |
| 10 function postPaintMessage() { | |
| 11 common.naclModule.postMessage('paint'); | |
| 12 } | |
| 13 | |
| 14 // Handle a message coming from the NaCl module. The message payload is | 5 // Handle a message coming from the NaCl module. The message payload is |
| 15 // assumed to contain the current estimated value of Pi. Update the Pi | 6 // assumed to contain the current estimated value of Pi. Update the Pi |
| 16 // text display with this value. | 7 // text display with this value. |
| 17 function handleMessage(message_event) { | 8 function handleMessage(message_event) { |
|
binji
2013/05/23 18:06:49
remove
noelallen1
2013/05/23 22:01:24
Done.
| |
| 18 document.getElementById('pi').value = message_event.data; | 9 document.getElementById('pi').value = message_event.data; |
| 19 } | 10 } |
| OLD | NEW |