Commit b7f40445 authored by Nidhi Jaju's avatar Nidhi Jaju Committed by Commit Bot

Remove unnecessary GetOrigin() when using url::Origin::Create()

Bug: 1095896
Change-Id: I6b799e6b02c7073b130b4046cc83941c0a00c154
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2294759Reviewed-by: default avatarKenichi Ishibashi <bashi@chromium.org>
Commit-Queue: Nidhi Jaju <nidhijaju@google.com>
Cr-Commit-Position: refs/heads/master@{#787679}
parent 3d7b09dd
...@@ -353,7 +353,7 @@ void ServiceWorkerContextWrapper::OnRegistrationStored(int64_t registration_id, ...@@ -353,7 +353,7 @@ void ServiceWorkerContextWrapper::OnRegistrationStored(int64_t registration_id,
const GURL& scope) { const GURL& scope) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
registered_origins_.insert(url::Origin::Create(scope.GetOrigin())); registered_origins_.insert(url::Origin::Create(scope));
for (auto& observer : observer_list_) for (auto& observer : observer_list_)
observer.OnRegistrationStored(registration_id, scope); observer.OnRegistrationStored(registration_id, scope);
......
...@@ -258,7 +258,7 @@ TEST_F(ServiceWorkerContextWrapperTest, GetInstalledRegistrationOrigins_Empty) { ...@@ -258,7 +258,7 @@ TEST_F(ServiceWorkerContextWrapperTest, GetInstalledRegistrationOrigins_Empty) {
TEST_F(ServiceWorkerContextWrapperTest, GetInstalledRegistrationOrigins_One) { TEST_F(ServiceWorkerContextWrapperTest, GetInstalledRegistrationOrigins_One) {
const GURL scope("https://example.com/"); const GURL scope("https://example.com/");
const GURL script("https://example.com/sw.js"); const GURL script("https://example.com/sw.js");
const url::Origin origin = url::Origin::Create(scope.GetOrigin()); const url::Origin origin = url::Origin::Create(scope);
wrapper_->WaitForRegistrationsInitializedForTest(); wrapper_->WaitForRegistrationsInitializedForTest();
scoped_refptr<ServiceWorkerRegistration> registration = scoped_refptr<ServiceWorkerRegistration> registration =
...@@ -279,7 +279,7 @@ TEST_F(ServiceWorkerContextWrapperTest, ...@@ -279,7 +279,7 @@ TEST_F(ServiceWorkerContextWrapperTest,
GetInstalledRegistrationOrigins_SameOrigin) { GetInstalledRegistrationOrigins_SameOrigin) {
const GURL scope1("https://example.com/foo"); const GURL scope1("https://example.com/foo");
const GURL script1("https://example.com/foo/sw.js"); const GURL script1("https://example.com/foo/sw.js");
const url::Origin origin = url::Origin::Create(scope1.GetOrigin()); const url::Origin origin = url::Origin::Create(scope1);
const GURL scope2("https://example.com/bar"); const GURL scope2("https://example.com/bar");
const GURL script2("https://example.com/bar/sw.js"); const GURL script2("https://example.com/bar/sw.js");
...@@ -308,10 +308,10 @@ TEST_F(ServiceWorkerContextWrapperTest, ...@@ -308,10 +308,10 @@ TEST_F(ServiceWorkerContextWrapperTest,
GetInstalledRegistrationOrigins_DifferentOrigin) { GetInstalledRegistrationOrigins_DifferentOrigin) {
const GURL scope1("https://example1.com/foo"); const GURL scope1("https://example1.com/foo");
const GURL script1("https://example1.com/foo/sw.js"); const GURL script1("https://example1.com/foo/sw.js");
const url::Origin origin1 = url::Origin::Create(scope1.GetOrigin()); const url::Origin origin1 = url::Origin::Create(scope1);
const GURL scope2("https://example2.com/bar"); const GURL scope2("https://example2.com/bar");
const GURL script2("https://example2.com/bar/sw.js"); const GURL script2("https://example2.com/bar/sw.js");
const url::Origin origin2 = url::Origin::Create(scope2.GetOrigin()); const url::Origin origin2 = url::Origin::Create(scope2);
wrapper_->WaitForRegistrationsInitializedForTest(); wrapper_->WaitForRegistrationsInitializedForTest();
...@@ -339,7 +339,7 @@ TEST_F(ServiceWorkerContextWrapperTest, ...@@ -339,7 +339,7 @@ TEST_F(ServiceWorkerContextWrapperTest,
GetInstalledRegistrationOrigins_HostFilterMatch) { GetInstalledRegistrationOrigins_HostFilterMatch) {
const GURL scope("https://example.com/"); const GURL scope("https://example.com/");
const GURL script("https://example.com/sw.js"); const GURL script("https://example.com/sw.js");
const url::Origin origin = url::Origin::Create(scope.GetOrigin()); const url::Origin origin = url::Origin::Create(scope);
wrapper_->WaitForRegistrationsInitializedForTest(); wrapper_->WaitForRegistrationsInitializedForTest();
scoped_refptr<ServiceWorkerRegistration> registration = scoped_refptr<ServiceWorkerRegistration> registration =
...@@ -360,7 +360,7 @@ TEST_F(ServiceWorkerContextWrapperTest, ...@@ -360,7 +360,7 @@ TEST_F(ServiceWorkerContextWrapperTest,
GetInstalledRegistrationOrigins_HostFilterNoMatch) { GetInstalledRegistrationOrigins_HostFilterNoMatch) {
const GURL scope("https://example.com/"); const GURL scope("https://example.com/");
const GURL script("https://example.com/sw.js"); const GURL script("https://example.com/sw.js");
const url::Origin origin = url::Origin::Create(scope.GetOrigin()); const url::Origin origin = url::Origin::Create(scope);
wrapper_->WaitForRegistrationsInitializedForTest(); wrapper_->WaitForRegistrationsInitializedForTest();
scoped_refptr<ServiceWorkerRegistration> registration = scoped_refptr<ServiceWorkerRegistration> registration =
...@@ -380,10 +380,10 @@ TEST_F(ServiceWorkerContextWrapperTest, ...@@ -380,10 +380,10 @@ TEST_F(ServiceWorkerContextWrapperTest,
GetInstalledRegistrationOrigins_DeletedRegistration) { GetInstalledRegistrationOrigins_DeletedRegistration) {
const GURL scope1("https://example1.com/foo"); const GURL scope1("https://example1.com/foo");
const GURL script1("https://example1.com/foo/sw.js"); const GURL script1("https://example1.com/foo/sw.js");
const url::Origin origin1 = url::Origin::Create(scope1.GetOrigin()); const url::Origin origin1 = url::Origin::Create(scope1);
const GURL scope2("https://example2.com/bar"); const GURL scope2("https://example2.com/bar");
const GURL script2("https://example2.com/bar/sw.js"); const GURL script2("https://example2.com/bar/sw.js");
const url::Origin origin2 = url::Origin::Create(scope2.GetOrigin()); const url::Origin origin2 = url::Origin::Create(scope2);
wrapper_->WaitForRegistrationsInitializedForTest(); wrapper_->WaitForRegistrationsInitializedForTest();
......
...@@ -1185,8 +1185,7 @@ void ServiceWorkerRegistry::DidStoreRegistration( ...@@ -1185,8 +1185,7 @@ void ServiceWorkerRegistry::DidStoreRegistration(
context_->NotifyRegistrationStored(stored_registration_id, stored_scope); context_->NotifyRegistrationStored(stored_registration_id, stored_scope);
if (special_storage_policy_) { if (special_storage_policy_) {
EnsureRegisteredOriginIsTracked( EnsureRegisteredOriginIsTracked(url::Origin::Create(stored_scope));
url::Origin::Create(stored_scope.GetOrigin()));
OnStoragePolicyChanged(); OnStoragePolicyChanged();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment