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

Unified Diff: Source/modules/serviceworkers/ServiceWorkerClient.h

Issue 778703004: Implement ServiceWorkerClient attributes [3/3] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@properties-step1
Patch Set: Created 6 years 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: Source/modules/serviceworkers/ServiceWorkerClient.h
diff --git a/Source/modules/serviceworkers/ServiceWorkerClient.h b/Source/modules/serviceworkers/ServiceWorkerClient.h
index b1d96c3d1b0ee786aec80b46145e144fddca80db..d9ffaa6bed221802ace13a8f6317b56ca30cd507 100644
--- a/Source/modules/serviceworkers/ServiceWorkerClient.h
+++ b/Source/modules/serviceworkers/ServiceWorkerClient.h
@@ -9,6 +9,7 @@
#include "bindings/core/v8/ScriptWrappable.h"
#include "bindings/core/v8/SerializedScriptValue.h"
#include "platform/heap/Handle.h"
+#include "public/platform/WebServiceWorkerClientsInfo.h"
#include "wtf/Forward.h"
namespace blink {
@@ -16,21 +17,31 @@ namespace blink {
class ExecutionContext;
class ScriptState;
-class ServiceWorkerClient final : public GarbageCollected<ServiceWorkerClient>, public ScriptWrappable {
+class ServiceWorkerClient final : public GarbageCollectedFinalized<ServiceWorkerClient>, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
- static ServiceWorkerClient* create(unsigned id);
+ static ServiceWorkerClient* create(const WebServiceWorkerClientInfo&);
+
+ ~ServiceWorkerClient();
// ServiceWorkerClient.idl
+ String visibilityState() const { return m_visibilityState; }
+ bool focused() const { return m_isFocused; }
+ String url() const { return m_url; }
+ String frameType() const;
void postMessage(ExecutionContext*, PassRefPtr<SerializedScriptValue> message, const MessagePortArray*, ExceptionState&);
ScriptPromise focus(ScriptState*);
void trace(Visitor*) { }
private:
- explicit ServiceWorkerClient(unsigned id);
+ explicit ServiceWorkerClient(const WebServiceWorkerClientInfo&);
unsigned m_id;
+ String m_visibilityState;
+ bool m_isFocused;
+ String m_url;
+ WebURLRequest::FrameType m_frameType;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698