summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/manifest_parser.cc
diff options
context:
space:
mode:
authorjennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-10 23:58:18 +0000
committerjennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-10 23:58:18 +0000
commitb160d6dc73b9ce92827f81517d9b155006a4e422 (patch)
treeaa90f4368acd71b1c2a670e4e5533723722d66ed /webkit/appcache/manifest_parser.cc
parent9cdef414f2d081d6144ca1578b4fe1d0d4cf7b4d (diff)
downloadchromium_src-b160d6dc73b9ce92827f81517d9b155006a4e422.zip
chromium_src-b160d6dc73b9ce92827f81517d9b155006a4e422.tar.gz
chromium_src-b160d6dc73b9ce92827f81517d9b155006a4e422.tar.bz2
Update manifest parser code to match current HTML5 spec by
adding support for whitelisting all URLs using a wildcard and using namespace in place of URL for fallback and network sections. BUG=none TEST=added checks for wildcard character in all sections Review URL: http://codereview.chromium.org/165151 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22972 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/manifest_parser.cc')
-rw-r--r--webkit/appcache/manifest_parser.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/webkit/appcache/manifest_parser.cc b/webkit/appcache/manifest_parser.cc
index b5e8cb8..4930dd6 100644
--- a/webkit/appcache/manifest_parser.cc
+++ b/webkit/appcache/manifest_parser.cc
@@ -49,8 +49,9 @@ bool ParseManifest(const GURL& manifest_url, const char* data, int length,
static const std::wstring kSignature(L"CACHE MANIFEST");
DCHECK(manifest.explicit_urls.empty());
- DCHECK(manifest.online_whitelisted_urls.empty());
- DCHECK(manifest.fallback_urls.empty());
+ DCHECK(manifest.fallback_namespaces.empty());
+ DCHECK(manifest.online_whitelist_namespaces.empty());
+ DCHECK(!manifest.online_whitelist_all);
Mode mode = kExplicit;
@@ -125,6 +126,9 @@ bool ParseManifest(const GURL& manifest_url, const char* data, int length,
mode = kUnknown;
} else if (mode == kUnknown) {
continue;
+ } else if (line == L"*" && mode == kOnlineWhitelist) {
+ manifest.online_whitelist_all = true;
+ continue;
} else if (mode == kExplicit || mode == kOnlineWhitelist) {
const wchar_t *line_p = line.c_str();
const wchar_t *line_end = line_p + line.length();
@@ -152,7 +156,7 @@ bool ParseManifest(const GURL& manifest_url, const char* data, int length,
if (mode == kExplicit) {
manifest.explicit_urls.insert(url.spec());
} else {
- manifest.online_whitelisted_urls.push_back(url);
+ manifest.online_whitelist_namespaces.push_back(url);
}
} else if (mode == kFallback) {
const wchar_t* line_p = line.c_str();
@@ -212,8 +216,8 @@ bool ParseManifest(const GURL& manifest_url, const char* data, int length,
// Store regardless of duplicate namespace URL. Only first match
// will ever be used.
- manifest.fallback_urls.push_back(
- std::make_pair(namespace_url, fallback_url));
+ manifest.fallback_namespaces.push_back(
+ FallbackNamespace(namespace_url, fallback_url));
} else {
NOTREACHED();
}