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