Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: content/browser/service_worker/service_worker_provider_host.cc

Issue 1439333002: Service Worker: Add Clients.get(id) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary condition Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_provider_host.cc
diff --git a/content/browser/service_worker/service_worker_provider_host.cc b/content/browser/service_worker/service_worker_provider_host.cc
index 1d79f5290b0232f7e8c8eca24c8183540a487fab..639b4428fa92229182bd7b733e19b95fa022fc98 100644
--- a/content/browser/service_worker/service_worker_provider_host.cc
+++ b/content/browser/service_worker/service_worker_provider_host.cc
@@ -36,7 +36,8 @@ namespace content {
namespace {
ServiceWorkerClientInfo FocusOnUIThread(int render_process_id,
- int render_frame_id) {
+ int render_frame_id,
+ const std::string& client_uuid) {
RenderFrameHostImpl* render_frame_host =
RenderFrameHostImpl::FromID(render_process_id, render_frame_id);
WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
@@ -57,8 +58,8 @@ ServiceWorkerClientInfo FocusOnUIThread(int render_process_id,
// Move the web contents to the foreground.
web_contents->Activate();
- return ServiceWorkerProviderHost::GetWindowClientInfoOnUI(render_process_id,
- render_frame_id);
+ return ServiceWorkerProviderHost::GetWindowClientInfoOnUI(
+ render_process_id, render_frame_id, client_uuid);
}
// PlzNavigate
@@ -440,7 +441,8 @@ void ServiceWorkerProviderHost::Focus(const GetClientInfoCallback& callback) {
}
BrowserThread::PostTaskAndReplyWithResult(
BrowserThread::UI, FROM_HERE,
- base::Bind(&FocusOnUIThread, render_process_id_, route_id_), callback);
+ base::Bind(&FocusOnUIThread, render_process_id_, route_id_, client_uuid_),
+ callback);
}
void ServiceWorkerProviderHost::GetWindowClientInfo(
@@ -452,14 +454,15 @@ void ServiceWorkerProviderHost::GetWindowClientInfo(
BrowserThread::PostTaskAndReplyWithResult(
BrowserThread::UI, FROM_HERE,
base::Bind(&ServiceWorkerProviderHost::GetWindowClientInfoOnUI,
- render_process_id_, route_id_),
+ render_process_id_, route_id_, client_uuid_),
callback);
}
// static
ServiceWorkerClientInfo ServiceWorkerProviderHost::GetWindowClientInfoOnUI(
int render_process_id,
- int render_frame_id) {
+ int render_frame_id,
+ const std::string& client_uuid) {
RenderFrameHostImpl* render_frame_host =
RenderFrameHostImpl::FromID(render_process_id, render_frame_id);
if (!render_frame_host)
@@ -469,8 +472,8 @@ ServiceWorkerClientInfo ServiceWorkerProviderHost::GetWindowClientInfoOnUI(
// for a frame that is actually being navigated and isn't exactly what we are
// expecting.
return ServiceWorkerClientInfo(
- render_frame_host->GetVisibilityState(), render_frame_host->IsFocused(),
- render_frame_host->GetLastCommittedURL(),
+ client_uuid, render_frame_host->GetVisibilityState(),
+ render_frame_host->IsFocused(), render_frame_host->GetLastCommittedURL(),
render_frame_host->GetParent() ? REQUEST_CONTEXT_FRAME_TYPE_NESTED
: REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL,
render_frame_host->frame_tree_node()->last_focus_time(),
« no previous file with comments | « content/browser/service_worker/service_worker_provider_host.h ('k') | content/browser/service_worker/service_worker_version.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698