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

Side by Side Diff: content/browser/worker_host/worker_service_impl.cc

Issue 240843002: Reverse the embedded-shared-worker flag to turn the feature on by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/worker_host/worker_service_impl.h" 5 #include "content/browser/worker_host/worker_service_impl.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 } 229 }
230 230
231 WorkerService* WorkerService::GetInstance() { 231 WorkerService* WorkerService::GetInstance() {
232 if (EmbeddedSharedWorkerEnabled()) 232 if (EmbeddedSharedWorkerEnabled())
233 return SharedWorkerServiceImpl::GetInstance(); 233 return SharedWorkerServiceImpl::GetInstance();
234 else 234 else
235 return WorkerServiceImpl::GetInstance(); 235 return WorkerServiceImpl::GetInstance();
236 } 236 }
237 237
238 bool WorkerService::EmbeddedSharedWorkerEnabled() { 238 bool WorkerService::EmbeddedSharedWorkerEnabled() {
239 static bool enabled = CommandLine::ForCurrentProcess()->HasSwitch( 239 static bool disabled = CommandLine::ForCurrentProcess()->HasSwitch(
240 switches::kEnableEmbeddedSharedWorker); 240 switches::kDisableEmbeddedSharedWorker);
241 return enabled; 241 return !disabled;
242 } 242 }
243 243
244 WorkerServiceImpl* WorkerServiceImpl::GetInstance() { 244 WorkerServiceImpl* WorkerServiceImpl::GetInstance() {
245 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 245 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
246 return Singleton<WorkerServiceImpl>::get(); 246 return Singleton<WorkerServiceImpl>::get();
247 } 247 }
248 248
249 WorkerServiceImpl::WorkerServiceImpl() 249 WorkerServiceImpl::WorkerServiceImpl()
250 : priority_setter_(new WorkerPrioritySetter()), 250 : priority_setter_(new WorkerPrioritySetter()),
251 next_worker_route_id_(0) { 251 next_worker_route_id_(0) {
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 instance_iter != iter->mutable_instances().end(); 591 instance_iter != iter->mutable_instances().end();
592 ++instance_iter) { 592 ++instance_iter) {
593 if (instance_iter->Matches(url, name, partition, resource_context)) 593 if (instance_iter->Matches(url, name, partition, resource_context))
594 return &(*instance_iter); 594 return &(*instance_iter);
595 } 595 }
596 } 596 }
597 return NULL; 597 return NULL;
598 } 598 }
599 599
600 } // namespace content 600 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/worker_host/test/worker_browsertest.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698