15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Handle a message coming from the NaCl module.  The message payload is
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// assumed to contain the current estimated value of Pi.  Update the Pi
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// text display with this value.
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)function handleMessage(message_event) {
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  document.getElementById('pi').value = message_event.data;
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
11