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

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

Issue 1119033003: Sever HTMLImportChild client connection upon disposal. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | Source/core/html/imports/HTMLImportChildClient.h » ('j') | 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 , m_loader(loader) 51 , m_loader(loader)
52 , m_client(nullptr) 52 , m_client(nullptr)
53 { 53 {
54 } 54 }
55 55
56 HTMLImportChild::~HTMLImportChild() 56 HTMLImportChild::~HTMLImportChild()
57 { 57 {
58 #if !ENABLE(OILPAN) 58 #if !ENABLE(OILPAN)
59 // dispose() should be called before the destruction. 59 // dispose() should be called before the destruction.
60 ASSERT(!m_loader); 60 ASSERT(!m_loader);
61
62 if (m_client)
63 m_client->importChildWasDestroyed(this);
64 #endif 61 #endif
65 } 62 }
66 63
67 void HTMLImportChild::ownerInserted() 64 void HTMLImportChild::ownerInserted()
68 { 65 {
69 if (!m_loader->isDone()) 66 if (!m_loader->isDone())
70 return; 67 return;
71 root()->document()->styleResolverChanged(); 68 root()->document()->styleResolverChanged();
72 } 69 }
73 70
(...skipping 27 matching lines...) Expand all
101 } 98 }
102 99
103 void HTMLImportChild::dispose() 100 void HTMLImportChild::dispose()
104 { 101 {
105 if (parent()) 102 if (parent())
106 parent()->removeChild(this); 103 parent()->removeChild(this);
107 104
108 ASSERT(m_loader); 105 ASSERT(m_loader);
109 m_loader->removeImport(this); 106 m_loader->removeImport(this);
110 m_loader = nullptr; 107 m_loader = nullptr;
108
109 if (m_client) {
110 m_client->importChildWasDisposed(this);
111 m_client = nullptr;
112 }
111 } 113 }
112 114
113 Document* HTMLImportChild::document() const 115 Document* HTMLImportChild::document() const
114 { 116 {
115 ASSERT(m_loader); 117 ASSERT(m_loader);
116 return m_loader->document(); 118 return m_loader->document();
117 } 119 }
118 120
119 void HTMLImportChild::stateWillChange() 121 void HTMLImportChild::stateWillChange()
120 { 122 {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 223
222 DEFINE_TRACE(HTMLImportChild) 224 DEFINE_TRACE(HTMLImportChild)
223 { 225 {
224 visitor->trace(m_customElementMicrotaskStep); 226 visitor->trace(m_customElementMicrotaskStep);
225 visitor->trace(m_loader); 227 visitor->trace(m_loader);
226 visitor->trace(m_client); 228 visitor->trace(m_client);
227 HTMLImport::trace(visitor); 229 HTMLImport::trace(visitor);
228 } 230 }
229 231
230 } // namespace blink 232 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/imports/HTMLImportChildClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698