| 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 #include "platform/network/ContentSecurityPolicyParsers.h" | 208 #include "platform/network/ContentSecurityPolicyParsers.h" |
| 209 #include "platform/network/HTTPParsers.h" | 209 #include "platform/network/HTTPParsers.h" |
| 210 #include "platform/scheduler/CancellableTaskFactory.h" | 210 #include "platform/scheduler/CancellableTaskFactory.h" |
| 211 #include "platform/scroll/ScrollbarTheme.h" | 211 #include "platform/scroll/ScrollbarTheme.h" |
| 212 #include "platform/text/PlatformLocale.h" | 212 #include "platform/text/PlatformLocale.h" |
| 213 #include "platform/text/SegmentedString.h" | 213 #include "platform/text/SegmentedString.h" |
| 214 #include "platform/weborigin/OriginAccessEntry.h" | 214 #include "platform/weborigin/OriginAccessEntry.h" |
| 215 #include "platform/weborigin/SchemeRegistry.h" | 215 #include "platform/weborigin/SchemeRegistry.h" |
| 216 #include "platform/weborigin/SecurityOrigin.h" | 216 #include "platform/weborigin/SecurityOrigin.h" |
| 217 #include "public/platform/Platform.h" | 217 #include "public/platform/Platform.h" |
| 218 #include "public/platform/WebFrameScheduler.h" |
| 218 #include "wtf/CurrentTime.h" | 219 #include "wtf/CurrentTime.h" |
| 219 #include "wtf/DateMath.h" | 220 #include "wtf/DateMath.h" |
| 220 #include "wtf/Functional.h" | 221 #include "wtf/Functional.h" |
| 221 #include "wtf/HashFunctions.h" | 222 #include "wtf/HashFunctions.h" |
| 222 #include "wtf/MainThread.h" | 223 #include "wtf/MainThread.h" |
| 223 #include "wtf/StdLibExtras.h" | 224 #include "wtf/StdLibExtras.h" |
| 224 #include "wtf/TemporaryChange.h" | 225 #include "wtf/TemporaryChange.h" |
| 225 #include "wtf/text/StringBuffer.h" | 226 #include "wtf/text/StringBuffer.h" |
| 226 #include "wtf/text/TextEncodingRegistry.h" | 227 #include "wtf/text/TextEncodingRegistry.h" |
| 227 | 228 |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 , m_pluginLoadingTimer(this, &Document::pluginLoadingTimerFired) | 433 , m_pluginLoadingTimer(this, &Document::pluginLoadingTimerFired) |
| 433 , m_documentTiming(*this) | 434 , m_documentTiming(*this) |
| 434 , m_writeRecursionIsTooDeep(false) | 435 , m_writeRecursionIsTooDeep(false) |
| 435 , m_writeRecursionDepth(0) | 436 , m_writeRecursionDepth(0) |
| 436 , m_taskRunner(MainThreadTaskRunner::create(this)) | 437 , m_taskRunner(MainThreadTaskRunner::create(this)) |
| 437 , m_registrationContext(initializer.registrationContext(this)) | 438 , m_registrationContext(initializer.registrationContext(this)) |
| 438 , m_elementDataCacheClearTimer(this, &Document::elementDataCacheClearTimerFi
red) | 439 , m_elementDataCacheClearTimer(this, &Document::elementDataCacheClearTimerFi
red) |
| 439 , m_timeline(AnimationTimeline::create(this)) | 440 , m_timeline(AnimationTimeline::create(this)) |
| 440 , m_templateDocumentHost(nullptr) | 441 , m_templateDocumentHost(nullptr) |
| 441 , m_didAssociateFormControlsTimer(this, &Document::didAssociateFormControlsT
imerFired) | 442 , m_didAssociateFormControlsTimer(this, &Document::didAssociateFormControlsT
imerFired) |
| 443 , m_timers(Platform::current()->currentThread()->scheduler()->timerTaskRunne
r()) |
| 442 , m_hasViewportUnits(false) | 444 , m_hasViewportUnits(false) |
| 443 , m_styleRecalcElementCounter(0) | 445 , m_styleRecalcElementCounter(0) |
| 444 , m_parserSyncPolicy(AllowAsynchronousParsing) | 446 , m_parserSyncPolicy(AllowAsynchronousParsing) |
| 445 , m_nodeCount(0) | 447 , m_nodeCount(0) |
| 446 { | 448 { |
| 447 if (m_frame) { | 449 if (m_frame) { |
| 448 ASSERT(m_frame->page()); | 450 ASSERT(m_frame->page()); |
| 449 provideContextFeaturesToDocumentFrom(*this, *m_frame->page()); | 451 provideContextFeaturesToDocumentFrom(*this, *m_frame->page()); |
| 450 | 452 |
| 451 m_fetcher = m_frame->loader().documentLoader()->fetcher(); | 453 m_fetcher = m_frame->loader().documentLoader()->fetcher(); |
| 454 m_timers.setTimerTaskRunner(m_frame->frameScheduler()->timerTaskRunner()
); |
| 452 FrameFetchContext::provideDocumentToContext(m_fetcher->context(), this); | 455 FrameFetchContext::provideDocumentToContext(m_fetcher->context(), this); |
| 453 } else if (m_importsController) { | 456 } else if (m_importsController) { |
| 454 m_fetcher = FrameFetchContext::createContextAndFetcher(nullptr); | 457 m_fetcher = FrameFetchContext::createContextAndFetcher(nullptr); |
| 455 FrameFetchContext::provideDocumentToContext(m_fetcher->context(), this); | 458 FrameFetchContext::provideDocumentToContext(m_fetcher->context(), this); |
| 456 } else { | 459 } else { |
| 457 m_fetcher = ResourceFetcher::create(nullptr); | 460 m_fetcher = ResourceFetcher::create(nullptr); |
| 458 } | 461 } |
| 459 | 462 |
| 460 // We depend on the url getting immediately set in subframes, but we | 463 // We depend on the url getting immediately set in subframes, but we |
| 461 // also depend on the url NOT getting immediately set in opened windows. | 464 // also depend on the url NOT getting immediately set in opened windows. |
| (...skipping 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2195 // the context in the case where multiple Documents end up associated with | 2198 // the context in the case where multiple Documents end up associated with |
| 2196 // a single DocumentLoader (e.g., navigating to a javascript: url). | 2199 // a single DocumentLoader (e.g., navigating to a javascript: url). |
| 2197 if (!loader()) | 2200 if (!loader()) |
| 2198 m_fetcher->clearContext(); | 2201 m_fetcher->clearContext(); |
| 2199 // If this document is the master for an HTMLImportsController, sever that | 2202 // If this document is the master for an HTMLImportsController, sever that |
| 2200 // relationship. This ensures that we don't leave import loads in flight, | 2203 // relationship. This ensures that we don't leave import loads in flight, |
| 2201 // thinking they should have access to a valid frame when they don't. | 2204 // thinking they should have access to a valid frame when they don't. |
| 2202 if (m_importsController) | 2205 if (m_importsController) |
| 2203 HTMLImportsController::removeFrom(*this); | 2206 HTMLImportsController::removeFrom(*this); |
| 2204 | 2207 |
| 2208 m_timers.setTimerTaskRunner(Platform::current()->currentThread()->scheduler(
)->timerTaskRunner()); |
| 2209 |
| 2205 // This is required, as our LocalFrame might delete itself as soon as it det
aches | 2210 // This is required, as our LocalFrame might delete itself as soon as it det
aches |
| 2206 // us. However, this violates Node::detach() semantics, as it's never | 2211 // us. However, this violates Node::detach() semantics, as it's never |
| 2207 // possible to re-attach. Eventually Document::detach() should be renamed, | 2212 // possible to re-attach. Eventually Document::detach() should be renamed, |
| 2208 // or this setting of the frame to 0 could be made explicit in each of the | 2213 // or this setting of the frame to 0 could be made explicit in each of the |
| 2209 // callers of Document::detach(). | 2214 // callers of Document::detach(). |
| 2210 m_frame = nullptr; | 2215 m_frame = nullptr; |
| 2211 | 2216 |
| 2212 if (m_mediaQueryMatcher) | 2217 if (m_mediaQueryMatcher) |
| 2213 m_mediaQueryMatcher->documentDetached(); | 2218 m_mediaQueryMatcher->documentDetached(); |
| 2214 | 2219 |
| (...skipping 2613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4828 void Document::updateSecurityOrigin(PassRefPtr<SecurityOrigin> origin) | 4833 void Document::updateSecurityOrigin(PassRefPtr<SecurityOrigin> origin) |
| 4829 { | 4834 { |
| 4830 setSecurityOrigin(origin); | 4835 setSecurityOrigin(origin); |
| 4831 didUpdateSecurityOrigin(); | 4836 didUpdateSecurityOrigin(); |
| 4832 } | 4837 } |
| 4833 | 4838 |
| 4834 void Document::didUpdateSecurityOrigin() | 4839 void Document::didUpdateSecurityOrigin() |
| 4835 { | 4840 { |
| 4836 if (!m_frame) | 4841 if (!m_frame) |
| 4837 return; | 4842 return; |
| 4843 m_frame->updateFrameSecurityOrigin(); |
| 4838 m_frame->script().updateSecurityOrigin(securityOrigin()); | 4844 m_frame->script().updateSecurityOrigin(securityOrigin()); |
| 4839 } | 4845 } |
| 4840 | 4846 |
| 4841 bool Document::isContextThread() const | 4847 bool Document::isContextThread() const |
| 4842 { | 4848 { |
| 4843 return isMainThread(); | 4849 return isMainThread(); |
| 4844 } | 4850 } |
| 4845 | 4851 |
| 4846 void Document::updateFocusAppearanceSoon(bool restorePreviousSelection) | 4852 void Document::updateFocusAppearanceSoon(bool restorePreviousSelection) |
| 4847 { | 4853 { |
| (...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5741 #ifndef NDEBUG | 5747 #ifndef NDEBUG |
| 5742 using namespace blink; | 5748 using namespace blink; |
| 5743 void showLiveDocumentInstances() | 5749 void showLiveDocumentInstances() |
| 5744 { | 5750 { |
| 5745 Document::WeakDocumentSet& set = Document::liveDocumentSet(); | 5751 Document::WeakDocumentSet& set = Document::liveDocumentSet(); |
| 5746 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5752 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 5747 for (Document* document : set) | 5753 for (Document* document : set) |
| 5748 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); | 5754 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); |
| 5749 } | 5755 } |
| 5750 #endif | 5756 #endif |
| OLD | NEW |