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

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

Issue 2583003002: Specify TaskType of posted Task explicitly in Document (2) (Closed)
Patch Set: Created 4 years 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 | « no previous file | 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 5724 matching lines...) Expand 10 before | Expand all | Expand 10 after
5735 5735
5736 static void runAddConsoleMessageTask(MessageSource source, 5736 static void runAddConsoleMessageTask(MessageSource source,
5737 MessageLevel level, 5737 MessageLevel level,
5738 const String& message, 5738 const String& message,
5739 ExecutionContext* context) { 5739 ExecutionContext* context) {
5740 context->addConsoleMessage(ConsoleMessage::create(source, level, message)); 5740 context->addConsoleMessage(ConsoleMessage::create(source, level, message));
5741 } 5741 }
5742 5742
5743 void Document::addConsoleMessage(ConsoleMessage* consoleMessage) { 5743 void Document::addConsoleMessage(ConsoleMessage* consoleMessage) {
5744 if (!isContextThread()) { 5744 if (!isContextThread()) {
5745 postTask(BLINK_FROM_HERE, createCrossThreadTask(&runAddConsoleMessageTask, 5745 postTask(TaskType::Unthrottled, BLINK_FROM_HERE,
5746 consoleMessage->source(), 5746 createCrossThreadTask(
5747 consoleMessage->level(), 5747 &runAddConsoleMessageTask, consoleMessage->source(),
5748 consoleMessage->message())); 5748 consoleMessage->level(), consoleMessage->message()));
5749 return; 5749 return;
5750 } 5750 }
5751 5751
5752 if (!m_frame) 5752 if (!m_frame)
5753 return; 5753 return;
5754 5754
5755 if (consoleMessage->location()->isUnknown()) { 5755 if (consoleMessage->location()->isUnknown()) {
5756 // TODO(dgozman): capture correct location at call places instead. 5756 // TODO(dgozman): capture correct location at call places instead.
5757 unsigned lineNumber = 0; 5757 unsigned lineNumber = 0;
5758 if (!isInDocumentWrite() && scriptableDocumentParser()) { 5758 if (!isInDocumentWrite() && scriptableDocumentParser()) {
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
6309 void Document::setAutofocusElement(Element* element) { 6309 void Document::setAutofocusElement(Element* element) {
6310 if (!element) { 6310 if (!element) {
6311 m_autofocusElement = nullptr; 6311 m_autofocusElement = nullptr;
6312 return; 6312 return;
6313 } 6313 }
6314 if (m_hasAutofocused) 6314 if (m_hasAutofocused)
6315 return; 6315 return;
6316 m_hasAutofocused = true; 6316 m_hasAutofocused = true;
6317 DCHECK(!m_autofocusElement); 6317 DCHECK(!m_autofocusElement);
6318 m_autofocusElement = element; 6318 m_autofocusElement = element;
6319 postTask(BLINK_FROM_HERE, createSameThreadTask(&runAutofocusTask)); 6319 postTask(TaskType::UserInteraction, BLINK_FROM_HERE,
6320 createSameThreadTask(&runAutofocusTask));
6320 } 6321 }
6321 6322
6322 Element* Document::activeElement() const { 6323 Element* Document::activeElement() const {
6323 if (Element* element = adjustedFocusedElement()) 6324 if (Element* element = adjustedFocusedElement())
6324 return element; 6325 return element;
6325 return body(); 6326 return body();
6326 } 6327 }
6327 6328
6328 bool Document::hasFocus() const { 6329 bool Document::hasFocus() const {
6329 return page() && page()->focusController().isDocumentFocused(*this); 6330 return page() && page()->focusController().isDocumentFocused(*this);
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
6581 } 6582 }
6582 6583
6583 void showLiveDocumentInstances() { 6584 void showLiveDocumentInstances() {
6584 WeakDocumentSet& set = liveDocumentSet(); 6585 WeakDocumentSet& set = liveDocumentSet();
6585 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6586 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6586 for (Document* document : set) 6587 for (Document* document : set)
6587 fprintf(stderr, "- Document %p URL: %s\n", document, 6588 fprintf(stderr, "- Document %p URL: %s\n", document,
6588 document->url().getString().utf8().data()); 6589 document->url().getString().utf8().data());
6589 } 6590 }
6590 #endif 6591 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698