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

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

Issue 304423004: ServiceWorker: Scope should match url in longest-prefix-match way (won't commit) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compile error 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..4163132b5c6ada8b104224bcc153829f83b25a7c 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>
+
#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 {
@@ -31,6 +35,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