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

Unified Diff: content/common/service_worker/service_worker_client_info.h

Issue 871013003: Gather the ServiceWorker client information in the browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rfh_getvisibilitystate
Patch Set: cleanup Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/common/service_worker/service_worker_client_info.h
diff --git a/content/common/service_worker/service_worker_client_info.h b/content/common/service_worker/service_worker_client_info.h
new file mode 100644
index 0000000000000000000000000000000000000000..c90ba69e30ee882c14d6f155e51456b95c25da29
--- /dev/null
+++ b/content/common/service_worker/service_worker_client_info.h
@@ -0,0 +1,42 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_INFO_CLIENT_H_
+#define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_INFO_CLIENT_H_
+
+#include "content/public/common/request_context_frame_type.h"
+#include "third_party/WebKit/public/platform/WebPageVisibilityState.h"
+#include "url/gurl.h"
+
+namespace content {
+
+// This class holds the information related to a service worker window client.
+// It is the content/ equivalent of Blink's WebServiceWorkerClientInfo.
+// An instance can be created empty or can be filed with the expected
+// properties. Except for the client_id, it is preferred to use the constructor
+// to fill the properties.
+struct ServiceWorkerClientInfo {
+ ServiceWorkerClientInfo();
+ ServiceWorkerClientInfo(blink::WebPageVisibilityState page_visibility_state,
+ bool is_focused,
+ const GURL& url,
+ RequestContextFrameType frame_type);
+
+ // Returns whether the instance is empty.
+ bool IsEmpty() const;
+
+ // Returns whether the instance is valid. A valid instance is not empty and
+ // has a valid client_id.
+ bool IsValid() const;
+
+ int client_id;
+ blink::WebPageVisibilityState page_visibility_state;
+ bool is_focused;
+ GURL url;
+ RequestContextFrameType frame_type;
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_INFO_CLIENT_H_
« no previous file with comments | « content/child/service_worker/service_worker_dispatcher.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