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

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

Issue 1285373002: Ensure that Service Worker clients are always returned in MRU order (1) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: basic patch (no tests) Created 5 years, 4 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_version.cc
diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc
index 5415d33b9df232571a4495951aee5fd81e5ec295..db516304b82b325d2cabfa62b5953ae04550d894 100644
--- a/content/browser/service_worker/service_worker_version.cc
+++ b/content/browser/service_worker/service_worker_version.cc
@@ -378,10 +378,11 @@ void AddNonWindowClient(ServiceWorkerProviderHost* host,
options.client_type != host_client_type)
return;
- ServiceWorkerClientInfo client_info(
- blink::WebPageVisibilityStateHidden,
- false, // is_focused
- host->document_url(), REQUEST_CONTEXT_FRAME_TYPE_NONE, host_client_type);
+ ServiceWorkerClientInfo client_info(blink::WebPageVisibilityStateHidden,
+ false, // is_focused
+ host->document_url(),
+ REQUEST_CONTEXT_FRAME_TYPE_NONE,
+ base::TimeTicks::Now(), host_client_type);
nhiroki 2015/08/13 05:56:31 Non-window clients seem to always overcome window
jeremyarcher 2015/08/14 05:22:05 Fixed.
client_info.client_uuid = host->client_uuid();
clients->push_back(client_info);
}
@@ -1297,6 +1298,7 @@ void ServiceWorkerVersion::OnGetClientsFinished(
if (running_status() != RUNNING)
return;
+ std::sort(clients);
nhiroki 2015/08/13 05:56:31 Can you add comments about why we sort clients her
jeremyarcher 2015/08/14 05:22:05 Fixed.
embedded_worker_->SendMessage(
ServiceWorkerMsg_DidGetClients(request_id, clients));
}

Powered by Google App Engine
This is Rietveld 408576698