Commit 2fad0960 authored by jyasskin@chromium.org's avatar jyasskin@chromium.org

Remove the unused source_process_id and provider_host arguments to SW unregistration.

Review URL: https://codereview.chromium.org/252893006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267087 0039d316-1c4b-4281-b951-d872f2087c98
parent 9a1526bb
...@@ -591,7 +591,6 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerBlackBoxBrowserTest, Registration) { ...@@ -591,7 +591,6 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerBlackBoxBrowserTest, Registration) {
base::RunLoop run_loop; base::RunLoop run_loop;
public_context()->UnregisterServiceWorker( public_context()->UnregisterServiceWorker(
embedded_test_server()->GetURL("/*"), embedded_test_server()->GetURL("/*"),
RenderProcessID(),
base::Bind(&ServiceWorkerBlackBoxBrowserTest::ExpectResultAndRun, base::Bind(&ServiceWorkerBlackBoxBrowserTest::ExpectResultAndRun,
true, true,
run_loop.QuitClosure())); run_loop.QuitClosure()));
...@@ -632,7 +631,6 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerBlackBoxBrowserTest, Registration) { ...@@ -632,7 +631,6 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerBlackBoxBrowserTest, Registration) {
base::RunLoop run_loop; base::RunLoop run_loop;
public_context()->UnregisterServiceWorker( public_context()->UnregisterServiceWorker(
embedded_test_server()->GetURL("/*"), embedded_test_server()->GetURL("/*"),
RenderProcessID(),
base::Bind(&ServiceWorkerBlackBoxBrowserTest::ExpectResultAndRun, base::Bind(&ServiceWorkerBlackBoxBrowserTest::ExpectResultAndRun,
true, true,
run_loop.QuitClosure())); run_loop.QuitClosure()));
......
...@@ -160,15 +160,10 @@ void ServiceWorkerContextCore::RegisterServiceWorker( ...@@ -160,15 +160,10 @@ void ServiceWorkerContextCore::RegisterServiceWorker(
void ServiceWorkerContextCore::UnregisterServiceWorker( void ServiceWorkerContextCore::UnregisterServiceWorker(
const GURL& pattern, const GURL& pattern,
int source_process_id,
ServiceWorkerProviderHost* provider_host,
const UnregistrationCallback& callback) { const UnregistrationCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_CURRENTLY_ON(BrowserThread::IO);
// TODO(kinuko): Wire the provider_host so that we can tell which document job_coordinator_->Unregister(pattern, callback);
// is calling .register.
job_coordinator_->Unregister(pattern, source_process_id, callback);
} }
void ServiceWorkerContextCore::RegistrationComplete( void ServiceWorkerContextCore::RegistrationComplete(
......
...@@ -138,8 +138,6 @@ class CONTENT_EXPORT ServiceWorkerContextCore ...@@ -138,8 +138,6 @@ class CONTENT_EXPORT ServiceWorkerContextCore
// The callback will be called on the IO thread. // The callback will be called on the IO thread.
void UnregisterServiceWorker(const GURL& pattern, void UnregisterServiceWorker(const GURL& pattern,
int source_process_id,
ServiceWorkerProviderHost* provider_host,
const UnregistrationCallback& callback); const UnregistrationCallback& callback);
// This class maintains collections of live instances, this class // This class maintains collections of live instances, this class
......
...@@ -265,8 +265,8 @@ TEST_F(ServiceWorkerContextTest, Unregister) { ...@@ -265,8 +265,8 @@ TEST_F(ServiceWorkerContextTest, Unregister) {
EXPECT_NE(kInvalidServiceWorkerVersionId, version_id); EXPECT_NE(kInvalidServiceWorkerVersionId, version_id);
called = false; called = false;
context()->UnregisterServiceWorker( context()->UnregisterServiceWorker(pattern,
pattern, render_process_id_, NULL, MakeUnregisteredCallback(&called)); MakeUnregisteredCallback(&called));
ASSERT_FALSE(called); ASSERT_FALSE(called);
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
......
...@@ -109,7 +109,6 @@ static void FinishUnregistrationOnIO( ...@@ -109,7 +109,6 @@ static void FinishUnregistrationOnIO(
void ServiceWorkerContextWrapper::UnregisterServiceWorker( void ServiceWorkerContextWrapper::UnregisterServiceWorker(
const GURL& pattern, const GURL& pattern,
int source_process_id,
const ResultCallback& continuation) { const ResultCallback& continuation) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
BrowserThread::PostTask( BrowserThread::PostTask(
...@@ -118,15 +117,12 @@ void ServiceWorkerContextWrapper::UnregisterServiceWorker( ...@@ -118,15 +117,12 @@ void ServiceWorkerContextWrapper::UnregisterServiceWorker(
base::Bind(&ServiceWorkerContextWrapper::UnregisterServiceWorker, base::Bind(&ServiceWorkerContextWrapper::UnregisterServiceWorker,
this, this,
pattern, pattern,
source_process_id,
continuation)); continuation));
return; return;
} }
context()->UnregisterServiceWorker( context()->UnregisterServiceWorker(
pattern, pattern,
source_process_id,
NULL /* provider_host */,
base::Bind(&FinishUnregistrationOnIO, continuation)); base::Bind(&FinishUnregistrationOnIO, continuation));
} }
......
...@@ -53,7 +53,6 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper ...@@ -53,7 +53,6 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper
const GURL& script_url, const GURL& script_url,
const ResultCallback& continuation) OVERRIDE; const ResultCallback& continuation) OVERRIDE;
virtual void UnregisterServiceWorker(const GURL& pattern, virtual void UnregisterServiceWorker(const GURL& pattern,
int source_process_id,
const ResultCallback& continuation) const ResultCallback& continuation)
OVERRIDE; OVERRIDE;
......
...@@ -216,8 +216,6 @@ void ServiceWorkerDispatcherHost::OnUnregisterServiceWorker( ...@@ -216,8 +216,6 @@ void ServiceWorkerDispatcherHost::OnUnregisterServiceWorker(
context_->UnregisterServiceWorker( context_->UnregisterServiceWorker(
pattern, pattern,
render_process_id_,
provider_host,
base::Bind(&ServiceWorkerDispatcherHost::UnregistrationComplete, base::Bind(&ServiceWorkerDispatcherHost::UnregistrationComplete,
this, this,
thread_id, thread_id,
......
...@@ -404,8 +404,6 @@ void ServiceWorkerInternalsUI::OperationProxy::UnregisterOnIOThread( ...@@ -404,8 +404,6 @@ void ServiceWorkerInternalsUI::OperationProxy::UnregisterOnIOThread(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
context->context()->UnregisterServiceWorker( context->context()->UnregisterServiceWorker(
scope, scope,
0, // render process id?
NULL, // provider_host
base::Bind(&ServiceWorkerInternalsUI::OperationProxy::OperationComplete, base::Bind(&ServiceWorkerInternalsUI::OperationProxy::OperationComplete,
this)); this));
} }
......
...@@ -65,7 +65,6 @@ void ServiceWorkerJobCoordinator::Register( ...@@ -65,7 +65,6 @@ void ServiceWorkerJobCoordinator::Register(
void ServiceWorkerJobCoordinator::Unregister( void ServiceWorkerJobCoordinator::Unregister(
const GURL& pattern, const GURL& pattern,
int source_process_id,
const ServiceWorkerUnregisterJob::UnregistrationCallback& callback) { const ServiceWorkerUnregisterJob::UnregistrationCallback& callback) {
scoped_ptr<ServiceWorkerRegisterJobBase> job( scoped_ptr<ServiceWorkerRegisterJobBase> job(
new ServiceWorkerUnregisterJob(context_, pattern)); new ServiceWorkerUnregisterJob(context_, pattern));
......
...@@ -33,7 +33,6 @@ class CONTENT_EXPORT ServiceWorkerJobCoordinator { ...@@ -33,7 +33,6 @@ class CONTENT_EXPORT ServiceWorkerJobCoordinator {
void Unregister( void Unregister(
const GURL& pattern, const GURL& pattern,
int source_process_id,
const ServiceWorkerUnregisterJob::UnregistrationCallback& callback); const ServiceWorkerUnregisterJob::UnregistrationCallback& callback);
// Jobs are removed whenever they are finished or canceled. // Jobs are removed whenever they are finished or canceled.
......
...@@ -245,7 +245,6 @@ TEST_F(ServiceWorkerJobTest, Unregister) { ...@@ -245,7 +245,6 @@ TEST_F(ServiceWorkerJobTest, Unregister) {
ASSERT_TRUE(called); ASSERT_TRUE(called);
job_coordinator()->Unregister(pattern, job_coordinator()->Unregister(pattern,
render_process_id_,
SaveUnregistration(SERVICE_WORKER_OK, &called)); SaveUnregistration(SERVICE_WORKER_OK, &called));
ASSERT_FALSE(called); ASSERT_FALSE(called);
...@@ -271,7 +270,6 @@ TEST_F(ServiceWorkerJobTest, Unregister_NothingRegistered) { ...@@ -271,7 +270,6 @@ TEST_F(ServiceWorkerJobTest, Unregister_NothingRegistered) {
bool called; bool called;
job_coordinator()->Unregister(pattern, job_coordinator()->Unregister(pattern,
render_process_id_,
SaveUnregistration(SERVICE_WORKER_OK, &called)); SaveUnregistration(SERVICE_WORKER_OK, &called));
ASSERT_FALSE(called); ASSERT_FALSE(called);
...@@ -445,7 +443,6 @@ TEST_F(ServiceWorkerJobTest, ParallelRegUnreg) { ...@@ -445,7 +443,6 @@ TEST_F(ServiceWorkerJobTest, ParallelRegUnreg) {
bool unregistration_called = false; bool unregistration_called = false;
job_coordinator()->Unregister( job_coordinator()->Unregister(
pattern, pattern,
render_process_id_,
SaveUnregistration(SERVICE_WORKER_OK, &unregistration_called)); SaveUnregistration(SERVICE_WORKER_OK, &unregistration_called));
ASSERT_FALSE(registration_called); ASSERT_FALSE(registration_called);
...@@ -561,14 +558,11 @@ TEST_F(ServiceWorkerJobTest, ParallelUnreg) { ...@@ -561,14 +558,11 @@ TEST_F(ServiceWorkerJobTest, ParallelUnreg) {
bool unregistration1_called = false; bool unregistration1_called = false;
job_coordinator()->Unregister( job_coordinator()->Unregister(
pattern, pattern,
render_process_id_,
SaveUnregistration(SERVICE_WORKER_OK, &unregistration1_called)); SaveUnregistration(SERVICE_WORKER_OK, &unregistration1_called));
bool unregistration2_called = false; bool unregistration2_called = false;
job_coordinator()->Unregister( job_coordinator()->Unregister(
pattern, pattern, SaveUnregistration(SERVICE_WORKER_OK, &unregistration2_called));
render_process_id_,
SaveUnregistration(SERVICE_WORKER_OK, &unregistration2_called));
ASSERT_FALSE(unregistration1_called); ASSERT_FALSE(unregistration1_called);
ASSERT_FALSE(unregistration2_called); ASSERT_FALSE(unregistration2_called);
......
...@@ -37,15 +37,14 @@ class ServiceWorkerContext { ...@@ -37,15 +37,14 @@ class ServiceWorkerContext {
const ResultCallback& callback) = 0; const ResultCallback& callback) = 0;
// Equivalent to calling navigator.serviceWorker.unregister(pattern) from a // Equivalent to calling navigator.serviceWorker.unregister(pattern) from a
// renderer in |source_process_id|, except that |pattern| is an absolute URL // renderer, except that |pattern| is an absolute URL instead of relative to
// instead of relative to some current origin. |callback| is passed true // some current origin. |callback| is passed true when the JS promise is
// when the JS promise is fulfilled or false when the JS promise is rejected. // fulfilled or false when the JS promise is rejected.
// //
// Unregistration can fail if: // Unregistration can fail if:
// * No Service Worker was registered for |pattern|. // * No Service Worker was registered for |pattern|.
// * Something unexpected goes wrong, like a renderer crash. // * Something unexpected goes wrong, like a renderer crash.
virtual void UnregisterServiceWorker(const Scope& pattern, virtual void UnregisterServiceWorker(const Scope& pattern,
int source_process_id,
const ResultCallback& callback) = 0; const ResultCallback& callback) = 0;
// TODO(jyasskin): Provide a way to SendMessage to a Scope. // TODO(jyasskin): Provide a way to SendMessage to a Scope.
......
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