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

Side by Side Diff: content/common/service_worker/service_worker_utils.cc

Issue 2443983002: Revert of Use the serviceworker with mojo by default (Closed)
Patch Set: Created 4 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 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 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/common/service_worker/service_worker_utils.h" 5 #include "content/common/service_worker/service_worker_utils.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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 const GURL& first = urls.front(); 127 const GURL& first = urls.front();
128 for (const GURL& url : urls) { 128 for (const GURL& url : urls) {
129 if (first.GetOrigin() != url.GetOrigin()) 129 if (first.GetOrigin() != url.GetOrigin())
130 return false; 130 return false;
131 } 131 }
132 return true; 132 return true;
133 } 133 }
134 134
135 // static 135 // static
136 bool ServiceWorkerUtils::IsMojoForServiceWorkerEnabled() { 136 bool ServiceWorkerUtils::IsMojoForServiceWorkerEnabled() {
137 return !base::CommandLine::ForCurrentProcess()->HasSwitch( 137 return base::CommandLine::ForCurrentProcess()->HasSwitch(
138 switches::kDisableMojoServiceWorker); 138 switches::kMojoServiceWorker);
139 } 139 }
140 140
141 bool LongestScopeMatcher::MatchLongest(const GURL& scope) { 141 bool LongestScopeMatcher::MatchLongest(const GURL& scope) {
142 if (!ServiceWorkerUtils::ScopeMatches(scope, url_)) 142 if (!ServiceWorkerUtils::ScopeMatches(scope, url_))
143 return false; 143 return false;
144 if (match_.is_empty() || match_.spec().size() < scope.spec().size()) { 144 if (match_.is_empty() || match_.spec().size() < scope.spec().size()) {
145 match_ = scope; 145 match_ = scope;
146 return true; 146 return true;
147 } 147 }
148 return false; 148 return false;
149 } 149 }
150 150
151 } // namespace content 151 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_test_utils.h ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698