| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // An import tree node subclas to encapsulate imported document | 49 // An import tree node subclas to encapsulate imported document |
| 50 // lifecycle. This class is owned by LinkStyle. The actual loading | 50 // lifecycle. This class is owned by LinkStyle. The actual loading |
| 51 // is done by HTMLImportLoader, which can be shared among multiple | 51 // is done by HTMLImportLoader, which can be shared among multiple |
| 52 // HTMLImportChild of same link URL. | 52 // HTMLImportChild of same link URL. |
| 53 // | 53 // |
| 54 // HTMLImportChild implements ResourceClient through ResourceOwner | 54 // HTMLImportChild implements ResourceClient through ResourceOwner |
| 55 // so that it can speculatively request linked resources while it is unblocked. | 55 // so that it can speculatively request linked resources while it is unblocked. |
| 56 // | 56 // |
| 57 class HTMLImportChild FINAL : public HTMLImport, public HTMLImportLoaderClient,
public ResourceOwner<RawResource> { | 57 class HTMLImportChild FINAL : public HTMLImport, public HTMLImportLoaderClient,
public ResourceOwner<RawResource> { |
| 58 public: | 58 public: |
| 59 HTMLImportChild(const KURL&, bool createdByParser); | 59 HTMLImportChild(Document&, const KURL&, bool createdByParser); |
| 60 virtual ~HTMLImportChild(); | 60 virtual ~HTMLImportChild(); |
| 61 | 61 |
| 62 HTMLLinkElement* link() const; | 62 HTMLLinkElement* link() const; |
| 63 Document* importedDocument() const; | 63 Document* importedDocument() const; |
| 64 const KURL& url() const { return m_url; } | 64 const KURL& url() const { return m_url; } |
| 65 | 65 |
| 66 void wasAlreadyLoaded(); | 66 void wasAlreadyLoaded(); |
| 67 void startLoading(const ResourcePtr<RawResource>&); | 67 void startLoading(const ResourcePtr<RawResource>&); |
| 68 void importDestroyed(); | 68 void importDestroyed(); |
| 69 | 69 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 95 virtual void notifyFinished(Resource*) OVERRIDE { } | 95 virtual void notifyFinished(Resource*) OVERRIDE { } |
| 96 | 96 |
| 97 // HTMLImportLoaderClient | 97 // HTMLImportLoaderClient |
| 98 virtual void didFinishLoading() OVERRIDE; | 98 virtual void didFinishLoading() OVERRIDE; |
| 99 | 99 |
| 100 void didFinish(); | 100 void didFinish(); |
| 101 void createLoader(); | 101 void createLoader(); |
| 102 void shareLoader(HTMLImportChild*); | 102 void shareLoader(HTMLImportChild*); |
| 103 void ensureLoader(); | 103 void ensureLoader(); |
| 104 | 104 |
| 105 Document& m_master; |
| 105 KURL m_url; | 106 KURL m_url; |
| 106 CustomElementMicrotaskImportStep* m_customElementMicrotaskStep; | 107 CustomElementMicrotaskImportStep* m_customElementMicrotaskStep; |
| 107 RefPtr<HTMLImportLoader> m_loader; | 108 RefPtr<HTMLImportLoader> m_loader; |
| 108 HTMLImportChildClient* m_client; | 109 HTMLImportChildClient* m_client; |
| 109 }; | 110 }; |
| 110 | 111 |
| 111 inline HTMLImportChild* toHTMLImportChild(HTMLImport* import) | 112 inline HTMLImportChild* toHTMLImportChild(HTMLImport* import) |
| 112 { | 113 { |
| 113 ASSERT(!import || import->isChild()); | 114 ASSERT(!import || import->isChild()); |
| 114 return static_cast<HTMLImportChild*>(import); | 115 return static_cast<HTMLImportChild*>(import); |
| 115 } | 116 } |
| 116 | 117 |
| 117 } // namespace WebCore | 118 } // namespace WebCore |
| 118 | 119 |
| 119 #endif // HTMLImportChild_h | 120 #endif // HTMLImportChild_h |
| OLD | NEW |