OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "webkit/appcache/appcache_interfaces.h" | 5 #include "webkit/appcache/appcache_interfaces.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 12 matching lines...) Expand all Loading... | |
23 | 23 |
24 } // namespace | 24 } // namespace |
25 | 25 |
26 namespace appcache { | 26 namespace appcache { |
27 | 27 |
28 const char kHttpScheme[] = "http"; | 28 const char kHttpScheme[] = "http"; |
29 const char kHttpsScheme[] = "https"; | 29 const char kHttpsScheme[] = "https"; |
30 const char kHttpGETMethod[] = "GET"; | 30 const char kHttpGETMethod[] = "GET"; |
31 const char kHttpHEADMethod[] = "HEAD"; | 31 const char kHttpHEADMethod[] = "HEAD"; |
32 | 32 |
33 const char kEnableExecutableHandlers[] = "enable-appcache-executable-handlers"; | |
34 | |
33 const base::FilePath::CharType kAppCacheDatabaseName[] = | 35 const base::FilePath::CharType kAppCacheDatabaseName[] = |
34 FILE_PATH_LITERAL("Index"); | 36 FILE_PATH_LITERAL("Index"); |
35 | 37 |
36 AppCacheInfo::AppCacheInfo() | 38 AppCacheInfo::AppCacheInfo() |
37 : cache_id(kNoCacheId), | 39 : cache_id(kNoCacheId), |
38 group_id(0), | 40 group_id(0), |
39 status(UNCACHED), | 41 status(UNCACHED), |
40 size(0), | 42 size(0), |
41 is_complete(false) { | 43 is_complete(false) { |
42 } | 44 } |
(...skipping 11 matching lines...) Expand all Loading... | |
54 is_foreign(false), | 56 is_foreign(false), |
55 is_explicit(false), | 57 is_explicit(false), |
56 response_id(kNoResponseId) { | 58 response_id(kNoResponseId) { |
57 } | 59 } |
58 | 60 |
59 AppCacheResourceInfo::~AppCacheResourceInfo() { | 61 AppCacheResourceInfo::~AppCacheResourceInfo() { |
60 } | 62 } |
61 | 63 |
62 Namespace::Namespace() | 64 Namespace::Namespace() |
63 : type(FALLBACK_NAMESPACE), | 65 : type(FALLBACK_NAMESPACE), |
64 is_pattern(false) { | 66 is_pattern(false), |
67 is_executable(false) { | |
65 } | 68 } |
66 | 69 |
67 Namespace::Namespace( | 70 Namespace::Namespace( |
68 NamespaceType type, const GURL& url, const GURL& target, bool is_pattern) | 71 NamespaceType type, const GURL& url, const GURL& target, bool is_pattern) |
69 : type(type), | 72 : type(type), |
70 namespace_url(url), | 73 namespace_url(url), |
71 target_url(target), | 74 target_url(target), |
72 is_pattern(is_pattern) { | 75 is_pattern(is_pattern), |
76 is_executable(false) { | |
alecflett
2013/04/16 22:28:56
Seems like its worth keeping a single constructor
michaeln
2013/04/16 22:43:02
thought about it, certainly if/when we decide to k
| |
77 } | |
78 | |
79 Namespace::Namespace( | |
80 NamespaceType type, const GURL& url, const GURL& target, | |
81 bool is_pattern, bool is_executable) | |
82 : type(type), | |
83 namespace_url(url), | |
84 target_url(target), | |
85 is_pattern(is_pattern), | |
86 is_executable(is_executable) { | |
73 } | 87 } |
74 | 88 |
75 Namespace::~Namespace() { | 89 Namespace::~Namespace() { |
76 } | 90 } |
77 | 91 |
78 bool Namespace::IsMatch(const GURL& url) const { | 92 bool Namespace::IsMatch(const GURL& url) const { |
79 if (is_pattern) { | 93 if (is_pattern) { |
80 // We have to escape '?' characters since MatchPattern also treats those | 94 // We have to escape '?' characters since MatchPattern also treats those |
81 // as wildcards which we don't want here, we only do '*'s. | 95 // as wildcards which we don't want here, we only do '*'s. |
82 std::string pattern = namespace_url.spec(); | 96 std::string pattern = namespace_url.spec(); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
151 COMPILE_ASSERT((int)WebConsoleMessage::LevelDebug == | 165 COMPILE_ASSERT((int)WebConsoleMessage::LevelDebug == |
152 (int)LOG_DEBUG, LevelDebug); | 166 (int)LOG_DEBUG, LevelDebug); |
153 COMPILE_ASSERT((int)WebConsoleMessage::LevelLog == | 167 COMPILE_ASSERT((int)WebConsoleMessage::LevelLog == |
154 (int)LOG_INFO, LevelLog); | 168 (int)LOG_INFO, LevelLog); |
155 COMPILE_ASSERT((int)WebConsoleMessage::LevelWarning == | 169 COMPILE_ASSERT((int)WebConsoleMessage::LevelWarning == |
156 (int)LOG_WARNING, LevelWarning); | 170 (int)LOG_WARNING, LevelWarning); |
157 COMPILE_ASSERT((int)WebConsoleMessage::LevelError == | 171 COMPILE_ASSERT((int)WebConsoleMessage::LevelError == |
158 (int)LOG_ERROR, LevelError); | 172 (int)LOG_ERROR, LevelError); |
159 | 173 |
160 } // namespace appcache | 174 } // namespace appcache |
OLD | NEW |