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

Side by Side Diff: content/common/service_worker/service_worker_client_info.h

Issue 2905593002: Clients.matchAll() should return ordered clients by type/focus time/creation time (Closed)
Patch Set: Address shimazu's comments #31 and fix the test failure Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_ 5 #ifndef CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_
6 #define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_ 6 #define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_
7 7
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "content/public/common/request_context_frame_type.h" 9 #include "content/public/common/request_context_frame_type.h"
10 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" 10 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h"
11 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerClientType.h" 11 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerClientType.h"
12 #include "url/gurl.h" 12 #include "url/gurl.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 // This class holds the information related to a service worker window client. 16 // This class holds the information related to a service worker window client.
17 // It is the content/ equivalent of Blink's WebServiceWorkerClientInfo. 17 // It is the content/ equivalent of Blink's WebServiceWorkerClientInfo.
18 // An instance can be created empty or can be filed with the expected 18 // An instance can be created empty or can be filed with the expected
19 // properties. Except for the client_uuid, it is preferred to use the 19 // properties. Except for the client_uuid, it is preferred to use the
20 // constructor to fill the properties. 20 // constructor to fill the properties.
21 struct ServiceWorkerClientInfo { 21 struct ServiceWorkerClientInfo {
22 ServiceWorkerClientInfo(); 22 ServiceWorkerClientInfo();
23 ServiceWorkerClientInfo(const std::string& client_uuid, 23 ServiceWorkerClientInfo(const std::string& client_uuid,
24 blink::WebPageVisibilityState page_visibility_state, 24 blink::WebPageVisibilityState page_visibility_state,
25 bool is_focused, 25 bool is_focused,
26 const GURL& url, 26 const GURL& url,
27 RequestContextFrameType frame_type, 27 RequestContextFrameType frame_type,
28 base::TimeTicks last_focus_time, 28 base::TimeTicks last_focus_time,
29 base::TimeTicks create_time,
29 blink::WebServiceWorkerClientType client_type); 30 blink::WebServiceWorkerClientType client_type);
30 ServiceWorkerClientInfo(const ServiceWorkerClientInfo& other); 31 ServiceWorkerClientInfo(const ServiceWorkerClientInfo& other);
31 32
32 // Returns whether the instance is empty. 33 // Returns whether the instance is empty.
33 bool IsEmpty() const; 34 bool IsEmpty() const;
34 35
35 // Returns whether the instance is valid. A valid instance is not empty and 36 // Returns whether the instance is valid. A valid instance is not empty and
36 // has a valid client_uuid. 37 // has a valid client_uuid.
37 bool IsValid() const; 38 bool IsValid() const;
38 39
39 std::string client_uuid; 40 std::string client_uuid;
40 blink::WebPageVisibilityState page_visibility_state; 41 blink::WebPageVisibilityState page_visibility_state;
41 bool is_focused; 42 bool is_focused;
42 GURL url; 43 GURL url;
43 RequestContextFrameType frame_type; 44 RequestContextFrameType frame_type;
44 base::TimeTicks last_focus_time; 45 base::TimeTicks last_focus_time;
46 base::TimeTicks create_time;
45 blink::WebServiceWorkerClientType client_type; 47 blink::WebServiceWorkerClientType client_type;
46 }; 48 };
47 49
48 } // namespace content 50 } // namespace content
49 51
50 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_ 52 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_version.cc ('k') | content/common/service_worker/service_worker_client_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698