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 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef HTMLImport_h | 31 #ifndef HTMLImport_h |
32 #define HTMLImport_h | 32 #define HTMLImport_h |
33 | 33 |
| 34 #include "wtf/Vector.h" |
| 35 |
34 namespace WebCore { | 36 namespace WebCore { |
35 | 37 |
36 class Frame; | 38 class Frame; |
37 class Document; | 39 class Document; |
38 class Frame; | 40 class Frame; |
39 class HTMLImportsController; | 41 class HTMLImportsController; |
40 | 42 |
41 class HTMLImport { | 43 class HTMLImport { |
42 public: | 44 public: |
| 45 static bool unblock(HTMLImport*); |
| 46 |
43 virtual ~HTMLImport() { } | 47 virtual ~HTMLImport() { } |
44 | 48 |
45 bool haveChildrenLoaded(); | |
46 Frame* frame(); | 49 Frame* frame(); |
47 Document* master(); | 50 Document* master(); |
48 | 51 |
| 52 bool isLoaded() const { return !isBlocked() && !isProcessing(); } |
| 53 bool isBlocked() const { return m_blocked; } |
| 54 void appendChild(HTMLImport*); |
| 55 |
49 virtual HTMLImportsController* controller() = 0; | 56 virtual HTMLImportsController* controller() = 0; |
50 virtual HTMLImport* parent() = 0; | 57 virtual HTMLImport* parent() const = 0; |
51 virtual Document* document() = 0; | 58 virtual Document* document() const = 0; |
52 virtual void wasDetachedFromDocument() = 0; | 59 virtual void wasDetachedFromDocument() = 0; |
53 virtual void didFinishParsing() = 0; | 60 virtual void didFinishParsing() = 0; |
| 61 virtual bool isProcessing() const = 0; |
| 62 |
| 63 protected: |
| 64 HTMLImport() |
| 65 : m_blocked(false) |
| 66 { } |
| 67 |
| 68 private: |
| 69 static void block(HTMLImport*); |
| 70 |
| 71 void blockAfter(HTMLImport* child); |
| 72 void block(); |
| 73 void unblock(); |
| 74 void didUnblock(); |
| 75 |
| 76 bool arePredecessorsLoaded() const; |
| 77 bool areChilrenLoaded() const; |
| 78 bool hasChildren() const { return !m_children.isEmpty(); } |
| 79 |
| 80 Vector<HTMLImport*> m_children; |
| 81 bool m_blocked; // If any of decendants or predecessors is in processing, it
is blocked. |
54 }; | 82 }; |
55 | 83 |
56 } // namespace WebCore | 84 } // namespace WebCore |
57 | 85 |
58 #endif // HTMLImport_h | 86 #endif // HTMLImport_h |
OLD | NEW |