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

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

Issue 451153002: Oilpan: Move ConsoleMessage to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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 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 5007 matching lines...) Expand 10 before | Expand all | Expand 10 after
5018 5018
5019 String messageURL = sourceURL; 5019 String messageURL = sourceURL;
5020 if (!scriptState && sourceURL.isNull() && !lineNumber) { 5020 if (!scriptState && sourceURL.isNull() && !lineNumber) {
5021 messageURL = url().string(); 5021 messageURL = url().string();
5022 if (parsing() && !isInDocumentWrite() && scriptableDocumentParser()) { 5022 if (parsing() && !isInDocumentWrite() && scriptableDocumentParser()) {
5023 ScriptableDocumentParser* parser = scriptableDocumentParser(); 5023 ScriptableDocumentParser* parser = scriptableDocumentParser();
5024 if (!parser->isWaitingForScripts() && !parser->isExecutingScript()) 5024 if (!parser->isWaitingForScripts() && !parser->isExecutingScript())
5025 lineNumber = parser->lineNumber().oneBasedInt(); 5025 lineNumber = parser->lineNumber().oneBasedInt();
5026 } 5026 }
5027 } 5027 }
5028 RefPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(source, level , message, messageURL, lineNumber); 5028 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(s ource, level, message, messageURL, lineNumber);
5029 consoleMessage->setCallStack(callStack); 5029 consoleMessage->setCallStack(callStack);
5030 consoleMessage->setScriptState(scriptState); 5030 consoleMessage->setScriptState(scriptState);
5031 m_frame->console().addMessage(consoleMessage.release()); 5031 m_frame->console().addMessage(consoleMessage.release());
5032 } 5032 }
5033 5033
5034 void Document::addConsoleMessageWithRequestIdentifier(MessageSource source, Mess ageLevel level, const String& message, unsigned long requestIdentifier) 5034 void Document::addConsoleMessageWithRequestIdentifier(MessageSource source, Mess ageLevel level, const String& message, unsigned long requestIdentifier)
5035 { 5035 {
5036 if (!isContextThread()) { 5036 if (!isContextThread()) {
5037 m_taskRunner->postTask(AddConsoleMessageTask::create(source, level, mess age)); 5037 m_taskRunner->postTask(AddConsoleMessageTask::create(source, level, mess age));
5038 return; 5038 return;
5039 } 5039 }
5040 5040
5041 if (m_frame) { 5041 if (m_frame) {
5042 RefPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(source, l evel, message); 5042 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::crea te(source, level, message);
5043 consoleMessage->setRequestIdentifier(requestIdentifier); 5043 consoleMessage->setRequestIdentifier(requestIdentifier);
5044 m_frame->console().addMessage(consoleMessage.release()); 5044 m_frame->console().addMessage(consoleMessage.release());
5045 } 5045 }
5046 } 5046 }
5047 5047
5048 // FIXME(crbug.com/305497): This should be removed after ExecutionContext-LocalD OMWindow migration. 5048 // FIXME(crbug.com/305497): This should be removed after ExecutionContext-LocalD OMWindow migration.
5049 void Document::postTask(PassOwnPtr<ExecutionContextTask> task) 5049 void Document::postTask(PassOwnPtr<ExecutionContextTask> task)
5050 { 5050 {
5051 m_taskRunner->postTask(task); 5051 m_taskRunner->postTask(task);
5052 } 5052 }
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
5902 using namespace blink; 5902 using namespace blink;
5903 void showLiveDocumentInstances() 5903 void showLiveDocumentInstances()
5904 { 5904 {
5905 WeakDocumentSet& set = liveDocumentSet(); 5905 WeakDocumentSet& set = liveDocumentSet();
5906 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5906 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5907 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) { 5907 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) {
5908 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data()); 5908 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data());
5909 } 5909 }
5910 } 5910 }
5911 #endif 5911 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/frame/FrameConsole.h » ('j') | Source/core/inspector/ConsoleMessage.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698