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

Side by Side Diff: Source/core/html/imports/HTMLImportChild.h

Issue 211663002: Refactoring: Get rid of HTMLImportLoaerClient (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed typo and bad grammar Created 6 years, 9 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
« no previous file with comments | « Source/core/html/imports/HTMLImport.h ('k') | Source/core/html/imports/HTMLImportChild.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 16 matching lines...) Expand all
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 HTMLImportChild_h 31 #ifndef HTMLImportChild_h
32 #define HTMLImportChild_h 32 #define HTMLImportChild_h
33 33
34 #include "core/fetch/RawResource.h" 34 #include "core/fetch/RawResource.h"
35 #include "core/fetch/ResourceOwner.h" 35 #include "core/fetch/ResourceOwner.h"
36 #include "core/html/imports/HTMLImport.h" 36 #include "core/html/imports/HTMLImport.h"
37 #include "core/html/imports/HTMLImportLoaderClient.h"
38 #include "platform/weborigin/KURL.h" 37 #include "platform/weborigin/KURL.h"
39 #include "wtf/Vector.h" 38 #include "wtf/Vector.h"
40 39
41 namespace WebCore { 40 namespace WebCore {
42 41
43 class CustomElementMicrotaskImportStep; 42 class CustomElementMicrotaskImportStep;
44 class HTMLImportLoader; 43 class HTMLImportLoader;
45 class HTMLImportChildClient; 44 class HTMLImportChildClient;
46 class HTMLLinkElement; 45 class HTMLLinkElement;
47 46
48 // 47 //
49 // An import tree node subclas to encapsulate imported document 48 // An import tree node subclas to encapsulate imported document
50 // lifecycle. This class is owned by LinkStyle. The actual loading 49 // lifecycle. This class is owned by LinkStyle. The actual loading
51 // is done by HTMLImportLoader, which can be shared among multiple 50 // is done by HTMLImportLoader, which can be shared among multiple
52 // HTMLImportChild of same link URL. 51 // HTMLImportChild of same link URL.
53 // 52 //
54 // HTMLImportChild implements ResourceClient through ResourceOwner 53 // HTMLImportChild implements ResourceClient through ResourceOwner
55 // so that it can speculatively request linked resources while it is unblocked. 54 // so that it can speculatively request linked resources while it is unblocked.
56 // 55 //
57 class HTMLImportChild FINAL : public HTMLImport, public HTMLImportLoaderClient, public ResourceOwner<RawResource> { 56 class HTMLImportChild FINAL : public HTMLImport, public ResourceOwner<RawResourc e> {
58 public: 57 public:
59 HTMLImportChild(Document&, const KURL&, bool sync); 58 HTMLImportChild(Document&, const KURL&, bool sync);
60 virtual ~HTMLImportChild(); 59 virtual ~HTMLImportChild();
61 60
62 HTMLLinkElement* link() const; 61 HTMLLinkElement* link() const;
63 Document* importedDocument() const; 62 Document* importedDocument() const;
64 const KURL& url() const { return m_url; } 63 const KURL& url() const { return m_url; }
65 64
66 void wasAlreadyLoaded(); 65 void wasAlreadyLoaded();
67 void startLoading(const ResourcePtr<RawResource>&); 66 void startLoading(const ResourcePtr<RawResource>&);
(...skipping 13 matching lines...) Expand all
81 virtual void stateDidChange() OVERRIDE; 80 virtual void stateDidChange() OVERRIDE;
82 81
83 #if !defined(NDEBUG) 82 #if !defined(NDEBUG)
84 virtual void showThis() OVERRIDE; 83 virtual void showThis() OVERRIDE;
85 #endif 84 #endif
86 85
87 void setClient(HTMLImportChildClient*); 86 void setClient(HTMLImportChildClient*);
88 void clearClient(); 87 void clearClient();
89 bool loaderHasError() const; 88 bool loaderHasError() const;
90 89
90 void didFinishLoading();
91
91 private: 92 private:
92 // RawResourceOwner doing nothing. 93 // RawResourceOwner doing nothing.
93 // HTMLImportChild owns the resource so that the contents of prefetched Reso urce doesn't go away. 94 // HTMLImportChild owns the resource so that the contents of prefetched Reso urce doesn't go away.
94 virtual void responseReceived(Resource*, const ResourceResponse&) OVERRIDE { } 95 virtual void responseReceived(Resource*, const ResourceResponse&) OVERRIDE { }
95 virtual void dataReceived(Resource*, const char*, int) OVERRIDE { } 96 virtual void dataReceived(Resource*, const char*, int) OVERRIDE { }
96 virtual void notifyFinished(Resource*) OVERRIDE { } 97 virtual void notifyFinished(Resource*) OVERRIDE { }
97 98
98 // HTMLImportLoaderClient
99 virtual void didFinishLoading() OVERRIDE;
100
101 void didFinish(); 99 void didFinish();
102 void createLoader(); 100 void createLoader();
103 void shareLoader(HTMLImportChild*); 101 void shareLoader(HTMLImportChild*);
104 void ensureLoader(); 102 void ensureLoader();
105 103
106 Document& m_master; 104 Document& m_master;
107 KURL m_url; 105 KURL m_url;
108 CustomElementMicrotaskImportStep* m_customElementMicrotaskStep; 106 CustomElementMicrotaskImportStep* m_customElementMicrotaskStep;
109 RefPtr<HTMLImportLoader> m_loader; 107 RefPtr<HTMLImportLoader> m_loader;
110 HTMLImportChildClient* m_client; 108 HTMLImportChildClient* m_client;
111 }; 109 };
112 110
113 inline HTMLImportChild* toHTMLImportChild(HTMLImport* import) 111 inline HTMLImportChild* toHTMLImportChild(HTMLImport* import)
114 { 112 {
115 ASSERT(!import || import->isChild()); 113 ASSERT(!import || import->isChild());
116 return static_cast<HTMLImportChild*>(import); 114 return static_cast<HTMLImportChild*>(import);
117 } 115 }
118 116
119 } // namespace WebCore 117 } // namespace WebCore
120 118
121 #endif // HTMLImportChild_h 119 #endif // HTMLImportChild_h
OLDNEW
« no previous file with comments | « Source/core/html/imports/HTMLImport.h ('k') | Source/core/html/imports/HTMLImportChild.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698