diff options
author | jyasskin@chromium.org <jyasskin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-30 05:27:40 +0000 |
---|---|---|
committer | jyasskin@chromium.org <jyasskin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-30 05:27:40 +0000 |
commit | 2fad0960a52b84e195f57d5bd73980f6e8fc0546 (patch) | |
tree | f2be558e8cc739311609f9d0f0d3e0401b84d329 | |
parent | 9a1526bb002f7bd1af34b24ee24b4587a5e74f76 (diff) | |
download | chromium_src-2fad0960a52b84e195f57d5bd73980f6e8fc0546.zip chromium_src-2fad0960a52b84e195f57d5bd73980f6e8fc0546.tar.gz chromium_src-2fad0960a52b84e195f57d5bd73980f6e8fc0546.tar.bz2 |
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
12 files changed, 7 insertions, 34 deletions
diff --git a/content/browser/service_worker/service_worker_browsertest.cc b/content/browser/service_worker/service_worker_browsertest.cc index 6ab1e7d..9b32308 100644 --- a/content/browser/service_worker/service_worker_browsertest.cc +++ b/content/browser/service_worker/service_worker_browsertest.cc @@ -591,7 +591,6 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerBlackBoxBrowserTest, Registration) { base::RunLoop run_loop; public_context()->UnregisterServiceWorker( embedded_test_server()->GetURL("/*"), - RenderProcessID(), base::Bind(&ServiceWorkerBlackBoxBrowserTest::ExpectResultAndRun, true, run_loop.QuitClosure())); @@ -632,7 +631,6 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerBlackBoxBrowserTest, Registration) { base::RunLoop run_loop; public_context()->UnregisterServiceWorker( embedded_test_server()->GetURL("/*"), - RenderProcessID(), base::Bind(&ServiceWorkerBlackBoxBrowserTest::ExpectResultAndRun, true, run_loop.QuitClosure())); diff --git a/content/browser/service_worker/service_worker_context_core.cc b/content/browser/service_worker/service_worker_context_core.cc index 910b33c..d654661 100644 --- a/content/browser/service_worker/service_worker_context_core.cc +++ b/content/browser/service_worker/service_worker_context_core.cc @@ -160,15 +160,10 @@ void ServiceWorkerContextCore::RegisterServiceWorker( void ServiceWorkerContextCore::UnregisterServiceWorker( const GURL& pattern, - int source_process_id, - ServiceWorkerProviderHost* provider_host, const UnregistrationCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - // TODO(kinuko): Wire the provider_host so that we can tell which document - // is calling .register. - - job_coordinator_->Unregister(pattern, source_process_id, callback); + job_coordinator_->Unregister(pattern, callback); } void ServiceWorkerContextCore::RegistrationComplete( diff --git a/content/browser/service_worker/service_worker_context_core.h b/content/browser/service_worker/service_worker_context_core.h index a8cdc41..55d64ae 100644 --- a/content/browser/service_worker/service_worker_context_core.h +++ b/content/browser/service_worker/service_worker_context_core.h @@ -138,8 +138,6 @@ class CONTENT_EXPORT ServiceWorkerContextCore // The callback will be called on the IO thread. void UnregisterServiceWorker(const GURL& pattern, - int source_process_id, - ServiceWorkerProviderHost* provider_host, const UnregistrationCallback& callback); // This class maintains collections of live instances, this class diff --git a/content/browser/service_worker/service_worker_context_unittest.cc b/content/browser/service_worker/service_worker_context_unittest.cc index 00e9527..dc174bd 100644 --- a/content/browser/service_worker/service_worker_context_unittest.cc +++ b/content/browser/service_worker/service_worker_context_unittest.cc @@ -265,8 +265,8 @@ TEST_F(ServiceWorkerContextTest, Unregister) { EXPECT_NE(kInvalidServiceWorkerVersionId, version_id); called = false; - context()->UnregisterServiceWorker( - pattern, render_process_id_, NULL, MakeUnregisteredCallback(&called)); + context()->UnregisterServiceWorker(pattern, + MakeUnregisteredCallback(&called)); ASSERT_FALSE(called); base::RunLoop().RunUntilIdle(); diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc index 8f64134..ced70e2 100644 --- a/content/browser/service_worker/service_worker_context_wrapper.cc +++ b/content/browser/service_worker/service_worker_context_wrapper.cc @@ -109,7 +109,6 @@ static void FinishUnregistrationOnIO( void ServiceWorkerContextWrapper::UnregisterServiceWorker( const GURL& pattern, - int source_process_id, const ResultCallback& continuation) { if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { BrowserThread::PostTask( @@ -118,15 +117,12 @@ void ServiceWorkerContextWrapper::UnregisterServiceWorker( base::Bind(&ServiceWorkerContextWrapper::UnregisterServiceWorker, this, pattern, - source_process_id, continuation)); return; } context()->UnregisterServiceWorker( pattern, - source_process_id, - NULL /* provider_host */, base::Bind(&FinishUnregistrationOnIO, continuation)); } diff --git a/content/browser/service_worker/service_worker_context_wrapper.h b/content/browser/service_worker/service_worker_context_wrapper.h index bd83210..6d53549 100644 --- a/content/browser/service_worker/service_worker_context_wrapper.h +++ b/content/browser/service_worker/service_worker_context_wrapper.h @@ -53,7 +53,6 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper const GURL& script_url, const ResultCallback& continuation) OVERRIDE; virtual void UnregisterServiceWorker(const GURL& pattern, - int source_process_id, const ResultCallback& continuation) OVERRIDE; diff --git a/content/browser/service_worker/service_worker_dispatcher_host.cc b/content/browser/service_worker/service_worker_dispatcher_host.cc index ec6a839..f36af07 100644 --- a/content/browser/service_worker/service_worker_dispatcher_host.cc +++ b/content/browser/service_worker/service_worker_dispatcher_host.cc @@ -216,8 +216,6 @@ void ServiceWorkerDispatcherHost::OnUnregisterServiceWorker( context_->UnregisterServiceWorker( pattern, - render_process_id_, - provider_host, base::Bind(&ServiceWorkerDispatcherHost::UnregistrationComplete, this, thread_id, diff --git a/content/browser/service_worker/service_worker_internals_ui.cc b/content/browser/service_worker/service_worker_internals_ui.cc index 950816c..9e0ab94 100644 --- a/content/browser/service_worker/service_worker_internals_ui.cc +++ b/content/browser/service_worker/service_worker_internals_ui.cc @@ -404,8 +404,6 @@ void ServiceWorkerInternalsUI::OperationProxy::UnregisterOnIOThread( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); context->context()->UnregisterServiceWorker( scope, - 0, // render process id? - NULL, // provider_host base::Bind(&ServiceWorkerInternalsUI::OperationProxy::OperationComplete, this)); } diff --git a/content/browser/service_worker/service_worker_job_coordinator.cc b/content/browser/service_worker/service_worker_job_coordinator.cc index 29adb28..ccf42b0 100644 --- a/content/browser/service_worker/service_worker_job_coordinator.cc +++ b/content/browser/service_worker/service_worker_job_coordinator.cc @@ -65,7 +65,6 @@ void ServiceWorkerJobCoordinator::Register( void ServiceWorkerJobCoordinator::Unregister( const GURL& pattern, - int source_process_id, const ServiceWorkerUnregisterJob::UnregistrationCallback& callback) { scoped_ptr<ServiceWorkerRegisterJobBase> job( new ServiceWorkerUnregisterJob(context_, pattern)); diff --git a/content/browser/service_worker/service_worker_job_coordinator.h b/content/browser/service_worker/service_worker_job_coordinator.h index 167f2a8..02ab6e3 100644 --- a/content/browser/service_worker/service_worker_job_coordinator.h +++ b/content/browser/service_worker/service_worker_job_coordinator.h @@ -33,7 +33,6 @@ class CONTENT_EXPORT ServiceWorkerJobCoordinator { void Unregister( const GURL& pattern, - int source_process_id, const ServiceWorkerUnregisterJob::UnregistrationCallback& callback); // Jobs are removed whenever they are finished or canceled. diff --git a/content/browser/service_worker/service_worker_job_unittest.cc b/content/browser/service_worker/service_worker_job_unittest.cc index 35c368e..8857937 100644 --- a/content/browser/service_worker/service_worker_job_unittest.cc +++ b/content/browser/service_worker/service_worker_job_unittest.cc @@ -245,7 +245,6 @@ TEST_F(ServiceWorkerJobTest, Unregister) { ASSERT_TRUE(called); job_coordinator()->Unregister(pattern, - render_process_id_, SaveUnregistration(SERVICE_WORKER_OK, &called)); ASSERT_FALSE(called); @@ -271,7 +270,6 @@ TEST_F(ServiceWorkerJobTest, Unregister_NothingRegistered) { bool called; job_coordinator()->Unregister(pattern, - render_process_id_, SaveUnregistration(SERVICE_WORKER_OK, &called)); ASSERT_FALSE(called); @@ -445,7 +443,6 @@ TEST_F(ServiceWorkerJobTest, ParallelRegUnreg) { bool unregistration_called = false; job_coordinator()->Unregister( pattern, - render_process_id_, SaveUnregistration(SERVICE_WORKER_OK, &unregistration_called)); ASSERT_FALSE(registration_called); @@ -561,14 +558,11 @@ TEST_F(ServiceWorkerJobTest, ParallelUnreg) { bool unregistration1_called = false; job_coordinator()->Unregister( pattern, - render_process_id_, SaveUnregistration(SERVICE_WORKER_OK, &unregistration1_called)); bool unregistration2_called = false; job_coordinator()->Unregister( - pattern, - render_process_id_, - SaveUnregistration(SERVICE_WORKER_OK, &unregistration2_called)); + pattern, SaveUnregistration(SERVICE_WORKER_OK, &unregistration2_called)); ASSERT_FALSE(unregistration1_called); ASSERT_FALSE(unregistration2_called); diff --git a/content/public/browser/service_worker_context.h b/content/public/browser/service_worker_context.h index 57aa955..a701d6c7 100644 --- a/content/public/browser/service_worker_context.h +++ b/content/public/browser/service_worker_context.h @@ -37,15 +37,14 @@ class ServiceWorkerContext { const ResultCallback& callback) = 0; // Equivalent to calling navigator.serviceWorker.unregister(pattern) from a - // renderer in |source_process_id|, except that |pattern| is an absolute URL - // instead of relative to some current origin. |callback| is passed true - // when the JS promise is fulfilled or false when the JS promise is rejected. + // renderer, except that |pattern| is an absolute URL instead of relative to + // some current origin. |callback| is passed true when the JS promise is + // fulfilled or false when the JS promise is rejected. // // Unregistration can fail if: // * No Service Worker was registered for |pattern|. // * Something unexpected goes wrong, like a renderer crash. virtual void UnregisterServiceWorker(const Scope& pattern, - int source_process_id, const ResultCallback& callback) = 0; // TODO(jyasskin): Provide a way to SendMessage to a Scope. |