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 16 matching lines...) Expand all Loading... |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "core/html/imports/HTMLImportsController.h" | 32 #include "core/html/imports/HTMLImportsController.h" |
33 | 33 |
34 #include "core/dom/Document.h" | 34 #include "core/dom/Document.h" |
35 #include "core/fetch/ResourceFetcher.h" | 35 #include "core/fetch/ResourceFetcher.h" |
36 #include "core/frame/LocalFrame.h" | 36 #include "core/frame/LocalFrame.h" |
| 37 #include "core/frame/UseCounter.h" |
37 #include "core/html/imports/HTMLImportChild.h" | 38 #include "core/html/imports/HTMLImportChild.h" |
38 #include "core/html/imports/HTMLImportChildClient.h" | 39 #include "core/html/imports/HTMLImportChildClient.h" |
39 #include "core/html/imports/HTMLImportLoader.h" | 40 #include "core/html/imports/HTMLImportLoader.h" |
40 #include "core/html/imports/HTMLImportTreeRoot.h" | 41 #include "core/html/imports/HTMLImportTreeRoot.h" |
41 | 42 |
42 namespace WebCore { | 43 namespace WebCore { |
43 | 44 |
44 void HTMLImportsController::provideTo(Document& master) | 45 void HTMLImportsController::provideTo(Document& master) |
45 { | 46 { |
46 DEFINE_STATIC_LOCAL(const char*, name, ("HTMLImportsController")); | 47 DEFINE_STATIC_LOCAL(const char*, name, ("HTMLImportsController")); |
47 OwnPtrWillBeRawPtr<HTMLImportsController> controller = adoptPtrWillBeNoop(ne
w HTMLImportsController(master)); | 48 OwnPtrWillBeRawPtr<HTMLImportsController> controller = adoptPtrWillBeNoop(ne
w HTMLImportsController(master)); |
48 master.setImportsController(controller.get()); | 49 master.setImportsController(controller.get()); |
49 DocumentSupplement::provideTo(master, name, controller.release()); | 50 DocumentSupplement::provideTo(master, name, controller.release()); |
50 } | 51 } |
51 | 52 |
52 HTMLImportsController::HTMLImportsController(Document& master) | 53 HTMLImportsController::HTMLImportsController(Document& master) |
53 : m_root(HTMLImportTreeRoot::create(&master)) | 54 : m_root(HTMLImportTreeRoot::create(&master)) |
54 { | 55 { |
| 56 UseCounter::count(master, UseCounter::HTMLImports); |
55 } | 57 } |
56 | 58 |
57 HTMLImportsController::~HTMLImportsController() | 59 HTMLImportsController::~HTMLImportsController() |
58 { | 60 { |
59 #if !ENABLE(OILPAN) | 61 #if !ENABLE(OILPAN) |
60 ASSERT(!m_root); | 62 ASSERT(!m_root); |
61 #endif | 63 #endif |
62 } | 64 } |
63 | 65 |
64 #if !ENABLE(OILPAN) | 66 #if !ENABLE(OILPAN) |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 } | 172 } |
171 | 173 |
172 void HTMLImportsController::trace(Visitor* visitor) | 174 void HTMLImportsController::trace(Visitor* visitor) |
173 { | 175 { |
174 visitor->trace(m_root); | 176 visitor->trace(m_root); |
175 visitor->trace(m_loaders); | 177 visitor->trace(m_loaders); |
176 DocumentSupplement::trace(visitor); | 178 DocumentSupplement::trace(visitor); |
177 } | 179 } |
178 | 180 |
179 } // namespace WebCore | 181 } // namespace WebCore |
OLD | NEW |