Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / content / browser / service_worker / service_worker_utils.h
blob38669c4317648145870670961284df7a64f50aed
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 "content/common/service_worker/service_worker_status_code.h"
10 #include "webkit/common/resource_type.h"
12 namespace content {
14 class ServiceWorkerUtils {
15 public:
16 static bool IsMainResourceType(ResourceType::Type type) {
17 return ResourceType::IsFrame(type) ||
18 ResourceType::IsSharedWorker(type);
21 static bool IsServiceWorkerResourceType(ResourceType::Type type) {
22 return ResourceType::IsServiceWorker(type);
25 // Returns true if the feature is enabled (or not disabled) by command-line
26 // flag.
27 static bool IsFeatureEnabled();
29 // A helper for creating a do-nothing status callback.
30 static void NoOpStatusCallback(ServiceWorkerStatusCode status) {}
32 // Returns true if |scope| matches |url|.
33 CONTENT_EXPORT static bool ScopeMatches(const GURL& scope, const GURL& url);
36 } // namespace content
38 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_