cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / content / common / service_worker / service_worker_client_info.cc
blobc864369c0390b67f978afd8652fd16109103c88a
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
3 // found in the LICENSE file.
5 #include "content/common/service_worker/service_worker_client_info.h"
7 #include "base/logging.h"
8 #include "content/common/service_worker/service_worker_types.h"
10 namespace content {
12 ServiceWorkerClientInfo::ServiceWorkerClientInfo()
13 : page_visibility_state(blink::WebPageVisibilityStateLast),
14 is_focused(false),
15 frame_type(REQUEST_CONTEXT_FRAME_TYPE_LAST),
16 client_type(blink::WebServiceWorkerClientTypeLast),
17 last_focus_time(base::TimeTicks()) {}
19 ServiceWorkerClientInfo::ServiceWorkerClientInfo(
20 blink::WebPageVisibilityState page_visibility_state,
21 bool is_focused,
22 const GURL& url,
23 RequestContextFrameType frame_type,
24 base::TimeTicks last_focus_time,
25 blink::WebServiceWorkerClientType client_type)
26 : page_visibility_state(page_visibility_state),
27 is_focused(is_focused),
28 url(url),
29 frame_type(frame_type),
30 client_type(client_type),
31 last_focus_time(last_focus_time) {}
33 bool ServiceWorkerClientInfo::IsEmpty() const {
34 return page_visibility_state == blink::WebPageVisibilityStateLast &&
35 is_focused == false &&
36 url.is_empty() &&
37 frame_type == REQUEST_CONTEXT_FRAME_TYPE_LAST &&
38 client_type == blink::WebServiceWorkerClientTypeLast;
41 bool ServiceWorkerClientInfo::IsValid() const {
42 return !IsEmpty() && !client_uuid.empty();
45 } // namespace content