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