| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // This is a port of ManifestParser.cc from WebKit/WebCore/loader/appcache. | 5 // This is a port of ManifestParser.cc from WebKit/WebCore/loader/appcache. |
| 6 | 6 |
| 7 /* | 7 /* |
| 8 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 8 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 9 * | 9 * |
| 10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 namespace appcache { | 39 namespace appcache { |
| 40 | 40 |
| 41 enum Mode { | 41 enum Mode { |
| 42 EXPLICIT, | 42 EXPLICIT, |
| 43 FALLBACK, | 43 FALLBACK, |
| 44 ONLINE_WHITELIST, | 44 ONLINE_WHITELIST, |
| 45 UNKNOWN, | 45 UNKNOWN, |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 Manifest::Manifest() : online_whitelist_all(false) {} |
| 49 |
| 50 Manifest::~Manifest() {} |
| 51 |
| 48 bool ParseManifest(const GURL& manifest_url, const char* data, int length, | 52 bool ParseManifest(const GURL& manifest_url, const char* data, int length, |
| 49 Manifest& manifest) { | 53 Manifest& manifest) { |
| 50 static const std::wstring kSignature(L"CACHE MANIFEST"); | 54 static const std::wstring kSignature(L"CACHE MANIFEST"); |
| 51 | 55 |
| 52 DCHECK(manifest.explicit_urls.empty()); | 56 DCHECK(manifest.explicit_urls.empty()); |
| 53 DCHECK(manifest.fallback_namespaces.empty()); | 57 DCHECK(manifest.fallback_namespaces.empty()); |
| 54 DCHECK(manifest.online_whitelist_namespaces.empty()); | 58 DCHECK(manifest.online_whitelist_namespaces.empty()); |
| 55 DCHECK(!manifest.online_whitelist_all); | 59 DCHECK(!manifest.online_whitelist_all); |
| 56 | 60 |
| 57 Mode mode = EXPLICIT; | 61 Mode mode = EXPLICIT; |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 FallbackNamespace(namespace_url, fallback_url)); | 232 FallbackNamespace(namespace_url, fallback_url)); |
| 229 } else { | 233 } else { |
| 230 NOTREACHED(); | 234 NOTREACHED(); |
| 231 } | 235 } |
| 232 } | 236 } |
| 233 | 237 |
| 234 return true; | 238 return true; |
| 235 } | 239 } |
| 236 | 240 |
| 237 } // namespace appcache | 241 } // namespace appcache |
| OLD | NEW |