| Index: content/common/service_worker/service_worker_utils.cc
|
| diff --git a/content/common/service_worker/service_worker_utils.cc b/content/common/service_worker/service_worker_utils.cc
|
| index 3a4971fc4ec7cd75a1cd022eba2e40853a891811..6409a3bad87ce50695351e33f0a7fcacce8091d3 100644
|
| --- a/content/common/service_worker/service_worker_utils.cc
|
| +++ b/content/common/service_worker/service_worker_utils.cc
|
| @@ -6,8 +6,10 @@
|
|
|
| #include <string>
|
|
|
| +#include "base/command_line.h"
|
| #include "base/logging.h"
|
| #include "base/strings/string_util.h"
|
| +#include "content/public/common/content_switches.h"
|
| #include "content/public/common/origin_util.h"
|
|
|
| namespace content {
|
| @@ -116,7 +118,9 @@ bool ServiceWorkerUtils::CanRegisterServiceWorker(const GURL& context_url,
|
| DCHECK(context_url.is_valid());
|
| DCHECK(pattern.is_valid());
|
| DCHECK(script_url.is_valid());
|
| - return AllOriginsMatch(context_url, pattern, script_url) &&
|
| + return (AllOriginsMatch(context_url, pattern, script_url) ||
|
| + base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kDisableWebSecurity)) &&
|
| OriginCanAccessServiceWorkers(context_url) &&
|
| OriginCanAccessServiceWorkers(pattern) &&
|
| OriginCanAccessServiceWorkers(script_url);
|
|
|