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

Side by Side 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: remake (drop the exact-match) Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_
7 7
8 #include "content/common/content_export.h" 8 #include "content/common/content_export.h"
9 #include "content/common/service_worker/service_worker_status_code.h" 9 #include "content/common/service_worker/service_worker_status_code.h"
10 #include "webkit/common/resource_type.h" 10 #include "webkit/common/resource_type.h"
(...skipping 13 matching lines...) Expand all
24 24
25 // Returns true if the feature is enabled (or not disabled) by command-line 25 // Returns true if the feature is enabled (or not disabled) by command-line
26 // flag. 26 // flag.
27 static bool IsFeatureEnabled(); 27 static bool IsFeatureEnabled();
28 28
29 // A helper for creating a do-nothing status callback. 29 // A helper for creating a do-nothing status callback.
30 static void NoOpStatusCallback(ServiceWorkerStatusCode status) {} 30 static void NoOpStatusCallback(ServiceWorkerStatusCode status) {}
31 31
32 // Returns true if |scope| matches |url|. 32 // Returns true if |scope| matches |url|.
33 CONTENT_EXPORT static bool ScopeMatches(const GURL& scope, const GURL& url); 33 CONTENT_EXPORT static bool ScopeMatches(const GURL& scope, const GURL& url);
34
35 // Finds a scope that matches |url| longest from |scopes|. Returns true and
36 // fills |pos| with a position of the scope in |scopes| if it's found.
37 CONTENT_EXPORT static bool FindLongestScopeMatch(
38 const std::vector<GURL>& scopes, const GURL& url, size_t* pos);
34 }; 39 };
35 40
36 } // namespace content 41 } // namespace content
37 42
38 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_ 43 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698