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

Side by Side Diff: Source/core/html/HTMLImport.h

Issue 21182004: [HTML Imports] Make import loading in order. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months 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 | Annotate | Revision Log
OLDNEW
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
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 void blockAfter(HTMLImport* child);
70 void didUnblock();
71 void setBlocked(bool blocked) { m_blocked = blocked; }
72 void setTreeBlocked(bool);
73 bool arePredecessorsLoaded() const;
74 bool areChilrenLoaded() const;
75 bool hasChildren() const { return !m_children.isEmpty(); }
76
77 Vector<HTMLImport*> m_children;
78 bool m_blocked; // If any of decendants or predecessors is in processing, it is blocked.
54 }; 79 };
55 80
56 } // namespace WebCore 81 } // namespace WebCore
57 82
58 #endif // HTMLImport_h 83 #endif // HTMLImport_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698