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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_
8 #include "content/common/content_export.h"
9 #include "webkit/common/resource_type.h"
13 class ServiceWorkerUtils
{
15 static bool IsMainResourceType(ResourceType::Type type
) {
16 return ResourceType::IsFrame(type
) ||
17 ResourceType::IsSharedWorker(type
);
20 static bool IsServiceWorkerResourceType(ResourceType::Type type
) {
21 return ResourceType::IsServiceWorker(type
);
24 // Returns true if the feature is enabled (or not disabled) by command-line
26 static bool IsFeatureEnabled();
28 // Returns true if |scope| matches |url|.
29 CONTENT_EXPORT
static bool ScopeMatches(const GURL
& scope
, const GURL
& url
);
32 } // namespace content
34 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_