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 Body_h | 5 #ifndef Body_h |
6 #define Body_h | 6 #define Body_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
10 #include "bindings/core/v8/ScriptWrappable.h" | 10 #include "bindings/core/v8/ScriptWrappable.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 ScriptPromise arrayBuffer(ScriptState*); | 40 ScriptPromise arrayBuffer(ScriptState*); |
41 ScriptPromise blob(ScriptState*); | 41 ScriptPromise blob(ScriptState*); |
42 ScriptPromise formData(ScriptState*); | 42 ScriptPromise formData(ScriptState*); |
43 ScriptPromise json(ScriptState*); | 43 ScriptPromise json(ScriptState*); |
44 ScriptPromise text(ScriptState*); | 44 ScriptPromise text(ScriptState*); |
45 | 45 |
46 bool bodyUsed() const; | 46 bool bodyUsed() const; |
47 | 47 |
48 // ActiveDOMObject override. | 48 // ActiveDOMObject override. |
49 virtual void stop() OVERRIDE; | 49 virtual void stop() override; |
50 virtual bool hasPendingActivity() const OVERRIDE; | 50 virtual bool hasPendingActivity() const override; |
51 | 51 |
52 virtual void trace(Visitor*) { } | 52 virtual void trace(Visitor*) { } |
53 | 53 |
54 protected: | 54 protected: |
55 // Copy constructor for clone() implementations | 55 // Copy constructor for clone() implementations |
56 explicit Body(const Body&); | 56 explicit Body(const Body&); |
57 | 57 |
58 // Sets the bodyUsed flag to true. This signifies that the contents of the | 58 // Sets the bodyUsed flag to true. This signifies that the contents of the |
59 // body have been consumed and cannot be accessed again. | 59 // body have been consumed and cannot be accessed again. |
60 void setBodyUsed(); | 60 void setBodyUsed(); |
61 | 61 |
62 private: | 62 private: |
63 ScriptPromise readAsync(ScriptState*, ResponseType); | 63 ScriptPromise readAsync(ScriptState*, ResponseType); |
64 void resolveJSON(); | 64 void resolveJSON(); |
65 | 65 |
66 // FileReaderLoaderClient functions. | 66 // FileReaderLoaderClient functions. |
67 virtual void didStartLoading() OVERRIDE; | 67 virtual void didStartLoading() override; |
68 virtual void didReceiveData() OVERRIDE; | 68 virtual void didReceiveData() override; |
69 virtual void didFinishLoading() OVERRIDE; | 69 virtual void didFinishLoading() override; |
70 virtual void didFail(FileError::ErrorCode) OVERRIDE; | 70 virtual void didFail(FileError::ErrorCode) override; |
71 | 71 |
72 virtual PassRefPtr<BlobDataHandle> blobDataHandle() = 0; | 72 virtual PassRefPtr<BlobDataHandle> blobDataHandle() = 0; |
73 | 73 |
74 OwnPtr<FileReaderLoader> m_loader; | 74 OwnPtr<FileReaderLoader> m_loader; |
75 bool m_bodyUsed; | 75 bool m_bodyUsed; |
76 ResponseType m_responseType; | 76 ResponseType m_responseType; |
77 RefPtr<ScriptPromiseResolver> m_resolver; | 77 RefPtr<ScriptPromiseResolver> m_resolver; |
78 }; | 78 }; |
79 | 79 |
80 } // namespace blink | 80 } // namespace blink |
81 | 81 |
82 #endif // Body_h | 82 #endif // Body_h |
OLD | NEW |