Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: chrome/renderer/playback_extension.cc

Issue 1008723006: Remove HTTP cache Record/Playback support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/renderer/playback_extension.h ('k') | net/http/http_cache.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 #include "chrome/renderer/playback_extension.h"
6
7 #include "v8/include/v8.h"
8
9 const char kPlaybackExtensionName[] = "v8/PlaybackMode";
10
11 namespace extensions_v8 {
12
13 v8::Extension* PlaybackExtension::Get() {
14 v8::Extension* extension = new v8::Extension(
15 kPlaybackExtensionName,
16 "(function () {"
17 " var orig_date = Date;"
18 " var x = 0;"
19 " var time_seed = 1204251968254;"
20 " Math.random = function() {"
21 " x += .1;"
22 " return (x % 1);"
23 " };"
24 " Date = function() {"
25 " if (this instanceof Date) {"
26 " switch (arguments.length) {"
27 " case 0: return new orig_date(time_seed += 50);"
28 " case 1: return new orig_date(arguments[0]);"
29 " default: return new orig_date(arguments[0], arguments[1],"
30 " arguments.length >= 3 ? arguments[2] : 1,"
31 " arguments.length >= 4 ? arguments[3] : 0,"
32 " arguments.length >= 5 ? arguments[4] : 0,"
33 " arguments.length >= 6 ? arguments[5] : 0,"
34 " arguments.length >= 7 ? arguments[6] : 0);"
35 " }"
36 " }"
37 " return new Date().toString();"
38 " };"
39 " Date.__proto__ = orig_date;"
40 " Date.prototype.constructor = Date;"
41 " orig_date.now = function() {"
42 " return new Date().getTime();"
43 " };"
44 "})()");
45 return extension;
46 }
47
48 } // namespace extensions_v8
OLDNEW
« no previous file with comments | « chrome/renderer/playback_extension.h ('k') | net/http/http_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698