OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/browser/service_worker/service_worker_context.h" | 5 #include "content/browser/service_worker/service_worker_context.h" |
6 | 6 |
| 7 #include "base/command_line.h" |
7 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "content/public/common/content_switches.h" |
8 #include "webkit/browser/quota/quota_manager.h" | 10 #include "webkit/browser/quota/quota_manager.h" |
9 | 11 |
10 namespace content { | 12 namespace content { |
11 | 13 |
12 const base::FilePath::CharType kServiceWorkerDirectory[] = | 14 const base::FilePath::CharType kServiceWorkerDirectory[] = |
13 FILE_PATH_LITERAL("ServiceWorker"); | 15 FILE_PATH_LITERAL("ServiceWorker"); |
14 | 16 |
15 ServiceWorkerContext::ServiceWorkerContext( | 17 ServiceWorkerContext::ServiceWorkerContext( |
16 const base::FilePath& path, | 18 const base::FilePath& path, |
17 quota::QuotaManagerProxy* quota_manager_proxy) | 19 quota::QuotaManagerProxy* quota_manager_proxy) |
18 : quota_manager_proxy_(quota_manager_proxy) { | 20 : quota_manager_proxy_(quota_manager_proxy) { |
19 if (!path.empty()) | 21 if (!path.empty()) |
20 path_ = path.Append(kServiceWorkerDirectory); | 22 path_ = path.Append(kServiceWorkerDirectory); |
21 } | 23 } |
22 | 24 |
| 25 bool ServiceWorkerContext::IsEnabled() { |
| 26 return CommandLine::ForCurrentProcess()->HasSwitch( |
| 27 switches::kEnableServiceWorker); |
| 28 } |
| 29 |
23 ServiceWorkerContext::~ServiceWorkerContext() {} | 30 ServiceWorkerContext::~ServiceWorkerContext() {} |
24 | 31 |
25 } // namespace content | 32 } // namespace content |
OLD | NEW |