1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_INFO_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_INFO_H_
10 #include "base/time/time.h"
11 #include "content/browser/service_worker/service_worker_version.h"
12 #include "content/common/content_export.h"
17 struct CONTENT_EXPORT ServiceWorkerVersionInfo
{
19 struct CONTENT_EXPORT ClientInfo
{
22 ClientInfo(int process_id
, int route_id
, ServiceWorkerProviderType type
);
26 ServiceWorkerProviderType type
;
29 ServiceWorkerVersionInfo();
30 ServiceWorkerVersionInfo(ServiceWorkerVersion::RunningStatus running_status
,
31 ServiceWorkerVersion::Status status
,
32 const GURL
& script_url
,
33 int64 registration_id
,
37 int devtools_agent_route_id
);
38 ~ServiceWorkerVersionInfo();
40 ServiceWorkerVersion::RunningStatus running_status
;
41 ServiceWorkerVersion::Status status
;
43 int64 registration_id
;
47 int devtools_agent_route_id
;
48 base::Time script_response_time
;
49 base::Time script_last_modified
;
50 std::map
<std::string
, ClientInfo
> clients
;
53 struct CONTENT_EXPORT ServiceWorkerRegistrationInfo
{
55 enum DeleteFlag
{ IS_NOT_DELETED
, IS_DELETED
};
56 ServiceWorkerRegistrationInfo();
57 ServiceWorkerRegistrationInfo(const GURL
& pattern
,
58 int64 registration_id
,
59 DeleteFlag delete_flag
);
60 ServiceWorkerRegistrationInfo(
62 int64 registration_id
,
63 DeleteFlag delete_flag
,
64 const ServiceWorkerVersionInfo
& active_version
,
65 const ServiceWorkerVersionInfo
& waiting_version
,
66 const ServiceWorkerVersionInfo
& installing_version
,
67 int64_t active_version_total_size_bytes
);
68 ~ServiceWorkerRegistrationInfo();
71 int64 registration_id
;
72 DeleteFlag delete_flag
;
73 ServiceWorkerVersionInfo active_version
;
74 ServiceWorkerVersionInfo waiting_version
;
75 ServiceWorkerVersionInfo installing_version
;
77 int64_t stored_version_size_bytes
;
80 } // namespace content
82 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_INFO_H_