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

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

Issue 798963002: Only populate line number in case parsing synchronously. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: deleted custom mac expectation Created 6 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 | Annotate | Revision Log
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 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 4976 matching lines...) Expand 10 before | Expand all | Expand 10 after
4987 if (!isContextThread()) { 4987 if (!isContextThread()) {
4988 m_taskRunner->postTask(AddConsoleMessageTask::create(consoleMessage->sou rce(), consoleMessage->level(), consoleMessage->message())); 4988 m_taskRunner->postTask(AddConsoleMessageTask::create(consoleMessage->sou rce(), consoleMessage->level(), consoleMessage->message()));
4989 return; 4989 return;
4990 } 4990 }
4991 4991
4992 if (!m_frame) 4992 if (!m_frame)
4993 return; 4993 return;
4994 4994
4995 if (!consoleMessage->scriptState() && consoleMessage->url().isNull() && !con soleMessage->lineNumber()) { 4995 if (!consoleMessage->scriptState() && consoleMessage->url().isNull() && !con soleMessage->lineNumber()) {
4996 consoleMessage->setURL(url().string()); 4996 consoleMessage->setURL(url().string());
4997 if (!consoleMessage->isAsync() && parsing() && !isInDocumentWrite() && s criptableDocumentParser()) { 4997 if (!isInDocumentWrite() && scriptableDocumentParser()) {
4998 ScriptableDocumentParser* parser = scriptableDocumentParser(); 4998 ScriptableDocumentParser* parser = scriptableDocumentParser();
4999 if (!parser->isWaitingForScripts() && !parser->isExecutingScript()) 4999 if (parser->isParsingAtLineNumber())
5000 consoleMessage->setLineNumber(parser->lineNumber().oneBasedInt() ); 5000 consoleMessage->setLineNumber(parser->lineNumber().oneBasedInt() );
5001 } 5001 }
5002 } 5002 }
5003 m_frame->console().addMessage(consoleMessage); 5003 m_frame->console().addMessage(consoleMessage);
5004 } 5004 }
5005 5005
5006 // FIXME(crbug.com/305497): This should be removed after ExecutionContext-LocalD OMWindow migration. 5006 // FIXME(crbug.com/305497): This should be removed after ExecutionContext-LocalD OMWindow migration.
5007 void Document::postTask(PassOwnPtr<ExecutionContextTask> task) 5007 void Document::postTask(PassOwnPtr<ExecutionContextTask> task)
5008 { 5008 {
5009 m_taskRunner->postTask(task); 5009 m_taskRunner->postTask(task);
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
5836 #ifndef NDEBUG 5836 #ifndef NDEBUG
5837 using namespace blink; 5837 using namespace blink;
5838 void showLiveDocumentInstances() 5838 void showLiveDocumentInstances()
5839 { 5839 {
5840 WeakDocumentSet& set = liveDocumentSet(); 5840 WeakDocumentSet& set = liveDocumentSet();
5841 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5841 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5842 for (Document* document : set) 5842 for (Document* document : set)
5843 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5843 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5844 } 5844 }
5845 #endif 5845 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698