Chromium Code Reviews| Index: content/browser/service_worker/service_worker_utils.h |
| diff --git a/content/browser/service_worker/service_worker_utils.h b/content/browser/service_worker/service_worker_utils.h |
| index 38669c4317648145870670961284df7a64f50aed..edb965050ed6610f45220e37dae68c22ed84ad5d 100644 |
| --- a/content/browser/service_worker/service_worker_utils.h |
| +++ b/content/browser/service_worker/service_worker_utils.h |
| @@ -5,10 +5,14 @@ |
| #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_ |
| #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_ |
| +#include <vector> |
|
jsbell
2014/06/03 18:48:30
Not needed any more?
nhiroki
2014/06/05 11:00:35
Done.
|
| + |
| #include "content/common/content_export.h" |
| #include "content/common/service_worker/service_worker_status_code.h" |
| #include "webkit/common/resource_type.h" |
| +class GURL; |
| + |
| namespace content { |
| class ServiceWorkerUtils { |
| @@ -33,6 +37,21 @@ class ServiceWorkerUtils { |
| CONTENT_EXPORT static bool ScopeMatches(const GURL& scope, const GURL& url); |
| }; |
| +class CONTENT_EXPORT LongestScopeMatcher { |
| + public: |
| + explicit LongestScopeMatcher(const GURL& url) : url_(url) {} |
| + virtual ~LongestScopeMatcher() {} |
| + |
| + // Returns true if |scope| matches |url_| longer than |match_|. |
| + bool MatchLongest(const GURL& scope); |
| + |
| + private: |
| + const GURL url_; |
| + GURL match_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(LongestScopeMatcher); |
| +}; |
| + |
| } // namespace content |
| #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_ |