diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-06 21:35:45 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-06 21:35:45 +0000 |
commit | 9b26746efa2127fe8ec019e02970a69db17e5115 (patch) | |
tree | dd051086101521a297130a9fdba7a1838467a376 /webkit/appcache/manifest_parser.h | |
parent | 1f74cfc185bb4d47532994a206a901bc708d3ff6 (diff) | |
download | chromium_src-9b26746efa2127fe8ec019e02970a69db17e5115.zip chromium_src-9b26746efa2127fe8ec019e02970a69db17e5115.tar.gz chromium_src-9b26746efa2127fe8ec019e02970a69db17e5115.tar.bz2 |
Port of WebKit's appcache manifest parser code.
Added unittests for manifest parser to test_shell_tests.
This is a clone of jennb's CL here.
http://codereview.chromium.org/160608
TBR=jennb
BUG=none
TEST=manifest_parser_unittest.cc
Review URL: http://codereview.chromium.org/165072
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22673 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/manifest_parser.h')
-rw-r--r-- | webkit/appcache/manifest_parser.h | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/webkit/appcache/manifest_parser.h b/webkit/appcache/manifest_parser.h index 5ccd075..3bff98a 100644 --- a/webkit/appcache/manifest_parser.h +++ b/webkit/appcache/manifest_parser.h @@ -29,27 +29,30 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef ManifestParser_h -#define ManifestParser_h +#ifndef WEBKIT_APPCACHE_MANIFEST_PARSER_H_ +#define WEBKIT_APPCACHE_MANIFEST_PARSER_H_ -#if ENABLE(OFFLINE_WEB_APPLICATIONS) +#include <string> +#include <vector> -#include "ApplicationCache.h" +#include "base/hash_tables.h" -namespace WebCore { +class GURL; - class KURL; +namespace appcache { - struct Manifest { - Vector<KURL> onlineWhitelistedURLs; - HashSet<String> explicitURLs; - FallbackURLVector fallbackURLs; - }; +typedef std::vector<std::pair<GURL, GURL> > FallbackUrlVector; - bool parseManifest(const KURL& manifestURL, const char* data, int length, Manifest&); +// TODO(jennb): spec changed since webkit implementation. Update in next CL. +struct Manifest { + std::vector<GURL> online_whitelisted_urls; + base::hash_set<std::string> explicit_urls; + FallbackUrlVector fallback_urls; +}; -} +bool ParseManifest(const GURL& manifest_url, const char* data, int length, + Manifest& manifest); -#endif // ENABLE(OFFLINE_WEB_APPLICATIONS) +} // namespace appcache -#endif // ManifestParser_h +#endif // WEBKIT_APPCACHE_MANIFEST_PARSER_H_ |