| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 ONLINE_WHITELIST, | 63 ONLINE_WHITELIST, |
| 64 UNKNOWN_MODE, | 64 UNKNOWN_MODE, |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 enum InterceptVerb { | 67 enum InterceptVerb { |
| 68 RETURN, | 68 RETURN, |
| 69 EXECUTE, | 69 EXECUTE, |
| 70 UNKNOWN_VERB, | 70 UNKNOWN_VERB, |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 Manifest::Manifest() | 73 AppCacheManifest::AppCacheManifest() |
| 74 : online_whitelist_all(false), | 74 : online_whitelist_all(false), |
| 75 did_ignore_intercept_namespaces(false) { | 75 did_ignore_intercept_namespaces(false) { |
| 76 } | 76 } |
| 77 | 77 |
| 78 Manifest::~Manifest() {} | 78 AppCacheManifest::~AppCacheManifest() {} |
| 79 | 79 |
| 80 bool ParseManifest(const GURL& manifest_url, const char* data, int length, | 80 bool ParseManifest(const GURL& manifest_url, const char* data, int length, |
| 81 ParseMode parse_mode, Manifest& manifest) { | 81 ParseMode parse_mode, AppCacheManifest& manifest) { |
| 82 // This is an implementation of the parsing algorithm specified in | 82 // This is an implementation of the parsing algorithm specified in |
| 83 // the HTML5 offline web application docs: | 83 // the HTML5 offline web application docs: |
| 84 // http://www.w3.org/TR/html5/offline.html | 84 // http://www.w3.org/TR/html5/offline.html |
| 85 // Do not modify it without consulting those docs. | 85 // Do not modify it without consulting those docs. |
| 86 // Though you might be tempted to convert these wstrings to UTF-8 or | 86 // Though you might be tempted to convert these wstrings to UTF-8 or |
| 87 // base::string16, this implementation seems simpler given the constraints. | 87 // base::string16, this implementation seems simpler given the constraints. |
| 88 | 88 |
| 89 const wchar_t kSignature[] = L"CACHE MANIFEST"; | 89 const wchar_t kSignature[] = L"CACHE MANIFEST"; |
| 90 const size_t kSignatureLength = arraysize(kSignature) - 1; | 90 const size_t kSignatureLength = arraysize(kSignature) - 1; |
| 91 const wchar_t kChromiumSignature[] = L"CHROMIUM CACHE MANIFEST"; | 91 const wchar_t kChromiumSignature[] = L"CHROMIUM CACHE MANIFEST"; |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 fallback_url, is_pattern)); | 373 fallback_url, is_pattern)); |
| 374 } else { | 374 } else { |
| 375 NOTREACHED(); | 375 NOTREACHED(); |
| 376 } | 376 } |
| 377 } | 377 } |
| 378 | 378 |
| 379 return true; | 379 return true; |
| 380 } | 380 } |
| 381 | 381 |
| 382 } // namespace content | 382 } // namespace content |
| OLD | NEW |