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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 const char* HTMLImportsController::supplementName() | 44 const char* HTMLImportsController::supplementName() |
45 { | 45 { |
46 return "HTMLImportsController"; | 46 return "HTMLImportsController"; |
47 } | 47 } |
48 | 48 |
49 void HTMLImportsController::provideTo(Document& master) | 49 void HTMLImportsController::provideTo(Document& master) |
50 { | 50 { |
51 RawPtr<HTMLImportsController> controller = new HTMLImportsController(master)
; | 51 RawPtr<HTMLImportsController> controller = new HTMLImportsController(master)
; |
52 master.setImportsController(controller.get()); | 52 master.setImportsController(controller.get()); |
53 HeapSupplement<Document>::provideTo(master, supplementName(), controller.rel
ease()); | 53 Supplement<Document>::provideTo(master, supplementName(), controller.release
()); |
54 } | 54 } |
55 | 55 |
56 void HTMLImportsController::removeFrom(Document& master) | 56 void HTMLImportsController::removeFrom(Document& master) |
57 { | 57 { |
58 HTMLImportsController* controller = master.importsController(); | 58 HTMLImportsController* controller = master.importsController(); |
59 ASSERT(controller); | 59 ASSERT(controller); |
60 controller->dispose(); | 60 controller->dispose(); |
61 static_cast<HeapSupplementable<Document>&>(master).removeSupplement(suppleme
ntName()); | 61 static_cast<Supplementable<Document>&>(master).removeSupplement(supplementNa
me()); |
62 master.setImportsController(nullptr); | 62 master.setImportsController(nullptr); |
63 } | 63 } |
64 | 64 |
65 HTMLImportsController::HTMLImportsController(Document& master) | 65 HTMLImportsController::HTMLImportsController(Document& master) |
66 : m_root(HTMLImportTreeRoot::create(&master)) | 66 : m_root(HTMLImportTreeRoot::create(&master)) |
67 { | 67 { |
68 UseCounter::count(master, UseCounter::HTMLImports); | 68 UseCounter::count(master, UseCounter::HTMLImports); |
69 } | 69 } |
70 | 70 |
71 HTMLImportsController::~HTMLImportsController() | 71 HTMLImportsController::~HTMLImportsController() |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 Document* HTMLImportsController::loaderDocumentAt(size_t i) const | 170 Document* HTMLImportsController::loaderDocumentAt(size_t i) const |
171 { | 171 { |
172 return loaderAt(i)->document(); | 172 return loaderAt(i)->document(); |
173 } | 173 } |
174 | 174 |
175 DEFINE_TRACE(HTMLImportsController) | 175 DEFINE_TRACE(HTMLImportsController) |
176 { | 176 { |
177 visitor->trace(m_root); | 177 visitor->trace(m_root); |
178 visitor->trace(m_loaders); | 178 visitor->trace(m_loaders); |
179 HeapSupplement<Document>::trace(visitor); | 179 Supplement<Document>::trace(visitor); |
180 } | 180 } |
181 | 181 |
182 } // namespace blink | 182 } // namespace blink |
OLD | NEW |