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

Side by Side Diff: extensions/common/manifest_handlers/background_info.cc

Issue 339973003: Remove --enable-service-worker flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
« no previous file with comments | « extensions/common/manifest_constants.cc ('k') | tools/perf/benchmarks/service_worker.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "extensions/common/manifest_handlers/background_info.h" 5 #include "extensions/common/manifest_handlers/background_info.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 133 }
134 134
135 bool BackgroundInfo::LoadServiceWorkerScript(const Extension* extension, 135 bool BackgroundInfo::LoadServiceWorkerScript(const Extension* extension,
136 const std::string& key, 136 const std::string& key,
137 base::string16* error) { 137 base::string16* error) {
138 const base::Value* service_worker_script_value = NULL; 138 const base::Value* service_worker_script_value = NULL;
139 if (!extension->manifest()->Get(key, &service_worker_script_value)) 139 if (!extension->manifest()->Get(key, &service_worker_script_value))
140 return true; 140 return true;
141 141
142 if (!CommandLine::ForCurrentProcess()->HasSwitch( 142 if (!CommandLine::ForCurrentProcess()->HasSwitch(
143 ::switches::kEnableServiceWorker)) { 143 ::switches::kEnableExperimentalWebPlatformFeatures)) {
144 *error = ASCIIToUTF16(errors::kServiceWorkerRequiresFlag); 144 *error = ASCIIToUTF16(errors::kServiceWorkerRequiresFlag);
145 return false; 145 return false;
146 } 146 }
147 147
148 CHECK(service_worker_script_value); 148 CHECK(service_worker_script_value);
149 if (!service_worker_script_value->GetAsString(&service_worker_script_)) { 149 if (!service_worker_script_value->GetAsString(&service_worker_script_)) {
150 *error = ASCIIToUTF16(errors::kInvalidServiceWorkerScript); 150 *error = ASCIIToUTF16(errors::kInvalidServiceWorkerScript);
151 return false; 151 return false;
152 } 152 }
153 return true; 153 return true;
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 keys::kBackgroundPageLegacy, 353 keys::kBackgroundPageLegacy,
354 keys::kBackgroundPersistent, 354 keys::kBackgroundPersistent,
355 keys::kBackgroundScripts, 355 keys::kBackgroundScripts,
356 keys::kPlatformAppBackgroundPage, 356 keys::kPlatformAppBackgroundPage,
357 keys::kPlatformAppBackgroundScripts, 357 keys::kPlatformAppBackgroundScripts,
358 keys::kPlatformAppServiceWorkerScript}; 358 keys::kPlatformAppServiceWorkerScript};
359 return std::vector<std::string>(keys, keys + arraysize(keys)); 359 return std::vector<std::string>(keys, keys + arraysize(keys));
360 } 360 }
361 361
362 } // namespace extensions 362 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/manifest_constants.cc ('k') | tools/perf/benchmarks/service_worker.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698