OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 class HTMLImportChild; | 47 class HTMLImportChild; |
48 class HTMLImportsController; | 48 class HTMLImportsController; |
49 | 49 |
50 | 50 |
51 // | 51 // |
52 // Owning imported Document lifetime. It also implements ResourceClient through
ResourceOwner | 52 // Owning imported Document lifetime. It also implements ResourceClient through
ResourceOwner |
53 // to feed fetched bytes to the DocumentWriter of the imported document. | 53 // to feed fetched bytes to the DocumentWriter of the imported document. |
54 // HTMLImportLoader is owned by HTMLImportsController. | 54 // HTMLImportLoader is owned by HTMLImportsController. |
55 // | 55 // |
56 // | 56 // |
57 class HTMLImportLoader FINAL : public NoBaseWillBeGarbageCollectedFinalized<HTML
ImportLoader>, public ResourceOwner<RawResource>, public DocumentParserClient { | 57 class HTMLImportLoader final : public NoBaseWillBeGarbageCollectedFinalized<HTML
ImportLoader>, public ResourceOwner<RawResource>, public DocumentParserClient { |
58 public: | 58 public: |
59 enum State { | 59 enum State { |
60 StateLoading, | 60 StateLoading, |
61 StateWritten, | 61 StateWritten, |
62 StateParsed, | 62 StateParsed, |
63 StateLoaded, | 63 StateLoaded, |
64 StateError | 64 StateError |
65 }; | 65 }; |
66 | 66 |
67 static PassOwnPtrWillBeRawPtr<HTMLImportLoader> create(HTMLImportsController
* controller) | 67 static PassOwnPtrWillBeRawPtr<HTMLImportLoader> create(HTMLImportsController
* controller) |
(...skipping 27 matching lines...) Expand all Loading... |
95 void didRemoveAllPendingStylesheet(); | 95 void didRemoveAllPendingStylesheet(); |
96 | 96 |
97 PassRefPtrWillBeRawPtr<CustomElementSyncMicrotaskQueue> microtaskQueue() con
st; | 97 PassRefPtrWillBeRawPtr<CustomElementSyncMicrotaskQueue> microtaskQueue() con
st; |
98 | 98 |
99 virtual void trace(Visitor*); | 99 virtual void trace(Visitor*); |
100 | 100 |
101 private: | 101 private: |
102 HTMLImportLoader(HTMLImportsController*); | 102 HTMLImportLoader(HTMLImportsController*); |
103 | 103 |
104 // RawResourceClient | 104 // RawResourceClient |
105 virtual void responseReceived(Resource*, const ResourceResponse&) OVERRIDE; | 105 virtual void responseReceived(Resource*, const ResourceResponse&) override; |
106 virtual void dataReceived(Resource*, const char* data, unsigned length) OVER
RIDE; | 106 virtual void dataReceived(Resource*, const char* data, unsigned length) over
ride; |
107 virtual void notifyFinished(Resource*) OVERRIDE; | 107 virtual void notifyFinished(Resource*) override; |
108 | 108 |
109 // DocumentParserClient | 109 // DocumentParserClient |
110 | 110 |
111 // Called after document parse is complete after DOMContentLoaded was dispat
ched. | 111 // Called after document parse is complete after DOMContentLoaded was dispat
ched. |
112 virtual void notifyParserStopped(); | 112 virtual void notifyParserStopped(); |
113 | 113 |
114 State startWritingAndParsing(const ResourceResponse&); | 114 State startWritingAndParsing(const ResourceResponse&); |
115 State finishWriting(); | 115 State finishWriting(); |
116 State finishParsing(); | 116 State finishParsing(); |
117 State finishLoading(); | 117 State finishLoading(); |
118 | 118 |
119 void setState(State); | 119 void setState(State); |
120 void didFinishLoading(); | 120 void didFinishLoading(); |
121 bool hasPendingResources() const; | 121 bool hasPendingResources() const; |
122 #if !ENABLE(OILPAN) | 122 #if !ENABLE(OILPAN) |
123 void clear(); | 123 void clear(); |
124 #endif | 124 #endif |
125 | 125 |
126 RawPtrWillBeMember<HTMLImportsController> m_controller; | 126 RawPtrWillBeMember<HTMLImportsController> m_controller; |
127 WillBeHeapVector<RawPtrWillBeMember<HTMLImportChild> > m_imports; | 127 WillBeHeapVector<RawPtrWillBeMember<HTMLImportChild> > m_imports; |
128 State m_state; | 128 State m_state; |
129 RefPtrWillBeMember<Document> m_document; | 129 RefPtrWillBeMember<Document> m_document; |
130 RefPtrWillBeMember<DocumentWriter> m_writer; | 130 RefPtrWillBeMember<DocumentWriter> m_writer; |
131 RefPtrWillBeMember<CustomElementSyncMicrotaskQueue> m_microtaskQueue; | 131 RefPtrWillBeMember<CustomElementSyncMicrotaskQueue> m_microtaskQueue; |
132 }; | 132 }; |
133 | 133 |
134 } // namespace blink | 134 } // namespace blink |
135 | 135 |
136 #endif // HTMLImportLoader_h | 136 #endif // HTMLImportLoader_h |
OLD | NEW |