summaryrefslogtreecommitdiffstats
path: root/native_client_sdk/src/examples
diff options
context:
space:
mode:
authorbinji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-22 18:48:15 +0000
committerbinji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-22 18:48:15 +0000
commitcd2574a1a98fa3dae8641bf50e56dece2e29ca08 (patch)
treeaa172d35890b0d90839cfd4c89fbfce433830565 /native_client_sdk/src/examples
parent7d5e8cd54f9f99f20360385ab1f77b4c19d7ab16 (diff)
downloadchromium_src-cd2574a1a98fa3dae8641bf50e56dece2e29ca08.zip
chromium_src-cd2574a1a98fa3dae8641bf50e56dece2e29ca08.tar.gz
chromium_src-cd2574a1a98fa3dae8641bf50e56dece2e29ca08.tar.bz2
[NaCl SDK] Re-order the calls to createNaClModule and attachDefaultListeners.
If attachDefaultListeners is called after createNaClModule, then there is a potential race condition -- if the module loads quickly enough, the listeners will not yet be attached when the 'load' message is dispatched. BUG=245910 R=sbc@chromium.org Review URL: https://codereview.chromium.org/33423005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230170 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk/src/examples')
-rw-r--r--native_client_sdk/src/examples/api/file_io/example.js2
-rw-r--r--native_client_sdk/src/examples/demo/nacl_io/example.js2
-rw-r--r--native_client_sdk/src/examples/tutorial/debugging/example.js2
3 files changed, 3 insertions, 3 deletions
diff --git a/native_client_sdk/src/examples/api/file_io/example.js b/native_client_sdk/src/examples/api/file_io/example.js
index 3fdc741..6143fd5 100644
--- a/native_client_sdk/src/examples/api/file_io/example.js
+++ b/native_client_sdk/src/examples/api/file_io/example.js
@@ -12,8 +12,8 @@ function domContentLoaded(name, tc, config, width, height) {
function(bytes) {
common.updateStatus(
'Allocated ' + bytes + ' bytes of persistant storage.');
- common.createNaClModule(name, tc, config, width, height);
common.attachDefaultListeners();
+ common.createNaClModule(name, tc, config, width, height);
},
function(e) { alert('Failed to allocate space') });
}
diff --git a/native_client_sdk/src/examples/demo/nacl_io/example.js b/native_client_sdk/src/examples/demo/nacl_io/example.js
index 6de6afb..0ccaf7d 100644
--- a/native_client_sdk/src/examples/demo/nacl_io/example.js
+++ b/native_client_sdk/src/examples/demo/nacl_io/example.js
@@ -12,8 +12,8 @@ function domContentLoaded(name, tc, config, width, height) {
function(bytes) {
common.updateStatus(
'Allocated ' + bytes + ' bytes of persistant storage.');
- common.createNaClModule(name, tc, config, width, height);
common.attachDefaultListeners();
+ common.createNaClModule(name, tc, config, width, height);
},
function(e) { alert('Failed to allocate space') });
}
diff --git a/native_client_sdk/src/examples/tutorial/debugging/example.js b/native_client_sdk/src/examples/tutorial/debugging/example.js
index 7542844..3016eb7 100644
--- a/native_client_sdk/src/examples/tutorial/debugging/example.js
+++ b/native_client_sdk/src/examples/tutorial/debugging/example.js
@@ -6,8 +6,8 @@ var lastModuleError = '';
var crashed = false;
function domContentLoaded(name, tc, config, width, height) {
- common.createNaClModule(name, tc, config, width, height);
common.attachDefaultListeners();
+ common.createNaClModule(name, tc, config, width, height);
updateStatus('Page Loaded');
}