OLD | NEW |
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_BROWSER_SHARED_WORKER_SHARED_WORKER_INSTANCE_H_ | 5 #ifndef CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_INSTANCE_H_ |
6 #define CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_INSTANCE_H_ | 6 #define CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_INSTANCE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // based on the algorithm in the WebWorkers spec - an instance matches if the | 59 // based on the algorithm in the WebWorkers spec - an instance matches if the |
60 // origins of the URLs match, and: | 60 // origins of the URLs match, and: |
61 // a) the names are non-empty and equal. | 61 // a) the names are non-empty and equal. |
62 // -or- | 62 // -or- |
63 // b) the names are both empty, and the urls are equal. | 63 // b) the names are both empty, and the urls are equal. |
64 bool Matches( | 64 bool Matches( |
65 const GURL& url, | 65 const GURL& url, |
66 const base::string16& name, | 66 const base::string16& name, |
67 const WorkerStoragePartition& partition, | 67 const WorkerStoragePartition& partition, |
68 ResourceContext* resource_context) const; | 68 ResourceContext* resource_context) const; |
| 69 static bool UrlNameMatches(const GURL& url1, |
| 70 const base::string16& name1, |
| 71 const GURL& url2, |
| 72 const base::string16& name2); |
69 | 73 |
70 // Accessors. | 74 // Accessors. |
71 bool closed() const { return closed_; } | 75 bool closed() const { return closed_; } |
72 void set_closed(bool closed) { closed_ = closed; } | 76 void set_closed(bool closed) { closed_ = closed; } |
73 const GURL& url() const { return url_; } | 77 const GURL& url() const { return url_; } |
74 const base::string16 name() const { return name_; } | 78 const base::string16 name() const { return name_; } |
75 const base::string16 content_security_policy() const { | 79 const base::string16 content_security_policy() const { |
76 return content_security_policy_; | 80 return content_security_policy_; |
77 } | 81 } |
78 blink::WebContentSecurityPolicyType security_policy_type() const { | 82 blink::WebContentSecurityPolicyType security_policy_type() const { |
(...skipping 21 matching lines...) Expand all Loading... |
100 scoped_refptr<WorkerDocumentSet> worker_document_set_; | 104 scoped_refptr<WorkerDocumentSet> worker_document_set_; |
101 ResourceContext* const resource_context_; | 105 ResourceContext* const resource_context_; |
102 WorkerStoragePartition partition_; | 106 WorkerStoragePartition partition_; |
103 bool load_failed_; | 107 bool load_failed_; |
104 }; | 108 }; |
105 | 109 |
106 } // namespace content | 110 } // namespace content |
107 | 111 |
108 | 112 |
109 #endif // CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_INSTANCE_H_ | 113 #endif // CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_INSTANCE_H_ |
OLD | NEW |