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

Unified Diff: content/browser/shared_worker/shared_worker_instance.cc

Issue 258513002: Introduce WorkerStoragePartitionId and use it in SharedWorkerInstance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Hold WorkerStoragePartition in SharedWorkerMessageFilter 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/shared_worker/shared_worker_instance.cc
diff --git a/content/browser/shared_worker/shared_worker_instance.cc b/content/browser/shared_worker/shared_worker_instance.cc
index a4965a55085e323fbc12ceddbe838a5c60779448..ea8e02db7053dafa55d7c5a44a155e110b40b0cf 100644
--- a/content/browser/shared_worker/shared_worker_instance.cc
+++ b/content/browser/shared_worker/shared_worker_instance.cc
@@ -14,13 +14,13 @@ SharedWorkerInstance::SharedWorkerInstance(
const base::string16& content_security_policy,
blink::WebContentSecurityPolicyType security_policy_type,
ResourceContext* resource_context,
- const WorkerStoragePartition& partition)
+ const WorkerStoragePartitionId& partition_id)
: url_(url),
name_(name),
content_security_policy_(content_security_policy),
security_policy_type_(security_policy_type),
resource_context_(resource_context),
- partition_(partition) {
+ partition_id_(partition_id) {
DCHECK(resource_context_);
}
@@ -30,14 +30,15 @@ SharedWorkerInstance::SharedWorkerInstance(const SharedWorkerInstance& other)
content_security_policy_(other.content_security_policy_),
security_policy_type_(other.security_policy_type_),
resource_context_(other.resource_context_),
- partition_(other.partition_) {}
+ partition_id_(other.partition_id_) {
+}
SharedWorkerInstance::~SharedWorkerInstance() {}
bool SharedWorkerInstance::Matches(const GURL& match_url,
const base::string16& match_name,
- const WorkerStoragePartition& partition,
- ResourceContext* resource_context) const {
+ const WorkerStoragePartitionId& partition_id,
+ ResourceContext* resource_context) const {
// ResourceContext equivalence is being used as a proxy to ensure we only
// matched shared workers within the same BrowserContext.
if (resource_context_ != resource_context)
@@ -45,7 +46,7 @@ bool SharedWorkerInstance::Matches(const GURL& match_url,
// We must be in the same storage partition otherwise sharing will violate
// isolation.
- if (!partition_.Equals(partition))
+ if (!partition_id_.Equals(partition_id))
return false;
if (url_.GetOrigin() != match_url.GetOrigin())
@@ -58,8 +59,10 @@ bool SharedWorkerInstance::Matches(const GURL& match_url,
}
bool SharedWorkerInstance::Matches(const SharedWorkerInstance& other) const {
- return Matches(
- other.url(), other.name(), other.partition(), other.resource_context());
+ return Matches(other.url(),
+ other.name(),
+ other.partition_id(),
+ other.resource_context());
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698