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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
435 , m_pluginLoadingTimer(this, &Document::pluginLoadingTimerFired) | 435 , m_pluginLoadingTimer(this, &Document::pluginLoadingTimerFired) |
436 , m_documentTiming(*this) | 436 , m_documentTiming(*this) |
437 , m_writeRecursionIsTooDeep(false) | 437 , m_writeRecursionIsTooDeep(false) |
438 , m_writeRecursionDepth(0) | 438 , m_writeRecursionDepth(0) |
439 , m_taskRunner(MainThreadTaskRunner::create(this)) | 439 , m_taskRunner(MainThreadTaskRunner::create(this)) |
440 , m_registrationContext(initializer.registrationContext(this)) | 440 , m_registrationContext(initializer.registrationContext(this)) |
441 , m_elementDataCacheClearTimer(this, &Document::elementDataCacheClearTimerFi red) | 441 , m_elementDataCacheClearTimer(this, &Document::elementDataCacheClearTimerFi red) |
442 , m_timeline(AnimationTimeline::create(this)) | 442 , m_timeline(AnimationTimeline::create(this)) |
443 , m_templateDocumentHost(nullptr) | 443 , m_templateDocumentHost(nullptr) |
444 , m_didAssociateFormControlsTimer(this, &Document::didAssociateFormControlsT imerFired) | 444 , m_didAssociateFormControlsTimer(this, &Document::didAssociateFormControlsT imerFired) |
445 , m_timers(Platform::current()->currentThread()->scheduler()->timerTaskRunne r()->adoptClone()) | 445 , m_timers(timerTaskRunner()->adoptClone()) |
446 , m_hasViewportUnits(false) | 446 , m_hasViewportUnits(false) |
447 , m_styleRecalcElementCounter(0) | 447 , m_styleRecalcElementCounter(0) |
448 , m_parserSyncPolicy(AllowAsynchronousParsing) | 448 , m_parserSyncPolicy(AllowAsynchronousParsing) |
449 , m_nodeCount(0) | 449 , m_nodeCount(0) |
450 { | 450 { |
451 if (m_frame) { | 451 if (m_frame) { |
452 ASSERT(m_frame->page()); | 452 ASSERT(m_frame->page()); |
453 provideContextFeaturesToDocumentFrom(*this, *m_frame->page()); | 453 provideContextFeaturesToDocumentFrom(*this, *m_frame->page()); |
454 | 454 |
455 m_fetcher = m_frame->loader().documentLoader()->fetcher(); | 455 m_fetcher = m_frame->loader().documentLoader()->fetcher(); |
456 m_timers.setTimerTaskRunner(m_frame->frameScheduler()->timerTaskRunner() ->adoptClone()); | |
457 FrameFetchContext::provideDocumentToContext(m_fetcher->context(), this); | 456 FrameFetchContext::provideDocumentToContext(m_fetcher->context(), this); |
458 } else if (m_importsController) { | 457 } else if (m_importsController) { |
459 m_fetcher = FrameFetchContext::createContextAndFetcher(nullptr); | 458 m_fetcher = FrameFetchContext::createContextAndFetcher(nullptr); |
460 FrameFetchContext::provideDocumentToContext(m_fetcher->context(), this); | 459 FrameFetchContext::provideDocumentToContext(m_fetcher->context(), this); |
461 } else { | 460 } else { |
462 m_fetcher = ResourceFetcher::create(nullptr); | 461 m_fetcher = ResourceFetcher::create(nullptr); |
463 } | 462 } |
464 | 463 |
465 // We depend on the url getting immediately set in subframes, but we | 464 // We depend on the url getting immediately set in subframes, but we |
466 // also depend on the url NOT getting immediately set in opened windows. | 465 // also depend on the url NOT getting immediately set in opened windows. |
(...skipping 2403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2870 const KURL& Document::virtualURL() const | 2869 const KURL& Document::virtualURL() const |
2871 { | 2870 { |
2872 return m_url; | 2871 return m_url; |
2873 } | 2872 } |
2874 | 2873 |
2875 KURL Document::virtualCompleteURL(const String& url) const | 2874 KURL Document::virtualCompleteURL(const String& url) const |
2876 { | 2875 { |
2877 return completeURL(url); | 2876 return completeURL(url); |
2878 } | 2877 } |
2879 | 2878 |
2880 double Document::timerAlignmentInterval() const | |
2881 { | |
2882 Page* p = page(); | |
2883 if (!p) | |
2884 return DOMTimer::visiblePageAlignmentInterval(); | |
2885 return p->timerAlignmentInterval(); | |
2886 } | |
2887 | |
2888 DOMTimerCoordinator* Document::timers() | 2879 DOMTimerCoordinator* Document::timers() |
2889 { | 2880 { |
2890 return &m_timers; | 2881 return &m_timers; |
2891 } | 2882 } |
2892 | 2883 |
2893 EventTarget* Document::errorEventTarget() | 2884 EventTarget* Document::errorEventTarget() |
2894 { | 2885 { |
2895 return domWindow(); | 2886 return domWindow(); |
2896 } | 2887 } |
2897 | 2888 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3018 // Only imports on master documents can trigger rendering. | 3009 // Only imports on master documents can trigger rendering. |
3019 if (HTMLImportLoader* import = importLoader()) | 3010 if (HTMLImportLoader* import = importLoader()) |
3020 import->didRemoveAllPendingStylesheet(); | 3011 import->didRemoveAllPendingStylesheet(); |
3021 if (!haveImportsLoaded()) | 3012 if (!haveImportsLoaded()) |
3022 return; | 3013 return; |
3023 didLoadAllScriptBlockingResources(); | 3014 didLoadAllScriptBlockingResources(); |
3024 } | 3015 } |
3025 | 3016 |
3026 void Document::didLoadAllScriptBlockingResources() | 3017 void Document::didLoadAllScriptBlockingResources() |
3027 { | 3018 { |
3028 Platform::current()->currentThread()->scheduler()->loadingTaskRunner()->post Task( | 3019 loadingTaskRunner()->postTask(BLINK_FROM_HERE, m_executeScriptsWaitingForRes ourcesTask->cancelAndCreate()); |
3029 BLINK_FROM_HERE, m_executeScriptsWaitingForResourcesTask->cancelAndCreat e()); | |
3030 | 3020 |
3031 if (frame()) | 3021 if (frame()) |
3032 frame()->loader().client()->didRemoveAllPendingStylesheet(); | 3022 frame()->loader().client()->didRemoveAllPendingStylesheet(); |
3033 | 3023 |
3034 if (m_gotoAnchorNeededAfterStylesheetsLoad && view()) | 3024 if (m_gotoAnchorNeededAfterStylesheetsLoad && view()) |
3035 view()->processUrlFragment(m_url); | 3025 view()->processUrlFragment(m_url); |
3036 } | 3026 } |
3037 | 3027 |
3038 void Document::executeScriptsWaitingForResources() | 3028 void Document::executeScriptsWaitingForResources() |
3039 { | 3029 { |
(...skipping 2703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5743 context = context->parentDocument(); | 5733 context = context->parentDocument(); |
5744 } | 5734 } |
5745 } | 5735 } |
5746 return true; | 5736 return true; |
5747 } | 5737 } |
5748 | 5738 |
5749 WebTaskRunner* Document::loadingTaskRunner() const | 5739 WebTaskRunner* Document::loadingTaskRunner() const |
5750 { | 5740 { |
5751 if (frame()) | 5741 if (frame()) |
5752 return frame()->frameScheduler()->loadingTaskRunner(); | 5742 return frame()->frameScheduler()->loadingTaskRunner(); |
5743 if (m_importsController) | |
Sami
2015/11/26 19:27:50
I wonder if this should be done in a separate patc
alex clarke (OOO till 29th)
2015/11/27 10:01:59
I think this is a good idea. I don't think we nee
| |
5744 return m_importsController->master()->loadingTaskRunner(); | |
5745 if (m_contextDocument) | |
5746 return m_contextDocument->loadingTaskRunner(); | |
5753 return Platform::current()->currentThread()->scheduler()->loadingTaskRunner( ); | 5747 return Platform::current()->currentThread()->scheduler()->loadingTaskRunner( ); |
5754 } | 5748 } |
5755 | 5749 |
5756 WebTaskRunner* Document::timerTaskRunner() const | 5750 WebTaskRunner* Document::timerTaskRunner() const |
5757 { | 5751 { |
5758 return m_timers.timerTaskRunner(); | 5752 if (frame()) |
5753 return m_frame->frameScheduler()->timerTaskRunner(); | |
5754 if (m_importsController) | |
5755 return m_importsController->master()->timerTaskRunner(); | |
5756 if (m_contextDocument) | |
5757 return m_contextDocument->timerTaskRunner(); | |
5758 return Platform::current()->currentThread()->scheduler()->timerTaskRunner(); | |
5759 } | 5759 } |
5760 | 5760 |
5761 DEFINE_TRACE(Document) | 5761 DEFINE_TRACE(Document) |
5762 { | 5762 { |
5763 #if ENABLE(OILPAN) | 5763 #if ENABLE(OILPAN) |
5764 visitor->trace(m_importsController); | 5764 visitor->trace(m_importsController); |
5765 visitor->trace(m_docType); | 5765 visitor->trace(m_docType); |
5766 visitor->trace(m_implementation); | 5766 visitor->trace(m_implementation); |
5767 visitor->trace(m_autofocusElement); | 5767 visitor->trace(m_autofocusElement); |
5768 visitor->trace(m_focusedElement); | 5768 visitor->trace(m_focusedElement); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5829 #ifndef NDEBUG | 5829 #ifndef NDEBUG |
5830 using namespace blink; | 5830 using namespace blink; |
5831 void showLiveDocumentInstances() | 5831 void showLiveDocumentInstances() |
5832 { | 5832 { |
5833 Document::WeakDocumentSet& set = Document::liveDocumentSet(); | 5833 Document::WeakDocumentSet& set = Document::liveDocumentSet(); |
5834 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5834 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
5835 for (Document* document : set) | 5835 for (Document* document : set) |
5836 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); | 5836 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); |
5837 } | 5837 } |
5838 #endif | 5838 #endif |
OLD | NEW |