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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 if (!ancestor->isRoot() && equalIgnoringFragmentIdentifier(toHTMLImportC
hild(parent)->url(), url)) | 84 if (!ancestor->isRoot() && equalIgnoringFragmentIdentifier(toHTMLImportC
hild(parent)->url(), url)) |
85 return true; | 85 return true; |
86 } | 86 } |
87 | 87 |
88 return false; | 88 return false; |
89 } | 89 } |
90 | 90 |
91 HTMLImportChild* HTMLImportsController::createChild(const KURL& url, HTMLImportL
oader* loader, HTMLImport* parent, HTMLImportChildClient* client) | 91 HTMLImportChild* HTMLImportsController::createChild(const KURL& url, HTMLImportL
oader* loader, HTMLImport* parent, HTMLImportChildClient* client) |
92 { | 92 { |
93 HTMLImport::SyncMode mode = client->isSync() && !makesCycle(parent, url) ? H
TMLImport::Sync : HTMLImport::Async; | 93 HTMLImport::SyncMode mode = client->isSync() && !makesCycle(parent, url) ? H
TMLImport::Sync : HTMLImport::Async; |
| 94 if (mode == HTMLImport::Async) |
| 95 UseCounter::count(root()->document(), UseCounter::HTMLImportsAsyncAttrib
ute); |
| 96 |
94 OwnPtrWillBeRawPtr<HTMLImportChild> child = adoptPtrWillBeNoop(new HTMLImpor
tChild(url, loader, mode)); | 97 OwnPtrWillBeRawPtr<HTMLImportChild> child = adoptPtrWillBeNoop(new HTMLImpor
tChild(url, loader, mode)); |
95 child->setClient(client); | 98 child->setClient(client); |
96 parent->appendImport(child.get()); | 99 parent->appendImport(child.get()); |
97 loader->addImport(child.get()); | 100 loader->addImport(child.get()); |
98 return root()->add(child.release()); | 101 return root()->add(child.release()); |
99 } | 102 } |
100 | 103 |
101 HTMLImportChild* HTMLImportsController::load(HTMLImport* parent, HTMLImportChild
Client* client, FetchRequest request) | 104 HTMLImportChild* HTMLImportsController::load(HTMLImport* parent, HTMLImportChild
Client* client, FetchRequest request) |
102 { | 105 { |
103 ASSERT(!request.url().isEmpty() && request.url().isValid()); | 106 ASSERT(!request.url().isEmpty() && request.url().isValid()); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 } | 175 } |
173 | 176 |
174 void HTMLImportsController::trace(Visitor* visitor) | 177 void HTMLImportsController::trace(Visitor* visitor) |
175 { | 178 { |
176 visitor->trace(m_root); | 179 visitor->trace(m_root); |
177 visitor->trace(m_loaders); | 180 visitor->trace(m_loaders); |
178 DocumentSupplement::trace(visitor); | 181 DocumentSupplement::trace(visitor); |
179 } | 182 } |
180 | 183 |
181 } // namespace WebCore | 184 } // namespace WebCore |
OLD | NEW |