Changeset 76652 in webkit
- Timestamp:
- Jan 25, 2011 4:10:34 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r76644 r76652 1 2011-01-25 Cris Neckar <cdn@chromium.org> 2 3 Reviewed by Adam Barth. 4 5 Test for crash when a window's location changes before creating an object URL. 6 https://bugs.webkit.org/show_bug.cgi?id=53038 7 8 * fast/dom/window-domurl-crash-expected.txt: Added. 9 * fast/dom/window-domurl-crash.html: Added. 10 1 11 2011-01-25 James Simonsen <simonjam@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r76648 r76652 1 2011-01-25 Cris Neckar <cdn@chromium.org> 2 3 Reviewed by Adam Barth. 4 5 Add a hashset of DOMURLs to ScriptExecutionContext to track back references. 6 https://bugs.webkit.org/show_bug.cgi?id=53038 7 8 Test: fast/dom/window-domurl-crash.html 9 10 * dom/ScriptExecutionContext.cpp: 11 (WebCore::ScriptExecutionContext::~ScriptExecutionContext): 12 (WebCore::ScriptExecutionContext::createdDomUrl): 13 (WebCore::ScriptExecutionContext::destroyedDomUrl): 14 * dom/ScriptExecutionContext.h: 15 (WebCore::ScriptExecutionContext::domUrls): 16 * html/DOMURL.cpp: 17 (WebCore::DOMURL::DOMURL): 18 (WebCore::DOMURL::~DOMURL): 19 (WebCore::DOMURL::contextDestroyed): 20 * html/DOMURL.h: 21 (WebCore::DOMURL::scriptExecutionContext): 22 1 23 2011-01-23 Antti Koivisto <antti@apple.com> 2 24 -
trunk/Source/WebCore/dom/ScriptExecutionContext.cpp
r76429 r76652 31 31 #include "Blob.h" 32 32 #include "BlobURL.h" 33 #include "DOMURL.h" 33 34 #include "Database.h" 34 35 #include "DatabaseTask.h" … … 121 122 for (HashSet<String>::iterator iter = m_publicBlobURLs.begin(); iter != publicBlobURLsEnd; ++iter) 122 123 ThreadableBlobRegistry::unregisterBlobURL(KURL(ParsedURLString, *iter)); 124 125 HashSet<DOMURL*>::iterator domUrlsEnd = m_domUrls.end(); 126 for (HashSet<DOMURL*>::iterator iter = m_domUrls.begin(); iter != domUrlsEnd; ++iter) { 127 ASSERT((*iter)->scriptExecutionContext() == this); 128 (*iter)->contextDestroyed(); 129 } 123 130 #endif 124 131 } … … 194 201 m_messagePorts.remove(port); 195 202 } 203 204 #if ENABLE(BLOB) 205 void ScriptExecutionContext::createdDomUrl(DOMURL* url) 206 { 207 ASSERT(url); 208 m_domUrls.add(url); 209 } 210 211 void ScriptExecutionContext::destroyedDomUrl(DOMURL* url) 212 { 213 ASSERT(url); 214 m_domUrls.remove(url); 215 } 216 #endif 196 217 197 218 bool ScriptExecutionContext::canSuspendActiveDOMObjects() -
trunk/Source/WebCore/dom/ScriptExecutionContext.h
r76248 r76652 61 61 #endif 62 62 class MessagePort; 63 class DOMURL; 63 64 class SecurityOrigin; 64 65 class ScriptCallStack; … … 113 114 const HashSet<MessagePort*>& messagePorts() const { return m_messagePorts; } 114 115 116 #if ENABLE(BLOB) 117 void createdDomUrl(DOMURL*); 118 void destroyedDomUrl(DOMURL*); 119 const HashSet<DOMURL*>& domUrls() const { return m_domUrls; } 120 #endif 115 121 void ref() { refScriptExecutionContext(); } 116 122 void deref() { derefScriptExecutionContext(); } … … 172 178 #if ENABLE(BLOB) 173 179 HashSet<String> m_publicBlobURLs; 180 HashSet<DOMURL*> m_domUrls; 174 181 #endif 175 182 -
trunk/Source/WebCore/html/DOMURL.cpp
r75739 r76652 38 38 : m_scriptExecutionContext(scriptExecutionContext) 39 39 { 40 m_scriptExecutionContext->createdDomUrl(this); 41 } 42 43 DOMURL::~DOMURL() 44 { 45 if (m_scriptExecutionContext) 46 m_scriptExecutionContext->destroyedDomUrl(this); 47 } 48 49 void DOMURL::contextDestroyed() 50 { 51 ASSERT(m_scriptExecutionContext); 52 m_scriptExecutionContext = 0; 40 53 } 41 54 -
trunk/Source/WebCore/html/DOMURL.h
r75739 r76652 41 41 public: 42 42 static PassRefPtr<DOMURL> create(ScriptExecutionContext* scriptExecutionContext) { return adoptRef(new DOMURL(scriptExecutionContext)); } 43 ~DOMURL(); 43 44 44 45 String createObjectURL(Blob*); 45 46 void revokeObjectURL(const String&); 46 47 48 void contextDestroyed(); 49 ScriptExecutionContext* scriptExecutionContext() const { return m_scriptExecutionContext; } 50 47 51 private: 48 52 explicit DOMURL(ScriptExecutionContext*);
Note: See TracChangeset
for help on using the changeset viewer.