We started redesigning GpuMemoryBuffer interface to handle multiple buffers [0].
[chromium-blink-merge.git] / content / common / service_worker / service_worker_client_info.cc
blob3d9d554af4f4091304f031d0d3c5a6c6a05e3e0d
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) {
19 ServiceWorkerClientInfo::ServiceWorkerClientInfo(
20 blink::WebPageVisibilityState page_visibility_state,
21 bool is_focused,
22 const GURL& url,
23 RequestContextFrameType frame_type,
24 blink::WebServiceWorkerClientType client_type)
25 : page_visibility_state(page_visibility_state),
26 is_focused(is_focused),
27 url(url),
28 frame_type(frame_type),
29 client_type(client_type) {
32 bool ServiceWorkerClientInfo::IsEmpty() const {
33 return page_visibility_state == blink::WebPageVisibilityStateLast &&
34 is_focused == false &&
35 url.is_empty() &&
36 frame_type == REQUEST_CONTEXT_FRAME_TYPE_LAST &&
37 client_type == blink::WebServiceWorkerClientTypeLast;
40 bool ServiceWorkerClientInfo::IsValid() const {
41 return !IsEmpty() && !client_uuid.empty();
44 } // namespace content