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

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

Issue 2550373005: Make WebTaskRunner ThreadSafeRefCounted (Closed)
Patch Set: +DISALLOW_COPY_AND_ASSIGN for win build fix Created 3 years, 11 months 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
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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 TaskRunnerHelper::get(TaskType::UnspecedTimer, this), 480 TaskRunnerHelper::get(TaskType::UnspecedTimer, this),
481 this, 481 this,
482 &Document::elementDataCacheClearTimerFired), 482 &Document::elementDataCacheClearTimerFired),
483 m_timeline(DocumentTimeline::create(this)), 483 m_timeline(DocumentTimeline::create(this)),
484 m_compositorPendingAnimations(new CompositorPendingAnimations(*this)), 484 m_compositorPendingAnimations(new CompositorPendingAnimations(*this)),
485 m_templateDocumentHost(nullptr), 485 m_templateDocumentHost(nullptr),
486 m_didAssociateFormControlsTimer( 486 m_didAssociateFormControlsTimer(
487 TaskRunnerHelper::get(TaskType::UnspecedLoading, this), 487 TaskRunnerHelper::get(TaskType::UnspecedLoading, this),
488 this, 488 this,
489 &Document::didAssociateFormControlsTimerFired), 489 &Document::didAssociateFormControlsTimerFired),
490 m_timers(TaskRunnerHelper::get(TaskType::Timer, this)->clone()), 490 m_timers(TaskRunnerHelper::get(TaskType::Timer, this)),
491 m_hasViewportUnits(false), 491 m_hasViewportUnits(false),
492 m_parserSyncPolicy(AllowAsynchronousParsing), 492 m_parserSyncPolicy(AllowAsynchronousParsing),
493 m_nodeCount(0), 493 m_nodeCount(0),
494 m_wouldLoadReason(Created), 494 m_wouldLoadReason(Created),
495 m_passwordCount(0), 495 m_passwordCount(0),
496 m_engagementLevel(mojom::blink::EngagementLevel::NONE) { 496 m_engagementLevel(mojom::blink::EngagementLevel::NONE) {
497 if (m_frame) { 497 if (m_frame) {
498 DCHECK(m_frame->page()); 498 DCHECK(m_frame->page());
499 provideContextFeaturesToDocumentFrom(*this, *m_frame->page()); 499 provideContextFeaturesToDocumentFrom(*this, *m_frame->page());
500 500
(...skipping 1993 matching lines...) Expand 10 before | Expand all | Expand 10 after
2494 if (!loader()) 2494 if (!loader())
2495 m_fetcher->clearContext(); 2495 m_fetcher->clearContext();
2496 // If this document is the master for an HTMLImportsController, sever that 2496 // If this document is the master for an HTMLImportsController, sever that
2497 // relationship. This ensures that we don't leave import loads in flight, 2497 // relationship. This ensures that we don't leave import loads in flight,
2498 // thinking they should have access to a valid frame when they don't. 2498 // thinking they should have access to a valid frame when they don't.
2499 if (m_importsController) { 2499 if (m_importsController) {
2500 m_importsController->dispose(); 2500 m_importsController->dispose();
2501 clearImportsController(); 2501 clearImportsController();
2502 } 2502 }
2503 2503
2504 m_timers.setTimerTaskRunner(Platform::current() 2504 m_timers.setTimerTaskRunner(
2505 ->currentThread() 2505 Platform::current()->currentThread()->scheduler()->timerTaskRunner());
2506 ->scheduler()
2507 ->timerTaskRunner()
2508 ->clone());
2509 2506
2510 if (m_mediaQueryMatcher) 2507 if (m_mediaQueryMatcher)
2511 m_mediaQueryMatcher->documentDetached(); 2508 m_mediaQueryMatcher->documentDetached();
2512 2509
2513 m_lifecycle.advanceTo(DocumentLifecycle::Stopped); 2510 m_lifecycle.advanceTo(DocumentLifecycle::Stopped);
2514 2511
2515 // TODO(haraken): Call contextDestroyed() before we start any disruptive 2512 // TODO(haraken): Call contextDestroyed() before we start any disruptive
2516 // operations. 2513 // operations.
2517 // TODO(haraken): Currently we call notifyContextDestroyed() only in 2514 // TODO(haraken): Currently we call notifyContextDestroyed() only in
2518 // Document::detachLayoutTree(), which means that we don't call 2515 // Document::detachLayoutTree(), which means that we don't call
(...skipping 4064 matching lines...) Expand 10 before | Expand all | Expand 10 after
6583 } 6580 }
6584 6581
6585 void showLiveDocumentInstances() { 6582 void showLiveDocumentInstances() {
6586 WeakDocumentSet& set = liveDocumentSet(); 6583 WeakDocumentSet& set = liveDocumentSet();
6587 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6584 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6588 for (Document* document : set) 6585 for (Document* document : set)
6589 fprintf(stderr, "- Document %p URL: %s\n", document, 6586 fprintf(stderr, "- Document %p URL: %s\n", document,
6590 document->url().getString().utf8().data()); 6587 document->url().getString().utf8().data());
6591 } 6588 }
6592 #endif 6589 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp ('k') | third_party/WebKit/Source/core/dom/ScriptRunner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698