| Index: content/browser/service_worker/service_worker_version.cc
|
| diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc
|
| index 09cd6f3ea2f6c3f317a795b65c6859a75188fd90..530c7ab85e63f05cf305849cdb9945c5b22fc698 100644
|
| --- a/content/browser/service_worker/service_worker_version.cc
|
| +++ b/content/browser/service_worker/service_worker_version.cc
|
| @@ -36,7 +36,7 @@ class ServiceWorkerVersion::GetClientDocumentsCallback
|
|
|
| void AddClientInfo(int client_id, const ServiceWorkerClientInfo& info) {
|
| clients_.push_back(info);
|
| - clients_.back().client_id = client_id;
|
| + clients_.back().SetClientID(client_id);
|
| }
|
|
|
| private:
|
| @@ -716,9 +716,6 @@ void ServiceWorkerVersion::OnStopped(
|
| SERVICE_WORKER_ERROR_FAILED);
|
| RunIDMapCallbacks(&geofencing_callbacks_,
|
| SERVICE_WORKER_ERROR_FAILED);
|
| - RunIDMapCallbacks(&get_client_info_callbacks_,
|
| - SERVICE_WORKER_ERROR_FAILED,
|
| - ServiceWorkerClientInfo());
|
| RunIDMapCallbacks(&cross_origin_connect_callbacks_,
|
| SERVICE_WORKER_ERROR_FAILED,
|
| false);
|
| @@ -794,10 +791,6 @@ bool ServiceWorkerVersion::OnMessageReceived(const IPC::Message& message) {
|
| OnPostMessageToDocument)
|
| IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_FocusClient,
|
| OnFocusClient)
|
| - IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_GetClientInfoSuccess,
|
| - OnGetClientInfoSuccess)
|
| - IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_GetClientInfoError,
|
| - OnGetClientInfoError)
|
| IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_SkipWaiting,
|
| OnSkipWaiting)
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| @@ -855,40 +848,13 @@ void ServiceWorkerVersion::OnGetClientDocuments(int request_id) {
|
| TRACE_EVENT0("ServiceWorker",
|
| "ServiceWorkerVersion::OnGetClientDocuments");
|
| while (!it.IsAtEnd()) {
|
| - int client_request_id = get_client_info_callbacks_.Add(
|
| - new GetClientInfoCallback(base::Bind(
|
| - &ServiceWorkerVersion::DidGetClientInfo,
|
| - weak_factory_.GetWeakPtr(), it.GetCurrentKey(), callback)));
|
| - it.GetCurrentValue()->GetClientInfo(embedded_worker_->embedded_worker_id(),
|
| - client_request_id);
|
| + it.GetCurrentValue()->GetClientInfo(
|
| + base::Bind(&ServiceWorkerVersion::DidGetClientInfo,
|
| + weak_factory_.GetWeakPtr(), it.GetCurrentKey(), callback));
|
| it.Advance();
|
| }
|
| }
|
|
|
| -void ServiceWorkerVersion::OnGetClientInfoSuccess(
|
| - int request_id,
|
| - const ServiceWorkerClientInfo& info) {
|
| - GetClientInfoCallback* callback =
|
| - get_client_info_callbacks_.Lookup(request_id);
|
| - if (!callback) {
|
| - // The callback may already have been cleared by OnStopped, just ignore.
|
| - return;
|
| - }
|
| - callback->Run(SERVICE_WORKER_OK, info);
|
| - RemoveCallbackAndStopIfDoomed(&get_client_info_callbacks_, request_id);
|
| -}
|
| -
|
| -void ServiceWorkerVersion::OnGetClientInfoError(int request_id) {
|
| - GetClientInfoCallback* callback =
|
| - get_client_info_callbacks_.Lookup(request_id);
|
| - if (!callback) {
|
| - // The callback may already have been cleared by OnStopped, just ignore.
|
| - return;
|
| - }
|
| - callback->Run(SERVICE_WORKER_ERROR_FAILED, ServiceWorkerClientInfo());
|
| - RemoveCallbackAndStopIfDoomed(&get_client_info_callbacks_, request_id);
|
| -}
|
| -
|
| void ServiceWorkerVersion::OnActivateEventFinished(
|
| int request_id,
|
| blink::WebServiceWorkerEventResult result) {
|
| @@ -1108,10 +1074,9 @@ void ServiceWorkerVersion::DidSkipWaiting(int request_id) {
|
| void ServiceWorkerVersion::DidGetClientInfo(
|
| int client_id,
|
| scoped_refptr<GetClientDocumentsCallback> callback,
|
| - ServiceWorkerStatusCode status,
|
| const ServiceWorkerClientInfo& info) {
|
| - if (status == SERVICE_WORKER_OK)
|
| - callback->AddClientInfo(client_id, info);
|
| + DCHECK(!info.IsEmpty());
|
| + callback->AddClientInfo(client_id, info);
|
| }
|
|
|
| void ServiceWorkerVersion::ScheduleStopWorker() {
|
| @@ -1149,7 +1114,6 @@ bool ServiceWorkerVersion::HasInflightRequests() const {
|
| !notification_click_callbacks_.IsEmpty() ||
|
| !push_callbacks_.IsEmpty() ||
|
| !geofencing_callbacks_.IsEmpty() ||
|
| - !get_client_info_callbacks_.IsEmpty() ||
|
| !cross_origin_connect_callbacks_.IsEmpty() ||
|
| !streaming_url_request_jobs_.empty();
|
| }
|
|
|