summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
authormaf@google.com <maf@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-15 23:55:43 +0000
committermaf@google.com <maf@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-15 23:55:43 +0000
commitff3e0eeb0fa6f57b68b56505127c9a530ce56e08 (patch)
treebd03026213d32486d4ea660d2cb27a4def71d486 /o3d
parent8b520f6a9fe0aeb4fa671c803d6d5d1f6aa487f1 (diff)
downloadchromium_src-ff3e0eeb0fa6f57b68b56505127c9a530ce56e08.zip
chromium_src-ff3e0eeb0fa6f57b68b56505127c9a530ce56e08.tar.gz
chromium_src-ff3e0eeb0fa6f57b68b56505127c9a530ce56e08.tar.bz2
Do not init v8 on platforms where it is not supported.
Prevents hang on Safari 5/Mac OS X 10.6. Review URL: http://codereview.chromium.org/2866003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49860 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r--o3d/samples/o3djs/util.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/o3d/samples/o3djs/util.js b/o3d/samples/o3djs/util.js
index da54ec8..d897b1e 100644
--- a/o3d/samples/o3djs/util.js
+++ b/o3d/samples/o3djs/util.js
@@ -612,8 +612,9 @@ function o3djs_isV8Supported() {
* @param {o3djs.util.Engine} engine The engine.
*/
o3djs.util.setMainEngine = function(engine) {
- if ((engine == o3djs.util.Engine.V8) && !o3djs_isV8Supported())
- return;
+ if ((engine == o3djs.util.Engine.V8) && !o3djs_isV8Supported()) {
+ engine = o3djs.util.Engine.BROWSER;
+ }
o3djs.util.mainEngine_ = engine;
};
@@ -989,7 +990,11 @@ o3djs.util.makeClients = function(callback,
// TODO: Is this needed with the new event code?
for (var cc = 0; cc < clientElements.length; ++cc) {
- o3djs.base.initV8(clientElements[cc]);
+ // Based on v8 support test, not on current engine, as V8
+ // still needs to be initialized even with o3djs.util.Engine.BROWSER
+ // on some configs.
+ if (o3djs_isV8Supported())
+ o3djs.base.initV8(clientElements[cc]);
o3djs.event.startKeyboardEventSynthesis(clientElements[cc]);
o3djs.error.setDefaultErrorHandler(clientElements[cc].client);
}
@@ -1010,7 +1015,7 @@ o3djs.util.makeClients = function(callback,
var scriptTagText = o3djs.util.getScriptTagText_();
mainClientElement.eval(scriptTagText);
- // Invoke the vallback in V8.
+ // Invoke the callback in V8.
o3djs.util.callV8(mainClientElement,
callback,
o3djs.global,