Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(766)

Unified Diff: content/browser/service_worker/service_worker_utils.h

Issue 294593002: ServiceWorker: Support longest-prefix-match for registration scope (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remake (drop the exact-match) Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..66ee9b2e1985d17ac025d1798fb159a4c39d0019 100644
--- a/content/browser/service_worker/service_worker_utils.h
+++ b/content/browser/service_worker/service_worker_utils.h
@@ -31,6 +31,11 @@ class ServiceWorkerUtils {
// Returns true if |scope| matches |url|.
CONTENT_EXPORT static bool ScopeMatches(const GURL& scope, const GURL& url);
+
+ // Finds a scope that matches |url| longest from |scopes|. Returns true and
+ // fills |pos| with a position of the scope in |scopes| if it's found.
+ CONTENT_EXPORT static bool FindLongestScopeMatch(
+ const std::vector<GURL>& scopes, const GURL& url, size_t* pos);
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698