OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PushMessageData_h | 5 #ifndef PushMessageData_h |
6 #define PushMessageData_h | 6 #define PushMessageData_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptValue.h" | 8 #include "bindings/core/v8/ScriptValue.h" |
9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
10 #include "modules/ModulesExport.h" | 10 #include "modules/ModulesExport.h" |
11 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
12 #include "wtf/Vector.h" | 12 #include "wtf/Vector.h" |
13 #include "wtf/text/WTFString.h" | 13 #include "wtf/text/WTFString.h" |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 class ArrayBufferOrArrayBufferViewOrUSVString; | 17 class ArrayBufferOrArrayBufferViewOrUSVString; |
18 class Blob; | 18 class Blob; |
19 class DOMArrayBuffer; | 19 class DOMArrayBuffer; |
20 class ExceptionState; | 20 class ExceptionState; |
21 class ScriptState; | 21 class ScriptState; |
22 | 22 |
23 class MODULES_EXPORT PushMessageData final : public GarbageCollectedFinalized<Pu
shMessageData>, public ScriptWrappable { | 23 class MODULES_EXPORT PushMessageData final : public GarbageCollectedFinalized<Pu
shMessageData>, public ScriptWrappable { |
24 DEFINE_WRAPPERTYPEINFO(); | 24 DEFINE_WRAPPERTYPEINFO(); |
25 | 25 |
26 public: | 26 public: |
27 static PushMessageData* create() | |
28 { | |
29 return new PushMessageData(); | |
30 } | |
31 static PushMessageData* create(const String& data); | 27 static PushMessageData* create(const String& data); |
32 static PushMessageData* create(const ArrayBufferOrArrayBufferViewOrUSVString
& data); | 28 static PushMessageData* create(const ArrayBufferOrArrayBufferViewOrUSVString
& data); |
33 | 29 |
34 virtual ~PushMessageData(); | 30 virtual ~PushMessageData(); |
35 | 31 |
36 PassRefPtr<DOMArrayBuffer> arrayBuffer() const; | 32 PassRefPtr<DOMArrayBuffer> arrayBuffer() const; |
37 Blob* blob() const; | 33 Blob* blob() const; |
38 ScriptValue json(ScriptState*, ExceptionState&) const; | 34 ScriptValue json(ScriptState*, ExceptionState&) const; |
39 String text() const; | 35 String text() const; |
40 | 36 |
41 DECLARE_TRACE(); | 37 DECLARE_TRACE(); |
42 | 38 |
43 private: | 39 private: |
44 PushMessageData(); | |
45 PushMessageData(const char* data, unsigned bytesSize); | 40 PushMessageData(const char* data, unsigned bytesSize); |
46 | 41 |
47 Vector<char> m_data; | 42 Vector<char> m_data; |
48 }; | 43 }; |
49 | 44 |
50 } // namespace blink | 45 } // namespace blink |
51 | 46 |
52 #endif // PushMessageData_h | 47 #endif // PushMessageData_h |
OLD | NEW |