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

Unified Diff: chrome/common/extensions/docs/server2/content_provider.py

Issue 218363002: Docs: Use ETags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/docs/server2/app.yaml ('k') | chrome/common/extensions/docs/server2/cron.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/server2/content_provider.py
diff --git a/chrome/common/extensions/docs/server2/content_provider.py b/chrome/common/extensions/docs/server2/content_provider.py
index 2a6de2ad398bb5dad3dc9095ef7c8334383a4162..8dd963a3c58d2b85a919856ce8280a9278e725f7 100644
--- a/chrome/common/extensions/docs/server2/content_provider.py
+++ b/chrome/common/extensions/docs/server2/content_provider.py
@@ -27,9 +27,10 @@ class ContentAndType(object):
'''Return value from ContentProvider.GetContentAndType.
'''
- def __init__(self, content, content_type):
+ def __init__(self, content, content_type, version):
self.content = content
self.content_type = content_type
+ self.version = version
class ContentProvider(object):
@@ -100,7 +101,9 @@ class ContentProvider(object):
content = ToUnicode(text)
else:
content = text
- return ContentAndType(content, mimetype)
+ return ContentAndType(content,
+ mimetype,
+ self.file_system.Stat(path).version)
def GetCanonicalPath(self, path):
'''Gets the canonical location of |path|. This class is tolerant of
@@ -133,7 +136,7 @@ class ContentProvider(object):
if self._directory_zipper and ext == '.zip':
zip_future = self._directory_zipper.Zip(ToDirectory(base))
return Future(callback=
- lambda: ContentAndType(zip_future.Get(), 'application/zip'))
+ lambda: ContentAndType(zip_future.Get(), 'application/zip', None))
# If there is no file extension, look for a file with one of the default
# extensions.
« no previous file with comments | « chrome/common/extensions/docs/server2/app.yaml ('k') | chrome/common/extensions/docs/server2/cron.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698