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

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: with rebaselined tests. 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 4986 matching lines...) Expand 10 before | Expand all | Expand 10 after
4997 if (!isContextThread()) { 4997 if (!isContextThread()) {
4998 m_taskRunner->postTask(AddConsoleMessageTask::create(consoleMessage->sou rce(), consoleMessage->level(), consoleMessage->message())); 4998 m_taskRunner->postTask(AddConsoleMessageTask::create(consoleMessage->sou rce(), consoleMessage->level(), consoleMessage->message()));
4999 return; 4999 return;
5000 } 5000 }
5001 5001
5002 if (!m_frame) 5002 if (!m_frame)
5003 return; 5003 return;
5004 5004
5005 if (!consoleMessage->scriptState() && consoleMessage->url().isNull() && !con soleMessage->lineNumber()) { 5005 if (!consoleMessage->scriptState() && consoleMessage->url().isNull() && !con soleMessage->lineNumber()) {
5006 consoleMessage->setURL(url().string()); 5006 consoleMessage->setURL(url().string());
5007 if (!consoleMessage->isAsync() && parsing() && !isInDocumentWrite() && s criptableDocumentParser()) { 5007 if (!isInDocumentWrite() && scriptableDocumentParser()) {
5008 ScriptableDocumentParser* parser = scriptableDocumentParser(); 5008 ScriptableDocumentParser* parser = scriptableDocumentParser();
5009 if (!parser->isWaitingForScripts() && !parser->isExecutingScript()) 5009 if (parser->isParsingAtLineNumber())
5010 consoleMessage->setLineNumber(parser->lineNumber().oneBasedInt() ); 5010 consoleMessage->setLineNumber(parser->lineNumber().oneBasedInt() );
5011 } 5011 }
5012 } 5012 }
5013 m_frame->console().addMessage(consoleMessage); 5013 m_frame->console().addMessage(consoleMessage);
5014 } 5014 }
5015 5015
5016 // FIXME(crbug.com/305497): This should be removed after ExecutionContext-LocalD OMWindow migration. 5016 // FIXME(crbug.com/305497): This should be removed after ExecutionContext-LocalD OMWindow migration.
5017 void Document::postTask(PassOwnPtr<ExecutionContextTask> task) 5017 void Document::postTask(PassOwnPtr<ExecutionContextTask> task)
5018 { 5018 {
5019 m_taskRunner->postTask(task); 5019 m_taskRunner->postTask(task);
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
5846 #ifndef NDEBUG 5846 #ifndef NDEBUG
5847 using namespace blink; 5847 using namespace blink;
5848 void showLiveDocumentInstances() 5848 void showLiveDocumentInstances()
5849 { 5849 {
5850 WeakDocumentSet& set = liveDocumentSet(); 5850 WeakDocumentSet& set = liveDocumentSet();
5851 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5851 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5852 for (Document* document : set) 5852 for (Document* document : set)
5853 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5853 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5854 } 5854 }
5855 #endif 5855 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698