| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
| (...skipping 2304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2315 void Document::removeAllEventListeners() | 2315 void Document::removeAllEventListeners() |
| 2316 { | 2316 { |
| 2317 ContainerNode::removeAllEventListeners(); | 2317 ContainerNode::removeAllEventListeners(); |
| 2318 | 2318 |
| 2319 if (LocalDOMWindow* domWindow = this->domWindow()) | 2319 if (LocalDOMWindow* domWindow = this->domWindow()) |
| 2320 domWindow->removeAllEventListeners(); | 2320 domWindow->removeAllEventListeners(); |
| 2321 } | 2321 } |
| 2322 | 2322 |
| 2323 Document& Document::axObjectCacheOwner() const | 2323 Document& Document::axObjectCacheOwner() const |
| 2324 { | 2324 { |
| 2325 // FIXME(dmazzoni): Currently there's one AXObjectCache per page, owned | |
| 2326 // by the top document, but with --site-isolation the top document may | |
| 2327 // be a remote frame. As a quick fix we're making the local root the owner | |
| 2328 // of the AXObjectCache (http://crbug.com/510410), but the proper fix | |
| 2329 // will be for each Document to have its own AXObjectCache | |
| 2330 // (http://crbug.com/532249). | |
| 2331 Document* top = const_cast<Document*>(this); | 2325 Document* top = const_cast<Document*>(this); |
| 2332 LocalFrame* frame = this->frame(); | |
| 2333 if (!frame) | |
| 2334 return *top; | |
| 2335 | |
| 2336 // This loop is more efficient than calling localFrameRoot. | |
| 2337 while (frame && frame->owner() && frame->owner()->isLocal()) { | |
| 2338 HTMLFrameOwnerElement* owner = toHTMLFrameOwnerElement(frame->owner()); | |
| 2339 top = &owner->document(); | |
| 2340 frame = top->frame(); | |
| 2341 } | |
| 2342 | |
| 2343 if (top->frame() && top->frame()->pagePopupOwner()) { | 2326 if (top->frame() && top->frame()->pagePopupOwner()) { |
| 2344 ASSERT(!top->m_axObjectCache); | 2327 ASSERT(!top->m_axObjectCache); |
| 2345 return top->frame()->pagePopupOwner()->document().axObjectCacheOwner(); | 2328 return top->frame()->pagePopupOwner()->document().axObjectCacheOwner(); |
| 2346 } | 2329 } |
| 2347 | |
| 2348 ASSERT(top); | |
| 2349 return *top; | 2330 return *top; |
| 2350 } | 2331 } |
| 2351 | 2332 |
| 2352 void Document::clearAXObjectCache() | 2333 void Document::clearAXObjectCache() |
| 2353 { | 2334 { |
| 2354 ASSERT(&axObjectCacheOwner() == this); | 2335 ASSERT(&axObjectCacheOwner() == this); |
| 2355 // Clear the cache member variable before calling delete because attempts | 2336 // Clear the cache member variable before calling delete because attempts |
| 2356 // are made to access it during destruction. | 2337 // are made to access it during destruction. |
| 2357 if (m_axObjectCache) | 2338 if (m_axObjectCache) |
| 2358 m_axObjectCache->dispose(); | 2339 m_axObjectCache->dispose(); |
| (...skipping 3636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5995 #ifndef NDEBUG | 5976 #ifndef NDEBUG |
| 5996 using namespace blink; | 5977 using namespace blink; |
| 5997 void showLiveDocumentInstances() | 5978 void showLiveDocumentInstances() |
| 5998 { | 5979 { |
| 5999 Document::WeakDocumentSet& set = Document::liveDocumentSet(); | 5980 Document::WeakDocumentSet& set = Document::liveDocumentSet(); |
| 6000 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5981 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6001 for (Document* document : set) | 5982 for (Document* document : set) |
| 6002 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); | 5983 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); |
| 6003 } | 5984 } |
| 6004 #endif | 5985 #endif |
| OLD | NEW |