OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // The IntervalExtension is a v8 extension to implement a simple interval | 5 #ifndef WEBKIT_EXTENSIONS_V8_PLAYBACK_EXTENSION_H_ |
6 // class for measuring microsecond intervals. | 6 #define WEBKIT_EXTENSIONS_V8_PLAYBACK_EXTENSION_H_ |
7 | 7 |
8 #ifndef PLAYBACK_EXTENSION_H__ | 8 #include "v8/include/v8.h" |
9 #define PLAYBACK_EXTENSION_H__ | |
10 | 9 |
11 #include "v8.h" | 10 namespace extensions_v8 { |
12 | |
13 namespace WebCore { | |
14 | 11 |
15 // Inject code which overrides a few common JS functions for implementing | 12 // Inject code which overrides a few common JS functions for implementing |
16 // randomness. In order to implement effective record & playback of | 13 // randomness. In order to implement effective record & playback of |
17 // websites, it is important that the URLs not change. Many popular web | 14 // websites, it is important that the URLs not change. Many popular web |
18 // based apps use randomness in URLs to unique-ify urls for proxies. | 15 // based apps use randomness in URLs to unique-ify urls for proxies. |
19 // Unfortunately, this breaks playback. | 16 // Unfortunately, this breaks playback. |
20 // To work around this, we take the two most common client-side randomness | 17 // To work around this, we take the two most common client-side randomness |
21 // generators and make them constant. They really need to be constant | 18 // generators and make them constant. They really need to be constant |
22 // (rather than a constant seed followed by constant change) | 19 // (rather than a constant seed followed by constant change) |
23 // because the playback mode wants flexibility in how it plays them back | 20 // because the playback mode wants flexibility in how it plays them back |
24 // and cannot always guarantee that requests for randomness are played back | 21 // and cannot always guarantee that requests for randomness are played back |
25 // in exactly the same order in which they were recorded. | 22 // in exactly the same order in which they were recorded. |
26 class PlaybackExtension { | 23 class PlaybackExtension { |
27 public: | 24 public: |
28 static v8::Extension* Get(); | 25 static v8::Extension* Get(); |
29 }; | 26 }; |
30 | 27 |
31 } | 28 } // namespace extensions_v8 |
32 | 29 |
33 #endif // PLAYBACK_EXTENSION_H__ | 30 #endif // WEBKIT_EXTENSIONS_V8_PLAYBACK_EXTENSION_H_ |
34 | 31 |
OLD | NEW |