| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "config.h" | |
| 6 #include "Playback.h" | |
| 7 | |
| 8 namespace WebCore { | |
| 9 | |
| 10 const char* kPlaybackExtensionName = "v8/PlaybackMode"; | |
| 11 | |
| 12 v8::Extension* PlaybackExtension::Get() { | |
| 13 v8::Extension* extension = new v8::Extension( | |
| 14 kPlaybackExtensionName, | |
| 15 "(function () {" | |
| 16 " var orig_date = Date;" | |
| 17 " Math.random = function() {" | |
| 18 " return 0.5;" | |
| 19 " };" | |
| 20 " Date.__proto__.now = function() {" | |
| 21 " return new orig_date(1204251968254);" | |
| 22 " };" | |
| 23 " Date = function() {" | |
| 24 " return Date.now();" | |
| 25 " };" | |
| 26 "})()"); | |
| 27 return extension; | |
| 28 } | |
| 29 | |
| 30 } | |
| 31 | |
| OLD | NEW |