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

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

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/HTMLImportChild.h ('k') | Source/core/html/imports/HTMLImportLoader.h » ('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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 if (!m_loader) 118 if (!m_loader)
119 return 0; 119 return 0;
120 return m_loader->importedDocument(); 120 return m_loader->importedDocument();
121 } 121 }
122 122
123 void HTMLImportChild::importDestroyed() 123 void HTMLImportChild::importDestroyed()
124 { 124 {
125 if (parent()) 125 if (parent())
126 parent()->removeChild(this); 126 parent()->removeChild(this);
127 if (m_loader) { 127 if (m_loader) {
128 m_loader->removeClient(this); 128 m_loader->removeImport(this);
129 m_loader.clear(); 129 m_loader.clear();
130 } 130 }
131 } 131 }
132 132
133 HTMLImportRoot* HTMLImportChild::root() 133 HTMLImportRoot* HTMLImportChild::root()
134 { 134 {
135 return parent() ? parent()->root() : 0; 135 return parent() ? parent()->root() : 0;
136 } 136 }
137 137
138 Document* HTMLImportChild::document() const 138 Document* HTMLImportChild::document() const
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 if (HTMLImportChild* found = root()->findLinkFor(m_url, this)) 180 if (HTMLImportChild* found = root()->findLinkFor(m_url, this))
181 shareLoader(found); 181 shareLoader(found);
182 else 182 else
183 createLoader(); 183 createLoader();
184 } 184 }
185 185
186 void HTMLImportChild::createLoader() 186 void HTMLImportChild::createLoader()
187 { 187 {
188 ASSERT(!state().shouldBlockDocumentCreation()); 188 ASSERT(!state().shouldBlockDocumentCreation());
189 ASSERT(!m_loader); 189 ASSERT(!m_loader);
190 m_loader = HTMLImportLoader::create(this); 190 m_loader = HTMLImportLoader::create();
191 m_loader->addClient(this); 191 m_loader->addImport(this);
192 m_loader->startLoading(resource()); 192 m_loader->startLoading(resource());
193 } 193 }
194 194
195 void HTMLImportChild::shareLoader(HTMLImportChild* loader) 195 void HTMLImportChild::shareLoader(HTMLImportChild* loader)
196 { 196 {
197 ASSERT(!m_loader); 197 ASSERT(!m_loader);
198 m_loader = loader->m_loader; 198 m_loader = loader->m_loader;
199 m_loader->addClient(this); 199 m_loader->addImport(this);
200 stateWillChange(); 200 stateWillChange();
201 } 201 }
202 202
203 bool HTMLImportChild::isDone() const 203 bool HTMLImportChild::isDone() const
204 { 204 {
205 return m_loader && m_loader->isDone(); 205 return m_loader && m_loader->isDone();
206 } 206 }
207 207
208 bool HTMLImportChild::hasLoader() const 208 bool HTMLImportChild::hasLoader() const
209 { 209 {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 HTMLImport::showThis(); 248 HTMLImport::showThis();
249 fprintf(stderr, " loader=%p own=%s async=%s url=%s", 249 fprintf(stderr, " loader=%p own=%s async=%s url=%s",
250 m_loader.get(), 250 m_loader.get(),
251 hasLoader() && ownsLoader() ? "Y" : "N", 251 hasLoader() && ownsLoader() ? "Y" : "N",
252 isSync() ? "Y" : "N", 252 isSync() ? "Y" : "N",
253 url().string().utf8().data()); 253 url().string().utf8().data());
254 } 254 }
255 #endif 255 #endif
256 256
257 } // namespace WebCore 257 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/imports/HTMLImportChild.h ('k') | Source/core/html/imports/HTMLImportLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698