Chromium Code Reviews| 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 2302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2313 void Document::removeAllEventListeners() | 2313 void Document::removeAllEventListeners() |
| 2314 { | 2314 { |
| 2315 ContainerNode::removeAllEventListeners(); | 2315 ContainerNode::removeAllEventListeners(); |
| 2316 | 2316 |
| 2317 if (LocalDOMWindow* domWindow = this->domWindow()) | 2317 if (LocalDOMWindow* domWindow = this->domWindow()) |
| 2318 domWindow->removeAllEventListeners(); | 2318 domWindow->removeAllEventListeners(); |
| 2319 } | 2319 } |
| 2320 | 2320 |
| 2321 Document& Document::axObjectCacheOwner() const | 2321 Document& Document::axObjectCacheOwner() const |
| 2322 { | 2322 { |
| 2323 // FIXME(dmazzoni): Currently there's one AXObjectCache per page, owned | |
| 2324 // by the top document, but with --site-isolation the top document may | |
| 2325 // be a remote frame. As a quick fix we're making the local root the owner | |
| 2326 // of the AXObjectCache (http://crbug.com/510410), but the proper fix | |
| 2327 // will be for each Document to have its own AXObjectCache | |
| 2328 // (http://crbug.com/532249). | |
| 2329 Document* top = const_cast<Document*>(this); | 2323 Document* top = const_cast<Document*>(this); |
|
dcheng
2016/03/08 01:14:27
Document* doc?
dmazzoni
2016/03/08 18:51:03
Done.
| |
| 2330 LocalFrame* frame = this->frame(); | |
| 2331 if (!frame) | |
| 2332 return *top; | |
| 2333 | |
| 2334 // This loop is more efficient than calling localFrameRoot. | |
| 2335 while (frame && frame->owner() && frame->owner()->isLocal()) { | |
| 2336 HTMLFrameOwnerElement* owner = toHTMLFrameOwnerElement(frame->owner()); | |
| 2337 top = &owner->document(); | |
| 2338 frame = top->frame(); | |
| 2339 } | |
| 2340 | |
| 2341 if (top->frame() && top->frame()->pagePopupOwner()) { | 2324 if (top->frame() && top->frame()->pagePopupOwner()) { |
|
dcheng
2016/03/08 01:14:27
Part of me wonders if this warrants a comment of s
dmazzoni
2016/03/08 18:51:03
Done.
| |
| 2342 ASSERT(!top->m_axObjectCache); | 2325 ASSERT(!top->m_axObjectCache); |
| 2343 return top->frame()->pagePopupOwner()->document().axObjectCacheOwner(); | 2326 return top->frame()->pagePopupOwner()->document().axObjectCacheOwner(); |
| 2344 } | 2327 } |
| 2345 | |
| 2346 ASSERT(top); | |
| 2347 return *top; | 2328 return *top; |
| 2348 } | 2329 } |
| 2349 | 2330 |
| 2350 void Document::clearAXObjectCache() | 2331 void Document::clearAXObjectCache() |
| 2351 { | 2332 { |
| 2352 ASSERT(&axObjectCacheOwner() == this); | 2333 ASSERT(&axObjectCacheOwner() == this); |
| 2353 // Clear the cache member variable before calling delete because attempts | 2334 // Clear the cache member variable before calling delete because attempts |
| 2354 // are made to access it during destruction. | 2335 // are made to access it during destruction. |
| 2355 if (m_axObjectCache) | 2336 if (m_axObjectCache) |
| 2356 m_axObjectCache->dispose(); | 2337 m_axObjectCache->dispose(); |
| (...skipping 3633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5990 #ifndef NDEBUG | 5971 #ifndef NDEBUG |
| 5991 using namespace blink; | 5972 using namespace blink; |
| 5992 void showLiveDocumentInstances() | 5973 void showLiveDocumentInstances() |
| 5993 { | 5974 { |
| 5994 Document::WeakDocumentSet& set = Document::liveDocumentSet(); | 5975 Document::WeakDocumentSet& set = Document::liveDocumentSet(); |
| 5995 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5976 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 5996 for (Document* document : set) | 5977 for (Document* document : set) |
| 5997 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); | 5978 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); |
| 5998 } | 5979 } |
| 5999 #endif | 5980 #endif |
| OLD | NEW |