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

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: clean up tests Created 4 years, 9 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 b4d49b23383bf4d6756f0f8e39192c45a494d473..52d1e42ac4a8b096ab8c83be6086a347deb2a29b 100644
--- a/content/common/service_worker/service_worker_types.h
+++ b/content/common/service_worker/service_worker_types.h
@@ -13,6 +13,7 @@
#include "base/strings/string_util.h"
#include "base/time/time.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"
@@ -181,6 +182,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;
@@ -230,6 +236,18 @@ struct ServiceWorkerClientQueryOptions {
bool include_uncontrolled;
};
+struct ExtendableMessageEventSource {
+ ExtendableMessageEventSource();
+ explicit ExtendableMessageEventSource(
+ const ServiceWorkerClientInfo& client_info);
+ explicit ExtendableMessageEventSource(
+ const ServiceWorkerObjectInfo& service_worker_info);
+
+ // Exactly one of these infos should be valid.
+ ServiceWorkerClientInfo client_info;
+ ServiceWorkerObjectInfo service_worker_info;
+};
+
} // namespace content
#endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_
« no previous file with comments | « content/common/service_worker/service_worker_messages.h ('k') | content/common/service_worker/service_worker_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698