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

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

Issue 1701843002: ServiceWorker: Implement 'source' and 'origin' attributes of ExtendableMessageEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_focus_into_utils
Patch Set: Created 4 years, 10 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_types.h
diff --git a/content/common/service_worker/service_worker_types.h b/content/common/service_worker/service_worker_types.h
index e332f1ca05ba7b514d88b0590f054c78019f5552..bde71fa6aade570ce692161c46881ec71bf4788b 100644
--- a/content/common/service_worker/service_worker_types.h
+++ b/content/common/service_worker/service_worker_types.h
@@ -12,6 +12,7 @@
#include "base/strings/string_util.h"
#include "content/common/content_export.h"
+#include "content/common/service_worker/service_worker_client_info.h"
#include "content/public/common/referrer.h"
#include "content/public/common/request_context_frame_type.h"
#include "content/public/common/request_context_type.h"
@@ -178,6 +179,11 @@ struct CONTENT_EXPORT ServiceWorkerResponse {
// Represents initialization info for a WebServiceWorker object.
struct CONTENT_EXPORT ServiceWorkerObjectInfo {
ServiceWorkerObjectInfo();
+
+ // Returns whether the instance is valid. A valid instance has valid
+ // |handle_id| and |version_id|.
+ bool IsValid() const;
+
int handle_id;
GURL url;
blink::WebServiceWorkerState state;
@@ -227,6 +233,17 @@ struct ServiceWorkerClientQueryOptions {
bool include_uncontrolled;
};
+struct ExtendableMessageEventSource {
+ ExtendableMessageEventSource();
+ explicit ExtendableMessageEventSource(
+ const ServiceWorkerClientInfo& client_info);
+ explicit ExtendableMessageEventSource(
+ const ServiceWorkerObjectInfo& service_worker_info);
+
+ ServiceWorkerClientInfo client_info;
+ ServiceWorkerObjectInfo service_worker_info;
+};
+
} // namespace content
#endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_

Powered by Google App Engine
This is Rietveld 408576698