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 #include "content/browser/service_worker/service_worker_info.h"
7 #include "content/common/service_worker/service_worker_types.h"
8 #include "ipc/ipc_message.h"
12 ServiceWorkerVersionInfo::ClientInfo::ClientInfo()
13 : ClientInfo(-1, MSG_ROUTING_NONE
, SERVICE_WORKER_PROVIDER_UNKNOWN
) {
16 ServiceWorkerVersionInfo::ClientInfo::ClientInfo(int process_id
,
18 ServiceWorkerProviderType type
)
19 : process_id(process_id
), route_id(route_id
), type(type
) {
22 ServiceWorkerVersionInfo::ClientInfo::~ClientInfo() {
25 ServiceWorkerVersionInfo::ServiceWorkerVersionInfo()
26 : running_status(ServiceWorkerVersion::STOPPED
),
27 status(ServiceWorkerVersion::NEW
),
28 registration_id(kInvalidServiceWorkerRegistrationId
),
29 version_id(kInvalidServiceWorkerVersionId
),
32 devtools_agent_route_id(MSG_ROUTING_NONE
) {
35 ServiceWorkerVersionInfo::ServiceWorkerVersionInfo(
36 ServiceWorkerVersion::RunningStatus running_status
,
37 ServiceWorkerVersion::Status status
,
38 const GURL
& script_url
,
39 int64 registration_id
,
43 int devtools_agent_route_id
)
44 : running_status(running_status
),
46 script_url(script_url
),
47 registration_id(registration_id
),
48 version_id(version_id
),
49 process_id(process_id
),
51 devtools_agent_route_id(devtools_agent_route_id
) {
54 ServiceWorkerVersionInfo::~ServiceWorkerVersionInfo() {}
56 ServiceWorkerRegistrationInfo::ServiceWorkerRegistrationInfo()
57 : registration_id(kInvalidServiceWorkerRegistrationId
),
58 delete_flag(IS_NOT_DELETED
),
59 stored_version_size_bytes(0) {
62 ServiceWorkerRegistrationInfo::ServiceWorkerRegistrationInfo(
64 int64 registration_id
,
65 DeleteFlag delete_flag
)
67 registration_id(registration_id
),
68 delete_flag(delete_flag
),
69 stored_version_size_bytes(0) {
72 ServiceWorkerRegistrationInfo::ServiceWorkerRegistrationInfo(
74 int64 registration_id
,
75 DeleteFlag delete_flag
,
76 const ServiceWorkerVersionInfo
& active_version
,
77 const ServiceWorkerVersionInfo
& waiting_version
,
78 const ServiceWorkerVersionInfo
& installing_version
,
79 int64_t stored_version_size_bytes
)
81 registration_id(registration_id
),
82 delete_flag(delete_flag
),
83 active_version(active_version
),
84 waiting_version(waiting_version
),
85 installing_version(installing_version
),
86 stored_version_size_bytes(stored_version_size_bytes
) {
89 ServiceWorkerRegistrationInfo::~ServiceWorkerRegistrationInfo() {}
91 } // namespace content