Index: content/browser/service_worker/service_worker_context_wrapper.cc |
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc |
index 5ac00ae5119087beeb003f0554f686b083ef5609..7302350314fbd057a8f1795607c31e359a16c76a 100644 |
--- a/content/browser/service_worker/service_worker_context_wrapper.cc |
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc |
@@ -305,6 +305,27 @@ void ServiceWorkerContextWrapper::SimulateSkipWaiting(int64_t version_id) { |
registration->ActivateWaitingVersionWhenReady(); |
} |
+void ServiceWorkerContextWrapper::FocusClient(const std::string& client_uuid) { |
+ if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
+ BrowserThread::PostTask( |
+ BrowserThread::IO, FROM_HERE, |
+ base::Bind(&ServiceWorkerContextWrapper::FocusClient, this, |
+ client_uuid)); |
+ return; |
+ } |
+ if (!context_core_.get()) { |
+ LOG(ERROR) << "ServiceWorkerContextCore is no longer alive."; |
+ return; |
+ } |
+ ServiceWorkerProviderHost* provider_host = |
+ context_core_->GetProviderHostByClientID(client_uuid); |
+ if (!provider_host) { |
+ LOG(ERROR) << "ServiceWorkerProviderHost is no longer alive."; |
+ return; |
+ } |
+ provider_host->Focus(base::Bind(&ServiceWorkerUtils::NoOpClientInfoCallback)); |
+} |
+ |
static void DidFindRegistrationForDocument( |
const net::CompletionCallback& callback, |
ServiceWorkerStatusCode status, |