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

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

Issue 1312733003: [HTMLImport] Add an Usecounter if imported ducmnet has stylesheets. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Check if document is loaded Created 5 years, 3 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
« 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 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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/HTMLImportChild.h" 32 #include "core/html/imports/HTMLImportChild.h"
33 33
34 #include "core/css/StyleSheetList.h"
34 #include "core/dom/Document.h" 35 #include "core/dom/Document.h"
35 #include "core/dom/custom/CustomElement.h" 36 #include "core/dom/custom/CustomElement.h"
36 #include "core/dom/custom/CustomElementMicrotaskImportStep.h" 37 #include "core/dom/custom/CustomElementMicrotaskImportStep.h"
37 #include "core/dom/custom/CustomElementSyncMicrotaskQueue.h" 38 #include "core/dom/custom/CustomElementSyncMicrotaskQueue.h"
39 #include "core/frame/UseCounter.h"
38 #include "core/html/imports/HTMLImportChildClient.h" 40 #include "core/html/imports/HTMLImportChildClient.h"
39 #include "core/html/imports/HTMLImportLoader.h" 41 #include "core/html/imports/HTMLImportLoader.h"
40 #include "core/html/imports/HTMLImportTreeRoot.h" 42 #include "core/html/imports/HTMLImportTreeRoot.h"
41 #include "core/html/imports/HTMLImportsController.h" 43 #include "core/html/imports/HTMLImportsController.h"
42 44
43 namespace blink { 45 namespace blink {
44 46
45 HTMLImportChild::HTMLImportChild(const KURL& url, HTMLImportLoader* loader, Sync Mode sync) 47 HTMLImportChild::HTMLImportChild(const KURL& url, HTMLImportLoader* loader, Sync Mode sync)
46 : HTMLImport(sync) 48 : HTMLImport(sync)
47 , m_url(url) 49 , m_url(url)
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 83
82 void HTMLImportChild::didFinish() 84 void HTMLImportChild::didFinish()
83 { 85 {
84 if (m_client) 86 if (m_client)
85 m_client->didFinish(); 87 m_client->didFinish();
86 } 88 }
87 89
88 void HTMLImportChild::didFinishLoading() 90 void HTMLImportChild::didFinishLoading()
89 { 91 {
90 stateWillChange(); 92 stateWillChange();
93 if (document() && document()->styleSheets()->length() > 0)
94 UseCounter::count(root()->document(), UseCounter::HTMLImportsHasStyleShe ets);
91 CustomElement::didFinishLoadingImport(*(root()->document())); 95 CustomElement::didFinishLoadingImport(*(root()->document()));
92 } 96 }
93 97
94 void HTMLImportChild::didFinishUpgradingCustomElements() 98 void HTMLImportChild::didFinishUpgradingCustomElements()
95 { 99 {
96 stateWillChange(); 100 stateWillChange();
97 m_customElementMicrotaskStep.clear(); 101 m_customElementMicrotaskStep.clear();
98 } 102 }
99 103
100 void HTMLImportChild::dispose() 104 void HTMLImportChild::dispose()
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 227
224 DEFINE_TRACE(HTMLImportChild) 228 DEFINE_TRACE(HTMLImportChild)
225 { 229 {
226 visitor->trace(m_customElementMicrotaskStep); 230 visitor->trace(m_customElementMicrotaskStep);
227 visitor->trace(m_loader); 231 visitor->trace(m_loader);
228 visitor->trace(m_client); 232 visitor->trace(m_client);
229 HTMLImport::trace(visitor); 233 HTMLImport::trace(visitor);
230 } 234 }
231 235
232 } // namespace blink 236 } // namespace blink
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