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

Side by Side Diff: third_party/WebKit/Source/modules/push_messaging/PushMessageData.h

Issue 1414553002: Fix out-of-memory crashes related to ArrayBuffer allocation Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and applied senorblanco+haraken feedbac Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
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"
(...skipping 10 matching lines...) Expand all
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() 27 static PushMessageData* create()
28 { 28 {
29 return new PushMessageData(); 29 return new PushMessageData();
30 } 30 }
31 static PushMessageData* create(const String& data); 31 static PushMessageData* create(const String& data, ExceptionState&);
32 static PushMessageData* create(const ArrayBufferOrArrayBufferViewOrUSVString & data); 32 static PushMessageData* create(const ArrayBufferOrArrayBufferViewOrUSVString & data, ExceptionState&);
33 33
34 virtual ~PushMessageData(); 34 virtual ~PushMessageData();
35 35
36 PassRefPtr<DOMArrayBuffer> arrayBuffer() const; 36 PassRefPtr<DOMArrayBuffer> arrayBuffer() const;
37 Blob* blob() const; 37 Blob* blob() const;
38 ScriptValue json(ScriptState*, ExceptionState&) const; 38 ScriptValue json(ScriptState*, ExceptionState&) const;
39 String text() const; 39 String text() const;
40 40
41 DECLARE_TRACE(); 41 DECLARE_TRACE();
42 42
43 private: 43 private:
44 PushMessageData(); 44 PushMessageData();
45 PushMessageData(const char* data, unsigned bytesSize); 45 PushMessageData(const char* data, unsigned bytesSize);
46 46
47 Vector<char> m_data; 47 Vector<char> m_data;
48 }; 48 };
49 49
50 } // namespace blink 50 } // namespace blink
51 51
52 #endif // PushMessageData_h 52 #endif // PushMessageData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698