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

Unified Diff: third_party/WebKit/Source/devtools/hosted_mode/cache.js

Issue 2167413002: DevTools: implement proxy server for hosted mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/hosted_mode/cache.js
diff --git a/third_party/WebKit/Source/devtools/hosted_mode/cache.js b/third_party/WebKit/Source/devtools/hosted_mode/cache.js
new file mode 100644
index 0000000000000000000000000000000000000000..1cb6e162c306f956a5481fde3f2f8efdac8df7b7
--- /dev/null
+++ b/third_party/WebKit/Source/devtools/hosted_mode/cache.js
@@ -0,0 +1,35 @@
+var Cache = function()
lushnikov 2016/07/22 02:56:21 inline this all into protocol_files_proxy.js
chenwilliam 2016/07/22 17:35:25 Done.
+{
+ this._data = new Map();
+ this._version = null;
+};
+
+Cache.prototype = {
+
+ setVersion: function(version)
+ {
+ this._version = version;
+ },
+
+ hasFile: function(file)
+ {
+ return this._data.has(this._getKey(file));
+ },
+
+ getFile: function(file)
+ {
+ return this._data.get(this._getKey(file));
+ },
+
+ cacheFile: function(file, data)
+ {
+ this._data.set(this._getKey(file), data);
+ },
+
+ _getKey: function(file)
+ {
+ return `${file}__version:${this._version}`;
+ }
+};
+
+module.exports = Cache;

Powered by Google App Engine
This is Rietveld 408576698