summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc1
-rw-r--r--chrome/common/chrome_switches.cc7
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/renderer/render_thread.cc3
4 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index 882937e..6c5da304 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -251,6 +251,7 @@ bool BrowserRenderProcessHost::Init() {
switches::kJavaScriptFlags,
switches::kRecordMode,
switches::kPlaybackMode,
+ switches::kNoJsRandomness,
switches::kDisableBreakpad,
switches::kFullMemoryCrashReport,
switches::kEnableLogging,
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 4ec169e..0b53400 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -218,6 +218,13 @@ const wchar_t kPlaybackMode[] = L"playback-mode";
// Don't record/playback events when using record & playback.
const wchar_t kNoEvents[] = L"no-events";
+// Support a separate switch that enables the v8 playback extension.
+// The extension causes javascript calls to Date.now() and Math.random()
+// to return consistent values, such that subsequent loads of the same
+// page will result in consistent js-generated data and XHR requests.
+// Pages may still be able to generate inconsistent data from plugins.
+const wchar_t kNoJsRandomness[] = L"no-js-randomness";
+
// Make Windows happy by allowing it to show "Enable access to this program"
// checkbox in Add/Remove Programs->Set Program Access and Defaults. This
// only shows an error box because the only way to hide Chrome is by
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 2ec310d..8f17f3b 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -72,6 +72,7 @@ extern const wchar_t kRestoreLastSession[];
extern const wchar_t kRecordMode[];
extern const wchar_t kPlaybackMode[];
extern const wchar_t kNoEvents[];
+extern const wchar_t kNoJsRandomness[];
extern const wchar_t kHideIcons[];
extern const wchar_t kShowIcons[];
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc
index 2865cc4..cdce9c6 100644
--- a/chrome/renderer/render_thread.cc
+++ b/chrome/renderer/render_thread.cc
@@ -304,7 +304,8 @@ void RenderThread::EnsureWebKitInitialized() {
}
if (command_line.HasSwitch(switches::kPlaybackMode) ||
- command_line.HasSwitch(switches::kRecordMode)) {
+ command_line.HasSwitch(switches::kRecordMode) ||
+ command_line.HasSwitch(switches::kNoJsRandomness)) {
WebKit::registerExtension(extensions_v8::PlaybackExtension::Get());
}