| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 44 | 44 | 
| 45 const char* HTMLImportsController::supplementName() | 45 const char* HTMLImportsController::supplementName() | 
| 46 { | 46 { | 
| 47     return "HTMLImportsController"; | 47     return "HTMLImportsController"; | 
| 48 } | 48 } | 
| 49 | 49 | 
| 50 void HTMLImportsController::provideTo(Document& master) | 50 void HTMLImportsController::provideTo(Document& master) | 
| 51 { | 51 { | 
| 52     OwnPtrWillBeRawPtr<HTMLImportsController> controller = adoptPtrWillBeNoop(ne
     w HTMLImportsController(master)); | 52     OwnPtrWillBeRawPtr<HTMLImportsController> controller = adoptPtrWillBeNoop(ne
     w HTMLImportsController(master)); | 
| 53     master.setImportsController(controller.get()); | 53     master.setImportsController(controller.get()); | 
| 54     DocumentSupplement::provideTo(master, supplementName(), controller.release()
     ); | 54     WillBeHeapSupplement<Document>::provideTo(master, supplementName(), controll
     er.release()); | 
| 55 } | 55 } | 
| 56 | 56 | 
| 57 void HTMLImportsController::removeFrom(Document& master) | 57 void HTMLImportsController::removeFrom(Document& master) | 
| 58 { | 58 { | 
| 59     HTMLImportsController* controller = master.importsController(); | 59     HTMLImportsController* controller = master.importsController(); | 
| 60     ASSERT(controller); | 60     ASSERT(controller); | 
| 61     controller->dispose(); | 61     controller->dispose(); | 
| 62     static_cast<DocumentSupplementable&>(master).removeSupplement(supplementName
     ()); | 62     static_cast<WillBeHeapSupplementable<Document>&>(master).removeSupplement(su
     pplementName()); | 
| 63     master.setImportsController(nullptr); | 63     master.setImportsController(nullptr); | 
| 64 } | 64 } | 
| 65 | 65 | 
| 66 HTMLImportsController::HTMLImportsController(Document& master) | 66 HTMLImportsController::HTMLImportsController(Document& master) | 
| 67     : m_root(HTMLImportTreeRoot::create(&master)) | 67     : m_root(HTMLImportTreeRoot::create(&master)) | 
| 68 { | 68 { | 
| 69     UseCounter::count(master, UseCounter::HTMLImports); | 69     UseCounter::count(master, UseCounter::HTMLImports); | 
| 70 } | 70 } | 
| 71 | 71 | 
| 72 HTMLImportsController::~HTMLImportsController() | 72 HTMLImportsController::~HTMLImportsController() | 
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 173 | 173 | 
| 174 Document* HTMLImportsController::loaderDocumentAt(size_t i) const | 174 Document* HTMLImportsController::loaderDocumentAt(size_t i) const | 
| 175 { | 175 { | 
| 176     return loaderAt(i)->document(); | 176     return loaderAt(i)->document(); | 
| 177 } | 177 } | 
| 178 | 178 | 
| 179 DEFINE_TRACE(HTMLImportsController) | 179 DEFINE_TRACE(HTMLImportsController) | 
| 180 { | 180 { | 
| 181     visitor->trace(m_root); | 181     visitor->trace(m_root); | 
| 182     visitor->trace(m_loaders); | 182     visitor->trace(m_loaders); | 
| 183     DocumentSupplement::trace(visitor); | 183     WillBeHeapSupplement<Document>::trace(visitor); | 
| 184 } | 184 } | 
| 185 | 185 | 
| 186 } // namespace blink | 186 } // namespace blink | 
| OLD | NEW | 
|---|