summaryrefslogtreecommitdiffstats
path: root/webkit/extensions
diff options
context:
space:
mode:
authorace@google.com <ace@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-14 19:11:52 +0000
committerace@google.com <ace@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-14 19:11:52 +0000
commitb5936954f6817733c0b9bd9c4121851a539fc200 (patch)
treefdd3510590715a4c50bc741d64fd011c7b475a0d /webkit/extensions
parent8bef70e795409e0b6c3378d28873bcf3f9693752 (diff)
downloadchromium_src-b5936954f6817733c0b9bd9c4121851a539fc200.zip
chromium_src-b5936954f6817733c0b9bd9c4121851a539fc200.tar.gz
chromium_src-b5936954f6817733c0b9bd9c4121851a539fc200.tar.bz2
Update playback extension so that javascript functions return consistent (but not constant) values in an attempt to preserve the functionality but improve compatibility of the extension.
Review URL: http://codereview.chromium.org/62165 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13688 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/extensions')
-rw-r--r--webkit/extensions/v8/playback_extension.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/webkit/extensions/v8/playback_extension.cc b/webkit/extensions/v8/playback_extension.cc
index e850457..42d0525 100644
--- a/webkit/extensions/v8/playback_extension.cc
+++ b/webkit/extensions/v8/playback_extension.cc
@@ -14,11 +14,15 @@ v8::Extension* PlaybackExtension::Get() {
kPlaybackExtensionName,
"(function () {"
" var orig_date = Date;"
+ " var x = 0;"
+ " var time_seed = 1204251968254;"
" Math.random = function() {"
- " return 0.5;"
+ " x += .1;"
+ " return (x % 1);"
" };"
" Date.__proto__.now = function() {"
- " return new orig_date(1204251968254);"
+ " time_seed += 50;"
+ " return new orig_date(time_seed);"
" };"
" Date = function() {"
" return Date.now();"