Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2457593002: Move remaining Document timers to frame-specific task runners. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 m_wellFormed(false), 421 m_wellFormed(false),
422 m_implementation(this, nullptr), 422 m_implementation(this, nullptr),
423 m_printing(NotPrinting), 423 m_printing(NotPrinting),
424 m_paginatedForScreen(false), 424 m_paginatedForScreen(false),
425 m_compatibilityMode(NoQuirksMode), 425 m_compatibilityMode(NoQuirksMode),
426 m_compatibilityModeLocked(false), 426 m_compatibilityModeLocked(false),
427 m_executeScriptsWaitingForResourcesTask(CancellableTaskFactory::create( 427 m_executeScriptsWaitingForResourcesTask(CancellableTaskFactory::create(
428 this, 428 this,
429 &Document::executeScriptsWaitingForResources)), 429 &Document::executeScriptsWaitingForResources)),
430 m_hasAutofocused(false), 430 m_hasAutofocused(false),
431 m_clearFocusedElementTimer(this, 431 m_clearFocusedElementTimer(
432 &Document::clearFocusedElementTimerFired), 432 TaskRunnerHelper::get(TaskType::Internal, this),
433 this,
434 &Document::clearFocusedElementTimerFired),
433 m_domTreeVersion(++s_globalTreeVersion), 435 m_domTreeVersion(++s_globalTreeVersion),
434 m_styleVersion(0), 436 m_styleVersion(0),
435 m_listenerTypes(0), 437 m_listenerTypes(0),
436 m_mutationObserverTypes(0), 438 m_mutationObserverTypes(0),
437 m_styleEngine(this, nullptr), 439 m_styleEngine(this, nullptr),
438 m_styleSheetList(this, nullptr), 440 m_styleSheetList(this, nullptr),
439 m_visitedLinkState(VisitedLinkState::create(*this)), 441 m_visitedLinkState(VisitedLinkState::create(*this)),
440 m_visuallyOrdered(false), 442 m_visuallyOrdered(false),
441 m_readyState(Complete), 443 m_readyState(Complete),
442 m_parsingState(FinishedParsing), 444 m_parsingState(FinishedParsing),
443 m_gotoAnchorNeededAfterStylesheetsLoad(false), 445 m_gotoAnchorNeededAfterStylesheetsLoad(false),
444 m_containsValidityStyleRules(false), 446 m_containsValidityStyleRules(false),
445 m_containsPlugins(false), 447 m_containsPlugins(false),
446 m_updateFocusAppearanceSelectionBahavior(SelectionBehaviorOnFocus::Reset), 448 m_updateFocusAppearanceSelectionBahavior(SelectionBehaviorOnFocus::Reset),
447 m_ignoreDestructiveWriteCount(0), 449 m_ignoreDestructiveWriteCount(0),
448 m_throwOnDynamicMarkupInsertionCount(0), 450 m_throwOnDynamicMarkupInsertionCount(0),
449 m_markers(new DocumentMarkerController(*this)), 451 m_markers(new DocumentMarkerController(*this)),
450 m_updateFocusAppearanceTimer(this, 452 m_updateFocusAppearanceTimer(
451 &Document::updateFocusAppearanceTimerFired), 453 TaskRunnerHelper::get(TaskType::Internal, this),
454 this,
455 &Document::updateFocusAppearanceTimerFired),
452 m_cssTarget(nullptr), 456 m_cssTarget(nullptr),
453 m_loadEventProgress(LoadEventNotRun), 457 m_loadEventProgress(LoadEventNotRun),
454 m_startTime(currentTime()), 458 m_startTime(currentTime()),
455 m_scriptRunner(ScriptRunner::create(this)), 459 m_scriptRunner(ScriptRunner::create(this)),
456 m_xmlVersion("1.0"), 460 m_xmlVersion("1.0"),
457 m_xmlStandalone(StandaloneUnspecified), 461 m_xmlStandalone(StandaloneUnspecified),
458 m_hasXMLDeclaration(0), 462 m_hasXMLDeclaration(0),
459 m_designMode(false), 463 m_designMode(false),
460 m_isRunningExecCommand(false), 464 m_isRunningExecCommand(false),
461 m_hasReceivedUserGesture(false), 465 m_hasReceivedUserGesture(false),
(...skipping 13 matching lines...) Expand all
475 this, 479 this,
476 &Document::loadEventDelayTimerFired), 480 &Document::loadEventDelayTimerFired),
477 m_pluginLoadingTimer(TaskRunnerHelper::get(TaskType::Internal, this), 481 m_pluginLoadingTimer(TaskRunnerHelper::get(TaskType::Internal, this),
478 this, 482 this,
479 &Document::pluginLoadingTimerFired), 483 &Document::pluginLoadingTimerFired),
480 m_documentTiming(*this), 484 m_documentTiming(*this),
481 m_writeRecursionIsTooDeep(false), 485 m_writeRecursionIsTooDeep(false),
482 m_writeRecursionDepth(0), 486 m_writeRecursionDepth(0),
483 m_taskRunner(MainThreadTaskRunner::create(this)), 487 m_taskRunner(MainThreadTaskRunner::create(this)),
484 m_registrationContext(initializer.registrationContext(this)), 488 m_registrationContext(initializer.registrationContext(this)),
485 m_elementDataCacheClearTimer(this, 489 m_elementDataCacheClearTimer(
486 &Document::elementDataCacheClearTimerFired), 490 TaskRunnerHelper::get(TaskType::Internal, this),
491 this,
492 &Document::elementDataCacheClearTimerFired),
487 m_timeline(DocumentTimeline::create(this)), 493 m_timeline(DocumentTimeline::create(this)),
488 m_compositorPendingAnimations(new CompositorPendingAnimations()), 494 m_compositorPendingAnimations(new CompositorPendingAnimations()),
489 m_templateDocumentHost(nullptr), 495 m_templateDocumentHost(nullptr),
490 m_didAssociateFormControlsTimer( 496 m_didAssociateFormControlsTimer(
497 TaskRunnerHelper::get(TaskType::Internal, this),
491 this, 498 this,
492 &Document::didAssociateFormControlsTimerFired), 499 &Document::didAssociateFormControlsTimerFired),
493 m_timers(TaskRunnerHelper::get(TaskType::Timer, this)->clone()), 500 m_timers(TaskRunnerHelper::get(TaskType::Timer, this)->clone()),
494 m_hasViewportUnits(false), 501 m_hasViewportUnits(false),
495 m_parserSyncPolicy(AllowAsynchronousParsing), 502 m_parserSyncPolicy(AllowAsynchronousParsing),
496 m_nodeCount(0), 503 m_nodeCount(0),
497 m_wouldLoadReason(Created) { 504 m_wouldLoadReason(Created) {
498 if (m_frame) { 505 if (m_frame) {
499 DCHECK(m_frame->page()); 506 DCHECK(m_frame->page());
500 provideContextFeaturesToDocumentFrom(*this, *m_frame->page()); 507 provideContextFeaturesToDocumentFrom(*this, *m_frame->page());
(...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after
2060 StyleChangeReason::PseudoClass, StyleChangeExtraData::Focus)); 2067 StyleChangeReason::PseudoClass, StyleChangeExtraData::Focus));
2061 } 2068 }
2062 2069
2063 void Document::clearFocusedElementSoon() { 2070 void Document::clearFocusedElementSoon() {
2064 if (!m_clearFocusedElementTimer.isActive()) 2071 if (!m_clearFocusedElementTimer.isActive())
2065 m_clearFocusedElementTimer.startOneShot(0, BLINK_FROM_HERE); 2072 m_clearFocusedElementTimer.startOneShot(0, BLINK_FROM_HERE);
2066 } 2073 }
2067 2074
2068 void Document::clearFocusedElementTimerFired(TimerBase*) { 2075 void Document::clearFocusedElementTimerFired(TimerBase*) {
2069 updateStyleAndLayoutTree(); 2076 updateStyleAndLayoutTree();
2070 m_clearFocusedElementTimer.stop();
2071 2077
2072 if (m_focusedElement && !m_focusedElement->isFocusable()) 2078 if (m_focusedElement && !m_focusedElement->isFocusable())
2073 m_focusedElement->blur(); 2079 m_focusedElement->blur();
2074 } 2080 }
2075 2081
2076 // FIXME: This is a bad idea and needs to be removed eventually. 2082 // FIXME: This is a bad idea and needs to be removed eventually.
2077 // Other browsers load stylesheets before they continue parsing the web page. 2083 // Other browsers load stylesheets before they continue parsing the web page.
2078 // Since we don't, we can run JavaScript code that needs answers before the 2084 // Since we don't, we can run JavaScript code that needs answers before the
2079 // stylesheets are loaded. Doing a layout ignoring the pending stylesheets 2085 // stylesheets are loaded. Doing a layout ignoring the pending stylesheets
2080 // lets us get reasonable answers. The long term solution to this problem is 2086 // lets us get reasonable answers. The long term solution to this problem is
(...skipping 4329 matching lines...) Expand 10 before | Expand all | Expand 10 after
6410 } 6416 }
6411 6417
6412 void showLiveDocumentInstances() { 6418 void showLiveDocumentInstances() {
6413 WeakDocumentSet& set = liveDocumentSet(); 6419 WeakDocumentSet& set = liveDocumentSet();
6414 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6420 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6415 for (Document* document : set) 6421 for (Document* document : set)
6416 fprintf(stderr, "- Document %p URL: %s\n", document, 6422 fprintf(stderr, "- Document %p URL: %s\n", document,
6417 document->url().getString().utf8().data()); 6423 document->url().getString().utf8().data());
6418 } 6424 }
6419 #endif 6425 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698