Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1755)

Side by Side Diff: Source/core/html/imports/HTMLImportsController.cpp

Issue 334263005: HTML Imports: Add an UseCounter for <link rel=import async> (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/UseCounter.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/frame/UseCounter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698