| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/service_worker/service_worker_storage.h" | 5 #include "content/browser/service_worker/service_worker_storage.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "content/browser/service_worker/service_worker_registration.h" | 10 #include "content/browser/service_worker/service_worker_registration.h" |
| 11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 #include "webkit/browser/quota/quota_manager.h" | 12 #include "webkit/browser/quota/quota_manager_proxy.h" |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 // This is temporary until we figure out how registration ids will be | 15 // This is temporary until we figure out how registration ids will be |
| 16 // calculated. | 16 // calculated. |
| 17 int64 NextRegistrationId() { | 17 int64 NextRegistrationId() { |
| 18 static int64 worker_id = 0; | 18 static int64 worker_id = 0; |
| 19 return worker_id++; | 19 return worker_id++; |
| 20 } | 20 } |
| 21 } // namespace | 21 } // namespace |
| 22 | 22 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // Temporarily borrowed directly from appcache::Namespace::IsMatch(). | 131 // Temporarily borrowed directly from appcache::Namespace::IsMatch(). |
| 132 // We have to escape '?' characters since MatchPattern also treats those | 132 // We have to escape '?' characters since MatchPattern also treats those |
| 133 // as wildcards which we don't want here, we only do '*'s. | 133 // as wildcards which we don't want here, we only do '*'s. |
| 134 std::string pattern_spec(pattern.spec()); | 134 std::string pattern_spec(pattern.spec()); |
| 135 if (pattern.has_query()) | 135 if (pattern.has_query()) |
| 136 ReplaceSubstringsAfterOffset(&pattern_spec, 0, "?", "\\?"); | 136 ReplaceSubstringsAfterOffset(&pattern_spec, 0, "?", "\\?"); |
| 137 return MatchPattern(url.spec(), pattern_spec); | 137 return MatchPattern(url.spec(), pattern_spec); |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace content | 140 } // namespace content |
| OLD | NEW |