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

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

Issue 2378073002: Reland of ServiceWorker: Implement StartWorker by using mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 2 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 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 #ifndef CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_ 5 #ifndef CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_
6 #define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_ 6 #define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
(...skipping 28 matching lines...) Expand all
39 std::string* error_message); 39 std::string* error_message);
40 40
41 static bool ContainsDisallowedCharacter(const GURL& scope, 41 static bool ContainsDisallowedCharacter(const GURL& scope,
42 const GURL& script_url, 42 const GURL& script_url,
43 std::string* error_message); 43 std::string* error_message);
44 44
45 static bool CanRegisterServiceWorker(const GURL& context_url, 45 static bool CanRegisterServiceWorker(const GURL& context_url,
46 const GURL& pattern, 46 const GURL& pattern,
47 const GURL& script_url); 47 const GURL& script_url);
48 48
49 static bool IsMojoForServiceWorkerEnabled();
50
49 // Returns true when '--disable-web-security' flag is set. Otherwise returns 51 // Returns true when '--disable-web-security' flag is set. Otherwise returns
50 // whether the all origins of |urls| are same as the origin of |url|. 52 // whether the all origins of |urls| are same as the origin of |url|.
51 template <typename... Args> 53 template <typename... Args>
52 static bool PassOriginEqualitySecurityCheck(const GURL& url, 54 static bool PassOriginEqualitySecurityCheck(const GURL& url,
53 const Args&... urls) { 55 const Args&... urls) {
54 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 56 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
55 switches::kDisableWebSecurity)) 57 switches::kDisableWebSecurity))
56 return true; 58 return true;
57 for (const GURL& u : {urls...}) { 59 for (const GURL& u : {urls...}) {
58 if (url.GetOrigin() != u.GetOrigin()) 60 if (url.GetOrigin() != u.GetOrigin())
(...skipping 20 matching lines...) Expand all
79 private: 81 private:
80 const GURL url_; 82 const GURL url_;
81 GURL match_; 83 GURL match_;
82 84
83 DISALLOW_COPY_AND_ASSIGN(LongestScopeMatcher); 85 DISALLOW_COPY_AND_ASSIGN(LongestScopeMatcher);
84 }; 86 };
85 87
86 } // namespace content 88 } // namespace content
87 89
88 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_ 90 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_
OLDNEW
« no previous file with comments | « content/common/service_worker/embedded_worker_start_params.cc ('k') | content/common/service_worker/service_worker_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698