| 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 , m_weakFactory(this) | 49 , m_weakFactory(this) |
| 50 #endif | 50 #endif |
| 51 , m_loader(loader) | 51 , m_loader(loader) |
| 52 , m_client(nullptr) | 52 , m_client(nullptr) |
| 53 { | 53 { |
| 54 } | 54 } |
| 55 | 55 |
| 56 HTMLImportChild::~HTMLImportChild() | 56 HTMLImportChild::~HTMLImportChild() |
| 57 { | 57 { |
| 58 #if !ENABLE(OILPAN) | 58 #if !ENABLE(OILPAN) |
| 59 // importDestroyed() should be called before the destruction. | 59 // dispose() should be called before the destruction. |
| 60 ASSERT(!m_loader); | 60 ASSERT(!m_loader); |
| 61 | 61 |
| 62 if (m_client) | 62 if (m_client) |
| 63 m_client->importChildWasDestroyed(this); | 63 m_client->importChildWasDestroyed(this); |
| 64 #endif | 64 #endif |
| 65 } | 65 } |
| 66 | 66 |
| 67 void HTMLImportChild::ownerInserted() | 67 void HTMLImportChild::ownerInserted() |
| 68 { | 68 { |
| 69 if (!m_loader->isDone()) | 69 if (!m_loader->isDone()) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 93 stateWillChange(); | 93 stateWillChange(); |
| 94 CustomElement::didFinishLoadingImport(*(root()->document())); | 94 CustomElement::didFinishLoadingImport(*(root()->document())); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void HTMLImportChild::didFinishUpgradingCustomElements() | 97 void HTMLImportChild::didFinishUpgradingCustomElements() |
| 98 { | 98 { |
| 99 stateWillChange(); | 99 stateWillChange(); |
| 100 m_customElementMicrotaskStep.clear(); | 100 m_customElementMicrotaskStep.clear(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 #if !ENABLE(OILPAN) | 103 void HTMLImportChild::dispose() |
| 104 void HTMLImportChild::importDestroyed() | |
| 105 { | 104 { |
| 106 if (parent()) | 105 if (parent()) |
| 107 parent()->removeChild(this); | 106 parent()->removeChild(this); |
| 108 | 107 |
| 109 ASSERT(m_loader); | 108 ASSERT(m_loader); |
| 110 m_loader->removeImport(this); | 109 m_loader->removeImport(this); |
| 111 m_loader = nullptr; | 110 m_loader = nullptr; |
| 112 } | 111 } |
| 113 #endif | |
| 114 | 112 |
| 115 Document* HTMLImportChild::document() const | 113 Document* HTMLImportChild::document() const |
| 116 { | 114 { |
| 117 ASSERT(m_loader); | 115 ASSERT(m_loader); |
| 118 return m_loader->document(); | 116 return m_loader->document(); |
| 119 } | 117 } |
| 120 | 118 |
| 121 void HTMLImportChild::stateWillChange() | 119 void HTMLImportChild::stateWillChange() |
| 122 { | 120 { |
| 123 toHTMLImportTreeRoot(root())->scheduleRecalcState(); | 121 toHTMLImportTreeRoot(root())->scheduleRecalcState(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 154 | 152 |
| 155 bool HTMLImportChild::isDone() const | 153 bool HTMLImportChild::isDone() const |
| 156 { | 154 { |
| 157 ASSERT(m_loader); | 155 ASSERT(m_loader); |
| 158 | 156 |
| 159 return m_loader->isDone() && m_loader->microtaskQueue()->isEmpty() && !m_cus
tomElementMicrotaskStep; | 157 return m_loader->isDone() && m_loader->microtaskQueue()->isEmpty() && !m_cus
tomElementMicrotaskStep; |
| 160 } | 158 } |
| 161 | 159 |
| 162 HTMLImportLoader* HTMLImportChild::loader() const | 160 HTMLImportLoader* HTMLImportChild::loader() const |
| 163 { | 161 { |
| 164 // This should never be called after importDestroyed. | 162 // This should never be called after dispose(). |
| 165 ASSERT(m_loader); | 163 ASSERT(m_loader); |
| 166 return m_loader; | 164 return m_loader; |
| 167 } | 165 } |
| 168 | 166 |
| 169 void HTMLImportChild::setClient(HTMLImportChildClient* client) | 167 void HTMLImportChild::setClient(HTMLImportChildClient* client) |
| 170 { | 168 { |
| 171 ASSERT(client); | 169 ASSERT(client); |
| 172 ASSERT(!m_client); | 170 ASSERT(!m_client); |
| 173 m_client = client; | 171 m_client = client; |
| 174 } | 172 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 221 |
| 224 DEFINE_TRACE(HTMLImportChild) | 222 DEFINE_TRACE(HTMLImportChild) |
| 225 { | 223 { |
| 226 visitor->trace(m_customElementMicrotaskStep); | 224 visitor->trace(m_customElementMicrotaskStep); |
| 227 visitor->trace(m_loader); | 225 visitor->trace(m_loader); |
| 228 visitor->trace(m_client); | 226 visitor->trace(m_client); |
| 229 HTMLImport::trace(visitor); | 227 HTMLImport::trace(visitor); |
| 230 } | 228 } |
| 231 | 229 |
| 232 } // namespace blink | 230 } // namespace blink |
| OLD | NEW |