Commit ed8058ee authored by joepeck@webkit.org's avatar joepeck@webkit.org

Modernize WebCore/inspector with nullptr

https://bugs.webkit.org/show_bug.cgi?id=127303

Reviewed by Anders Carlsson.

Ran clang-modernize -use-nullptr over WebCore/inspector.

* inspector/ConsoleMessage.cpp:
(WebCore::ConsoleMessage::ConsoleMessage):
* inspector/ConsoleMessage.h:
* inspector/ContentSearchUtils.cpp:
(WebCore::ContentSearchUtils::findMagicComment):
* inspector/DOMEditor.cpp:
(WebCore::DOMEditor::SetOuterHTMLAction::SetOuterHTMLAction):
* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::patchDocument):
(WebCore::DOMPatchSupport::patchNode):
(WebCore::DOMPatchSupport::diff):
(WebCore::DOMPatchSupport::innerPatchChildren):
* inspector/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorApplicationCacheAgent::assertFrameWithDocumentLoader):
* inspector/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::disable):
(WebCore::InspectorCanvasAgent::notifyRenderingContextWasWrapped):
(WebCore::InspectorCanvasAgent::frameNavigated):
* inspector/InspectorConsoleAgent.cpp:
(WebCore::InspectorConsoleAgent::InspectorConsoleAgent):
(WebCore::InspectorConsoleAgent::~InspectorConsoleAgent):
(WebCore::InspectorConsoleAgent::clearMessages):
(WebCore::InspectorConsoleAgent::didFinishXHRLoading):
(WebCore::InspectorConsoleAgent::didReceiveResponse):
(WebCore::InspectorConsoleAgent::didFailLoading):
* inspector/InspectorConsoleAgent.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::inspectedPageDestroyed):
* inspector/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::disable):
(WebCore::InspectorDOMDebuggerAgent::discardAgent):
* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::~InspectorDOMStorageAgent):
(WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
(WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
(WebCore::InspectorDOMStorageAgent::findStorageArea):
* inspector/InspectorDatabaseAgent.cpp:
(WebCore::InspectorDatabaseAgent::~InspectorDatabaseAgent):
(WebCore::InspectorDatabaseAgent::findByFileName):
(WebCore::InspectorDatabaseAgent::databaseForId):
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::addMessageToConsole):
(WebCore::InspectorDebuggerAgent::resolveBreakpoint):
(WebCore::InspectorDebuggerAgent::didParseSource):
(WebCore::InspectorDebuggerAgent::didContinue):
(WebCore::InspectorDebuggerAgent::clearBreakDetails):
* inspector/InspectorFrontendHost.cpp:
(WebCore::FrontendMenuProvider::disconnect):
(WebCore::InspectorFrontendHost::InspectorFrontendHost):
(WebCore::InspectorFrontendHost::disconnectClient):
* inspector/InspectorHeapProfilerAgent.cpp:
(WebCore::InspectorHeapProfilerAgent::~InspectorHeapProfilerAgent):
* inspector/InspectorIndexedDBAgent.cpp:
(WebCore::assertDocument):
(WebCore::assertIDBFactory):
(WebCore::InspectorIndexedDBAgent::requestData):
* inspector/InspectorInstrumentation.cpp:
(WebCore::frameForScriptExecutionContext):
(WebCore::InspectorInstrumentation::willDispatchEventOnWindowImpl):
(WebCore::InspectorInstrumentation::didReceiveResourceResponseButCanceledImpl):
(WebCore::InspectorInstrumentation::consoleAgentEnabled):
(WebCore::InspectorInstrumentation::unregisterInstrumentingAgents):
(WebCore::InspectorInstrumentation::retrieveTimelineAgent):
(WebCore::InspectorInstrumentation::instrumentingAgentsForPage):
(WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
(WebCore::InspectorInstrumentation::instrumentingAgentsForNonDocumentContext):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
(WebCore::InspectorInstrumentation::instrumentingAgentsForFrame):
(WebCore::InspectorInstrumentation::instrumentingAgentsForDocument):
* inspector/InspectorLayerTreeAgent.cpp:
(WebCore::InspectorLayerTreeAgent::disable):
* inspector/InspectorNodeFinder.cpp:
(WebCore::InspectorNodeFinder::searchUsingXPath):
* inspector/InspectorOverlay.cpp:
(WebCore::buildObjectForElementInfo):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResourceContent):
(WebCore::InspectorPageAgent::sharedBufferContent):
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::frameForId):
(WebCore::InspectorPageAgent::findFrameWithSecurityOrigin):
* inspector/InspectorProfilerAgent.cpp:
(WebCore::InspectorProfilerAgent::~InspectorProfilerAgent):
* inspector/InspectorProfilerAgent.h:
* inspector/InspectorResourceAgent.cpp:
(WebCore::buildObjectForResourceResponse):
(WebCore::InspectorResourceAgent::willSendRequest):
(WebCore::InspectorResourceAgent::didReceiveResponse):
(WebCore::InspectorResourceAgent::didFinishLoading):
(WebCore::InspectorResourceAgent::didFailLoading):
(WebCore::InspectorResourceAgent::didLoadResourceFromMemoryCache):
(WebCore::InspectorResourceAgent::disable):
* inspector/InspectorRuntimeAgent.cpp:
(WebCore::InspectorRuntimeAgent::InspectorRuntimeAgent):
* inspector/InspectorStyleSheet.cpp:
(ParsedStyleSheet::ruleSourceDataAt):
(WebCore::buildSourceRangeObject):
(WebCore::asCSSRuleList):
(WebCore::fillMediaListChain):
(WebCore::InspectorStyle::setPropertyText):
(WebCore::InspectorStyle::populateAllProperties):
(WebCore::InspectorStyle::extractSourceData):
(WebCore::InspectorStyle::newLineAndWhitespaceDelimiters):
(WebCore::InspectorStyleSheet::addRule):
(WebCore::InspectorStyleSheet::ruleForId):
(WebCore::InspectorStyleSheet::buildObjectForStyleSheet):
(WebCore::InspectorStyleSheet::buildObjectForStyleSheetInfo):
(WebCore::InspectorStyleSheet::buildObjectForRule):
(WebCore::InspectorStyleSheet::styleForId):
(WebCore::InspectorStyleSheet::inspectorStyleForId):
(WebCore::InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle):
* inspector/InspectorStyleSheet.h:
(WebCore::InspectorCSSId::asProtocolValue):
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::stop):
(WebCore::InspectorTimelineAgent::willComposite):
(WebCore::InspectorTimelineAgent::page):
* inspector/InspectorWorkerAgent.cpp:
(WebCore::InspectorWorkerAgent::~InspectorWorkerAgent):
* inspector/InstrumentingAgents.cpp:
(WebCore::InstrumentingAgents::InstrumentingAgents):
(WebCore::InstrumentingAgents::reset):
* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::ResourceData::ResourceData):
(WebCore::NetworkResourcesData::xhrReplayData):
(WebCore::NetworkResourcesData::removeCachedResource):
(WebCore::NetworkResourcesData::resourceDataForRequestId):
* inspector/PageConsoleAgent.cpp:
(WebCore::PageConsoleAgent::~PageConsoleAgent):
* inspector/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::disable):
* inspector/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::~PageRuntimeAgent):
(WebCore::PageRuntimeAgent::didCreateMainWorldContext):
(WebCore::PageRuntimeAgent::reportExecutionContextCreation):
* inspector/ScriptArguments.cpp:
(WebCore::ScriptArguments::globalState):
* inspector/WorkerRuntimeAgent.cpp:
(WebCore::WorkerRuntimeAgent::~WorkerRuntimeAgent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 03c8a837
2014-01-20 Joseph Pecoraro <pecoraro@apple.com>
Modernize WebCore/inspector with nullptr
https://bugs.webkit.org/show_bug.cgi?id=127303
Reviewed by Anders Carlsson.
Ran clang-modernize -use-nullptr over WebCore/inspector.
* inspector/ConsoleMessage.cpp:
(WebCore::ConsoleMessage::ConsoleMessage):
* inspector/ConsoleMessage.h:
* inspector/ContentSearchUtils.cpp:
(WebCore::ContentSearchUtils::findMagicComment):
* inspector/DOMEditor.cpp:
(WebCore::DOMEditor::SetOuterHTMLAction::SetOuterHTMLAction):
* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::patchDocument):
(WebCore::DOMPatchSupport::patchNode):
(WebCore::DOMPatchSupport::diff):
(WebCore::DOMPatchSupport::innerPatchChildren):
* inspector/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorApplicationCacheAgent::assertFrameWithDocumentLoader):
* inspector/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::disable):
(WebCore::InspectorCanvasAgent::notifyRenderingContextWasWrapped):
(WebCore::InspectorCanvasAgent::frameNavigated):
* inspector/InspectorConsoleAgent.cpp:
(WebCore::InspectorConsoleAgent::InspectorConsoleAgent):
(WebCore::InspectorConsoleAgent::~InspectorConsoleAgent):
(WebCore::InspectorConsoleAgent::clearMessages):
(WebCore::InspectorConsoleAgent::didFinishXHRLoading):
(WebCore::InspectorConsoleAgent::didReceiveResponse):
(WebCore::InspectorConsoleAgent::didFailLoading):
* inspector/InspectorConsoleAgent.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::inspectedPageDestroyed):
* inspector/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::disable):
(WebCore::InspectorDOMDebuggerAgent::discardAgent):
* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::~InspectorDOMStorageAgent):
(WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
(WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
(WebCore::InspectorDOMStorageAgent::findStorageArea):
* inspector/InspectorDatabaseAgent.cpp:
(WebCore::InspectorDatabaseAgent::~InspectorDatabaseAgent):
(WebCore::InspectorDatabaseAgent::findByFileName):
(WebCore::InspectorDatabaseAgent::databaseForId):
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::addMessageToConsole):
(WebCore::InspectorDebuggerAgent::resolveBreakpoint):
(WebCore::InspectorDebuggerAgent::didParseSource):
(WebCore::InspectorDebuggerAgent::didContinue):
(WebCore::InspectorDebuggerAgent::clearBreakDetails):
* inspector/InspectorFrontendHost.cpp:
(WebCore::FrontendMenuProvider::disconnect):
(WebCore::InspectorFrontendHost::InspectorFrontendHost):
(WebCore::InspectorFrontendHost::disconnectClient):
* inspector/InspectorHeapProfilerAgent.cpp:
(WebCore::InspectorHeapProfilerAgent::~InspectorHeapProfilerAgent):
* inspector/InspectorIndexedDBAgent.cpp:
(WebCore::assertDocument):
(WebCore::assertIDBFactory):
(WebCore::InspectorIndexedDBAgent::requestData):
* inspector/InspectorInstrumentation.cpp:
(WebCore::frameForScriptExecutionContext):
(WebCore::InspectorInstrumentation::willDispatchEventOnWindowImpl):
(WebCore::InspectorInstrumentation::didReceiveResourceResponseButCanceledImpl):
(WebCore::InspectorInstrumentation::consoleAgentEnabled):
(WebCore::InspectorInstrumentation::unregisterInstrumentingAgents):
(WebCore::InspectorInstrumentation::retrieveTimelineAgent):
(WebCore::InspectorInstrumentation::instrumentingAgentsForPage):
(WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
(WebCore::InspectorInstrumentation::instrumentingAgentsForNonDocumentContext):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
(WebCore::InspectorInstrumentation::instrumentingAgentsForFrame):
(WebCore::InspectorInstrumentation::instrumentingAgentsForDocument):
* inspector/InspectorLayerTreeAgent.cpp:
(WebCore::InspectorLayerTreeAgent::disable):
* inspector/InspectorNodeFinder.cpp:
(WebCore::InspectorNodeFinder::searchUsingXPath):
* inspector/InspectorOverlay.cpp:
(WebCore::buildObjectForElementInfo):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResourceContent):
(WebCore::InspectorPageAgent::sharedBufferContent):
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::frameForId):
(WebCore::InspectorPageAgent::findFrameWithSecurityOrigin):
* inspector/InspectorProfilerAgent.cpp:
(WebCore::InspectorProfilerAgent::~InspectorProfilerAgent):
* inspector/InspectorProfilerAgent.h:
* inspector/InspectorResourceAgent.cpp:
(WebCore::buildObjectForResourceResponse):
(WebCore::InspectorResourceAgent::willSendRequest):
(WebCore::InspectorResourceAgent::didReceiveResponse):
(WebCore::InspectorResourceAgent::didFinishLoading):
(WebCore::InspectorResourceAgent::didFailLoading):
(WebCore::InspectorResourceAgent::didLoadResourceFromMemoryCache):
(WebCore::InspectorResourceAgent::disable):
* inspector/InspectorRuntimeAgent.cpp:
(WebCore::InspectorRuntimeAgent::InspectorRuntimeAgent):
* inspector/InspectorStyleSheet.cpp:
(ParsedStyleSheet::ruleSourceDataAt):
(WebCore::buildSourceRangeObject):
(WebCore::asCSSRuleList):
(WebCore::fillMediaListChain):
(WebCore::InspectorStyle::setPropertyText):
(WebCore::InspectorStyle::populateAllProperties):
(WebCore::InspectorStyle::extractSourceData):
(WebCore::InspectorStyle::newLineAndWhitespaceDelimiters):
(WebCore::InspectorStyleSheet::addRule):
(WebCore::InspectorStyleSheet::ruleForId):
(WebCore::InspectorStyleSheet::buildObjectForStyleSheet):
(WebCore::InspectorStyleSheet::buildObjectForStyleSheetInfo):
(WebCore::InspectorStyleSheet::buildObjectForRule):
(WebCore::InspectorStyleSheet::styleForId):
(WebCore::InspectorStyleSheet::inspectorStyleForId):
(WebCore::InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle):
* inspector/InspectorStyleSheet.h:
(WebCore::InspectorCSSId::asProtocolValue):
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::stop):
(WebCore::InspectorTimelineAgent::willComposite):
(WebCore::InspectorTimelineAgent::page):
* inspector/InspectorWorkerAgent.cpp:
(WebCore::InspectorWorkerAgent::~InspectorWorkerAgent):
* inspector/InstrumentingAgents.cpp:
(WebCore::InstrumentingAgents::InstrumentingAgents):
(WebCore::InstrumentingAgents::reset):
* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::ResourceData::ResourceData):
(WebCore::NetworkResourcesData::xhrReplayData):
(WebCore::NetworkResourcesData::removeCachedResource):
(WebCore::NetworkResourcesData::resourceDataForRequestId):
* inspector/PageConsoleAgent.cpp:
(WebCore::PageConsoleAgent::~PageConsoleAgent):
* inspector/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::disable):
* inspector/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::~PageRuntimeAgent):
(WebCore::PageRuntimeAgent::didCreateMainWorldContext):
(WebCore::PageRuntimeAgent::reportExecutionContextCreation):
* inspector/ScriptArguments.cpp:
(WebCore::ScriptArguments::globalState):
* inspector/WorkerRuntimeAgent.cpp:
(WebCore::WorkerRuntimeAgent::~WorkerRuntimeAgent):
2014-01-20 Anders Carlsson <andersca@apple.com>
Add empty UserContentController class
......@@ -82,7 +82,7 @@ ConsoleMessage::ConsoleMessage(bool, MessageSource source, MessageType type, Mes
, m_type(type)
, m_level(level)
, m_message(message)
, m_arguments(0)
, m_arguments(nullptr)
, m_line(0)
, m_column(0)
, m_repeatCount(1)
......
......@@ -54,7 +54,7 @@ class ConsoleMessage {
WTF_MAKE_NONCOPYABLE(ConsoleMessage); WTF_MAKE_FAST_ALLOCATED;
public:
ConsoleMessage(bool canGenerateCallStack, MessageSource, MessageType, MessageLevel, const String& message, unsigned long requestIdentifier = 0);
ConsoleMessage(bool canGenerateCallStack, MessageSource, MessageType, MessageLevel, const String& message, const String& url, unsigned line, unsigned column, JSC::ExecState* = 0, unsigned long requestIdentifier = 0);
ConsoleMessage(bool canGenerateCallStack, MessageSource, MessageType, MessageLevel, const String& message, const String& url, unsigned line, unsigned column, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0);
ConsoleMessage(bool canGenerateCallStack, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptCallStack>, unsigned long requestIdentifier = 0);
ConsoleMessage(bool canGenerateCallStack, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptArguments>, JSC::ExecState*, unsigned long requestIdentifier = 0);
~ConsoleMessage();
......@@ -73,7 +73,7 @@ public:
unsigned argumentCount();
private:
void autogenerateMetadata(bool canGenerateCallStack, JSC::ExecState* = 0);
void autogenerateMetadata(bool canGenerateCallStack, JSC::ExecState* = nullptr);
MessageSource m_source;
MessageType m_type;
......
......@@ -181,7 +181,7 @@ static String stylesheetCommentPattern(const String& name)
static String findMagicComment(const String& content, const String& patternString)
{
const char* error = 0;
const char* error = nullptr;
JSC::Yarr::YarrPattern pattern(patternString, false, true, &error);
ASSERT(!error);
BumpPointerAllocator regexAllocator;
......
......@@ -207,7 +207,7 @@ public:
, m_node(node)
, m_nextSibling(node.nextSibling())
, m_html(html)
, m_newNode(0)
, m_newNode(nullptr)
, m_history(adoptPtr(new InspectorHistory()))
, m_domEditor(adoptPtr(new DOMEditor(m_history.get())))
{
......
......@@ -89,12 +89,12 @@ void DOMPatchSupport::patchDocument(const String& markup)
{
RefPtr<Document> newDocument;
if (m_document->isHTMLDocument())
newDocument = HTMLDocument::create(0, URL());
newDocument = HTMLDocument::create(nullptr, URL());
else if (m_document->isXHTMLDocument())
newDocument = HTMLDocument::createXHTML(0, URL());
newDocument = HTMLDocument::createXHTML(nullptr, URL());
#if ENABLE(SVG)
else if (m_document->isSVGDocument())
newDocument = Document::create(0, URL());
newDocument = Document::create(nullptr, URL());
#endif
ASSERT(newDocument);
......@@ -102,12 +102,12 @@ void DOMPatchSupport::patchDocument(const String& markup)
if (newDocument->isHTMLDocument())
parser = HTMLDocumentParser::create(static_cast<HTMLDocument&>(*newDocument));
else
parser = XMLDocumentParser::create(*newDocument, 0);
parser = XMLDocumentParser::create(*newDocument, nullptr);
parser->insert(markup); // Use insert() so that the parser will not yield.
parser->finish();
parser->detach();
OwnPtr<Digest> oldInfo = createDigest(m_document->documentElement(), 0);
OwnPtr<Digest> oldInfo = createDigest(m_document->documentElement(), nullptr);
OwnPtr<Digest> newInfo = createDigest(newDocument->documentElement(), &m_unusedNodesMap);
if (!innerPatchNode(oldInfo.get(), newInfo.get(), IGNORE_EXCEPTION)) {
......@@ -122,7 +122,7 @@ Node* DOMPatchSupport::patchNode(Node& node, const String& markup, ExceptionCode
// Don't parse <html> as a fragment.
if (node.isDocumentNode() || (node.parentNode() && node.parentNode()->isDocumentNode())) {
patchDocument(markup);
return 0;
return nullptr;
}
Node* previousSibling = node.previousSibling();
......@@ -137,13 +137,13 @@ Node* DOMPatchSupport::patchNode(Node& node, const String& markup, ExceptionCode
ContainerNode* parentNode = node.parentNode();
Vector<OwnPtr<Digest>> oldList;
for (Node* child = parentNode->firstChild(); child; child = child->nextSibling())
oldList.append(createDigest(child, 0));
oldList.append(createDigest(child, nullptr));
// Compose the new list.
String markupCopy = markup.lower();
Vector<OwnPtr<Digest>> newList;
for (Node* child = parentNode->firstChild(); child != &node; child = child->nextSibling())
newList.append(createDigest(child, 0));
newList.append(createDigest(child, nullptr));
for (Node* child = fragment->firstChild(); child; child = child->nextSibling()) {
if (child->hasTagName(headTag) && !child->firstChild() && markupCopy.find("</head>") == notFound)
continue; // HTML5 parser inserts empty <head> tag whenever it parses <body>
......@@ -152,13 +152,13 @@ Node* DOMPatchSupport::patchNode(Node& node, const String& markup, ExceptionCode
newList.append(createDigest(child, &m_unusedNodesMap));
}
for (Node* child = node.nextSibling(); child; child = child->nextSibling())
newList.append(createDigest(child, 0));
newList.append(createDigest(child, nullptr));
if (!innerPatchChildren(parentNode, oldList, newList, ec)) {
// Fall back to total replace.
ec = 0;
if (!m_domEditor->replaceChild(parentNode, fragment.release(), &node, ec))
return 0;
return nullptr;
}
return previousSibling ? previousSibling->nextSibling() : parentNode->firstChild();
}
......@@ -218,12 +218,12 @@ DOMPatchSupport::diff(const Vector<OwnPtr<Digest>>& oldList, const Vector<OwnPtr
ResultMap oldMap(oldList.size());
for (size_t i = 0; i < oldMap.size(); ++i) {
oldMap[i].first = 0;
oldMap[i].first = nullptr;
oldMap[i].second = 0;
}
for (size_t i = 0; i < newMap.size(); ++i) {
newMap[i].first = 0;
newMap[i].first = nullptr;
newMap[i].second = 0;
}
......@@ -305,8 +305,8 @@ bool DOMPatchSupport::innerPatchChildren(ContainerNode* parentNode, const Vector
ResultMap& oldMap = resultMaps.first;
ResultMap& newMap = resultMaps.second;
Digest* oldHead = 0;
Digest* oldBody = 0;
Digest* oldHead = nullptr;
Digest* oldBody = nullptr;
// 1. First strip everything except for the nodes that retain. Collect pending merges.
HashMap<Digest*, Digest*> merges;
......@@ -317,7 +317,7 @@ bool DOMPatchSupport::innerPatchChildren(ContainerNode* parentNode, const Vector
usedNewOrdinals.add(oldMap[i].second);
continue;
}
oldMap[i].first = 0;
oldMap[i].first = nullptr;
oldMap[i].second = 0;
}
......@@ -356,7 +356,7 @@ bool DOMPatchSupport::innerPatchChildren(ContainerNode* parentNode, const Vector
size_t oldOrdinal = newMap[i].second;
if (usedOldOrdinals.contains(oldOrdinal)) {
// Do not map node more than once
newMap[i].first = 0;
newMap[i].first = nullptr;
newMap[i].second = 0;
continue;
}
......
......@@ -62,7 +62,7 @@ void InspectorApplicationCacheAgent::willDestroyFrontendAndBackend()
m_frontendDispatcher = nullptr;
m_backendDispatcher.clear();
m_instrumentingAgents->setInspectorApplicationCacheAgent(0);
m_instrumentingAgents->setInspectorApplicationCacheAgent(nullptr);
}
void InspectorApplicationCacheAgent::enable(ErrorString*)
......@@ -120,7 +120,7 @@ DocumentLoader* InspectorApplicationCacheAgent::assertFrameWithDocumentLoader(Er
{
Frame* frame = m_pageAgent->assertFrame(errorString, frameId);
if (!frame)
return 0;
return nullptr;
return InspectorPageAgent::assertDocumentLoader(errorString, frame);
}
......
......@@ -100,7 +100,7 @@ void InspectorCanvasAgent::enable(ErrorString*)
void InspectorCanvasAgent::disable(ErrorString*)
{
m_enabled = false;
m_instrumentingAgents->setInspectorCanvasAgent(0);
m_instrumentingAgents->setInspectorCanvasAgent(nullptr);
m_framesWithUninstrumentedCanvases.clear();
}
......@@ -203,8 +203,8 @@ Deprecated::ScriptObject InspectorCanvasAgent::notifyRenderingContextWasWrapped(
{
ASSERT(m_frontendDispatcher);
JSC::ExecState* scriptState = wrappedContext.scriptState();
DOMWindow* domWindow = scriptState ? domWindowFromExecState(scriptState) : 0;
Frame* frame = domWindow ? domWindow->frame() : 0;
DOMWindow* domWindow = scriptState ? domWindowFromExecState(scriptState) : nullptr;
Frame* frame = domWindow ? domWindow->frame() : nullptr;
if (frame && !m_framesWithUninstrumentedCanvases.contains(frame))
m_framesWithUninstrumentedCanvases.set(frame, false);
String frameId = m_pageAgent->frameId(frame);
......@@ -291,14 +291,14 @@ void InspectorCanvasAgent::frameNavigated(Frame* frame)
if (frame == m_pageAgent->mainFrame()) {
for (FramesWithUninstrumentedCanvases::iterator it = m_framesWithUninstrumentedCanvases.begin(); it != m_framesWithUninstrumentedCanvases.end(); ++it)
m_framesWithUninstrumentedCanvases.set(it->key, false);
m_frontendDispatcher->traceLogsRemoved(0, 0);
m_frontendDispatcher->traceLogsRemoved(nullptr, nullptr);
} else {
while (frame) {
if (m_framesWithUninstrumentedCanvases.contains(frame))
m_framesWithUninstrumentedCanvases.set(frame, false);
if (m_pageAgent->hasIdForFrame(frame)) {
String frameId = m_pageAgent->frameId(frame);
m_frontendDispatcher->traceLogsRemoved(&frameId, 0);
m_frontendDispatcher->traceLogsRemoved(&frameId, nullptr);
}
frame = frame->tree().traverseNext();
}
......
......@@ -63,7 +63,7 @@ int InspectorConsoleAgent::s_enabledAgentCount = 0;
InspectorConsoleAgent::InspectorConsoleAgent(InstrumentingAgents* instrumentingAgents, PageInjectedScriptManager* injectedScriptManager)
: InspectorAgentBase(ASCIILiteral("Console"), instrumentingAgents)
, m_injectedScriptManager(injectedScriptManager)
, m_previousMessage(0)
, m_previousMessage(nullptr)
, m_expiredConsoleMessageCount(0)
, m_enabled(false)
, m_monitoringXHREnabled(false)
......@@ -73,9 +73,9 @@ InspectorConsoleAgent::InspectorConsoleAgent(InstrumentingAgents* instrumentingA
InspectorConsoleAgent::~InspectorConsoleAgent()
{
m_instrumentingAgents->setInspectorConsoleAgent(0);
m_instrumentingAgents = 0;
m_injectedScriptManager = 0;
m_instrumentingAgents->setInspectorConsoleAgent(nullptr);
m_instrumentingAgents = nullptr;
m_injectedScriptManager = nullptr;
}
void InspectorConsoleAgent::enable(ErrorString*)
......@@ -110,7 +110,7 @@ void InspectorConsoleAgent::clearMessages(ErrorString*)
{
m_consoleMessages.clear();
m_expiredConsoleMessageCount = 0;
m_previousMessage = 0;
m_previousMessage = nullptr;
m_injectedScriptManager->releaseObjectGroup("console");
if (m_frontendDispatcher && m_enabled)
m_frontendDispatcher->messagesCleared();
......@@ -255,7 +255,7 @@ void InspectorConsoleAgent::didFinishXHRLoading(unsigned long requestIdentifier,
return;
if (m_frontendDispatcher && m_monitoringXHREnabled) {
String message = "XHR finished loading: \"" + url + "\".";
addMessageToConsole(NetworkMessageSource, LogMessageType, DebugMessageLevel, message, sendURL, sendLineNumber, sendColumnNumber, 0, requestIdentifier);
addMessageToConsole(NetworkMessageSource, LogMessageType, DebugMessageLevel, message, sendURL, sendLineNumber, sendColumnNumber, nullptr, requestIdentifier);
}
}
......@@ -266,7 +266,7 @@ void InspectorConsoleAgent::didReceiveResponse(unsigned long requestIdentifier,
if (response.httpStatusCode() >= 400) {
String message = "Failed to load resource: the server responded with a status of " + String::number(response.httpStatusCode()) + " (" + response.httpStatusText() + ')';
addMessageToConsole(NetworkMessageSource, LogMessageType, ErrorMessageLevel, message, response.url().string(), 0, 0, 0, requestIdentifier);
addMessageToConsole(NetworkMessageSource, LogMessageType, ErrorMessageLevel, message, response.url().string(), 0, 0, nullptr, requestIdentifier);
}
}
......@@ -282,7 +282,7 @@ void InspectorConsoleAgent::didFailLoading(unsigned long requestIdentifier, cons
message.appendLiteral(": ");
message.append(error.localizedDescription());
}
addMessageToConsole(NetworkMessageSource, LogMessageType, ErrorMessageLevel, message.toString(), error.failingURL(), 0, 0, 0, requestIdentifier);
addMessageToConsole(NetworkMessageSource, LogMessageType, ErrorMessageLevel, message.toString(), error.failingURL(), 0, 0, nullptr, requestIdentifier);
}
void InspectorConsoleAgent::setMonitoringXHREnabled(ErrorString*, bool enabled)
......
......@@ -69,7 +69,7 @@ public:
virtual void willDestroyFrontendAndBackend() override;
void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, JSC::ExecState*, PassRefPtr<ScriptArguments>, unsigned long requestIdentifier = 0);
void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, const String& scriptID, unsigned lineNumber, unsigned columnNumber, JSC::ExecState* = 0, unsigned long requestIdentifier = 0);
void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, const String& scriptID, unsigned lineNumber, unsigned columnNumber, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0);
// FIXME: Remove once we no longer generate stacks outside of Inspector.
void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptCallStack>, unsigned long requestIdentifier = 0);
......
......@@ -200,7 +200,7 @@ void InspectorController::inspectedPageDestroyed()
disconnectFrontend();
m_injectedScriptManager->disconnect();
m_inspectorClient->inspectorDestroyed();
m_inspectorClient = 0;
m_inspectorClient = nullptr;
}
void InspectorController::setInspectorFrontendClient(std::unique_ptr<InspectorFrontendClient> inspectorFrontendClient)
......
......@@ -103,7 +103,7 @@ void InspectorDOMDebuggerAgent::didPause()
void InspectorDOMDebuggerAgent::disable()
{
m_instrumentingAgents->setInspectorDOMDebuggerAgent(0);
m_instrumentingAgents->setInspectorDOMDebuggerAgent(nullptr);
clear();
}
......@@ -121,8 +121,8 @@ void InspectorDOMDebuggerAgent::willDestroyFrontendAndBackend()
void InspectorDOMDebuggerAgent::discardAgent()
{
m_debuggerAgent->setListener(0);
m_debuggerAgent = 0;
m_debuggerAgent->setListener(nullptr);
m_debuggerAgent = nullptr;
}
void InspectorDOMDebuggerAgent::discardBindings()
......
......@@ -66,8 +66,8 @@ InspectorDOMStorageAgent::InspectorDOMStorageAgent(InstrumentingAgents* instrume
InspectorDOMStorageAgent::~InspectorDOMStorageAgent()
{
m_instrumentingAgents->setInspectorDOMStorageAgent(0);
m_instrumentingAgents = 0;
m_instrumentingAgents->setInspectorDOMStorageAgent(nullptr);
m_instrumentingAgents = nullptr;
}
void InspectorDOMStorageAgent::didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel* frontendChannel, InspectorBackendDispatcher* backendDispatcher)
......@@ -122,7 +122,7 @@ void InspectorDOMStorageAgent::getDOMStorageItems(ErrorString* errorString, cons
void InspectorDOMStorageAgent::setDOMStorageItem(ErrorString* errorString, const RefPtr<InspectorObject>& storageId, const String& key, const String& value)
{
Frame* frame;
RefPtr<StorageArea> storageArea = findStorageArea(0, storageId, frame);
RefPtr<StorageArea> storageArea = findStorageArea(nullptr, storageId, frame);
if (!storageArea) {
*errorString = "Storage not found";
return;
......@@ -137,7 +137,7 @@ void InspectorDOMStorageAgent::setDOMStorageItem(ErrorString* errorString, const
void InspectorDOMStorageAgent::removeDOMStorageItem(ErrorString* errorString, const RefPtr<InspectorObject>& storageId, const String& key)
{
Frame* frame;
RefPtr<StorageArea> storageArea = findStorageArea(0, storageId, frame);
RefPtr<StorageArea> storageArea = findStorageArea(nullptr, storageId, frame);
if (!storageArea) {
*errorString = "Storage not found";
return;
......@@ -192,15 +192,15 @@ PassRefPtr<StorageArea> InspectorDOMStorageAgent::findStorageArea(ErrorString* e
if (!success) {
if (errorString)
*errorString = "Invalid storageId format";
targetFrame = 0;
return 0;
targetFrame = nullptr;
return nullptr;
}
targetFrame = m_pageAgent->findFrameWithSecurityOrigin(securityOrigin);
if (!targetFrame) {
if (errorString)
*errorString = "Frame not found for the given security origin";
return 0;
return nullptr;
}
Page* page = m_pageAgent->page();
......
......@@ -64,7 +64,7 @@ void reportTransactionFailed(ExecuteSQLCallback* requestCallback, SQLError* erro
RefPtr<Inspector::TypeBuilder::Database::Error> errorObject = Inspector::TypeBuilder::Database::Error::create()
.setMessage(error->message())
.setCode(error->code());
requestCallback->sendSuccess(0, 0, errorObject.release());
requestCallback->sendSuccess(nullptr, nullptr, errorObject.release());
}
class StatementCallback : public SQLStatementCallback {
......@@ -95,7 +95,7 @@ public:
case SQLValue::NullValue: values->addItem(InspectorValue::null()); break;
}
}
m_requestCallback->sendSuccess(columnNames.release(), values.release(), 0);
m_requestCallback->sendSuccess(columnNames.release(), values.release(), nullptr);
return true;
}
......@@ -219,7 +219,7 @@ InspectorDatabaseAgent::InspectorDatabaseAgent(InstrumentingAgents* instrumentin
InspectorDatabaseAgent::~InspectorDatabaseAgent()
{
m_instrumentingAgents->setInspectorDatabaseAgent(0);
m_instrumentingAgents->setInspectorDatabaseAgent(nullptr);
}
void InspectorDatabaseAgent::didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel* frontendChannel, InspectorBackendDispatcher* backendDispatcher)
......@@ -308,14 +308,14 @@ InspectorDatabaseResource* InspectorDatabaseAgent::findByFileName(const String&
if (it->value->database()->fileName() == fileName)
return it->value.get();
}
return 0;
return nullptr;
}
Database* InspectorDatabaseAgent::databaseForId(const String& databaseId)
{
DatabaseResourcesMap::iterator it = m_resources.find(databaseId);
if (it == m_resources.end())
return 0;
return nullptr;
return it->value->database();
}
......
......@@ -157,7 +157,7 @@ bool InspectorDebuggerAgent::isPaused()
void InspectorDebuggerAgent::addMessageToConsole(MessageSource source, MessageType type)
{
if (scriptDebugServer().pauseOnExceptionsState() != ScriptDebugServer::DontPauseOnExceptions && source == ConsoleAPIMessageSource && type == AssertMessageType)
breakProgram(InspectorDebuggerFrontendDispatcher::Reason::Assert, 0);
breakProgram(InspectorDebuggerFrontendDispatcher::Reason::Assert, nullptr);
}
static PassRefPtr<InspectorObject> buildObjectForBreakpointCookie(const String& url, int lineNumber, int columnNumber, const String& condition, RefPtr<InspectorArray>& actions, bool isRegex, bool autoContinue)
......@@ -387,16 +387,16 @@ PassRefPtr<Inspector::TypeBuilder::Debugger::Location> InspectorDebuggerAgent::r
{
ScriptsMap::iterator scriptIterator = m_scripts.find(sourceID);
if (scriptIterator == m_scripts.end())
return 0;
return nullptr;
Script& script = scriptIterator->value;
if (breakpoint.lineNumber < script.startLine || script.endLine < breakpoint.lineNumber)
return 0;
return nullptr;
unsigned actualLineNumber;
unsigned actualColumnNumber;
JSC::BreakpointID debugServerBreakpointID = scriptDebugServer().setBreakpoint(sourceID, breakpoint, &actualLineNumber, &actualColumnNumber);
if (debugServerBreakpointID == JSC::noBreakpointID)
return 0;
return nullptr;
BreakpointIdentifierToDebugServerBreakpointIDsMap::iterator debugServerBreakpointIDsIterator = m_breakpointIdentifierToDebugServerBreakpointIDs.find(breakpointIdentifier);
if (debugServerBreakpointIDsIterator == m_breakpointIdentifierToDebugServerBreakpointIDs.end())
......@@ -604,9 +604,9 @@ void InspectorDebuggerAgent::didParseSource(JSC::SourceID sourceID, const Script
bool hasSourceURL = !script.sourceURL.isEmpty();
String scriptURL = hasSourceURL ? script.sourceURL : script.url;
bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : 0;
String* sourceMapURLParam = script.sourceMappingURL.isNull() ? 0 : &script.sourceMappingURL;
const bool* isContentScript = script.isContentScript ? &script.isContentScript : 0;
bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : nullptr;
String* sourceMapURLParam = script.sourceMappingURL.isNull() ? nullptr : &script.sourceMappingURL;
const bool* isContentScript = script.isContentScript ? &script.isContentScript : nullptr;
String scriptIDStr = String::number(sourceID);
m_frontendDispatcher->scriptParsed(scriptIDStr, scriptURL, script.startLine, script.startColumn, script.endLine, script.endColumn, isContentScript, sourceMapURLParam, hasSourceURLParam);
......@@ -690,7 +690,7 @@ void InspectorDebuggerAgent::didSampleProbe(JSC::ExecState* scriptState, int pro
void InspectorDebuggerAgent::didContinue()
{
m_pausedScriptState = 0;
m_pausedScriptState = nullptr;
m_currentCallStack = Deprecated::ScriptValue();
clearBreakDetails();
m_frontendDispatcher->resumed();
......@@ -735,7 +735,7 @@ bool InspectorDebuggerAgent::assertPaused(ErrorString* errorString)
void InspectorDebuggerAgent::clearBreakDetails()
{
m_breakReason = InspectorDebuggerFrontendDispatcher::Reason::Other;
m_breakAuxData = 0;
m_breakAuxData = nullptr;
}
void InspectorDebuggerAgent::didClearGlobalObject()
......
......@@ -74,7 +74,7 @@ public:
void disconnect()
{
m_frontendApiObject = Deprecated::ScriptObject();
m_frontendHost = 0;
m_frontendHost = nullptr;
}
private:
......@@ -114,7 +114,7 @@ private:
Deprecated::ScriptFunctionCall function(m_frontendApiObject, "contextMenuCleared", WebCore::functionCallHandlerFromAnyThread);
function.call();
m_frontendHost->m_menuProvider = 0;
m_frontendHost->m_menuProvider = nullptr;
}
m_items.clear();
}
......@@ -129,7 +129,7 @@ InspectorFrontendHost::InspectorFrontendHost(InspectorFrontendClient* client, Pa
: m_client(client)
, m_frontendPage(frontendPage)
#if ENABLE(CONTEXT_MENUS)
, m_menuProvider(0)
, m_menuProvider(nullptr)
#endif
{
}
......@@ -141,12 +141,12 @@ InspectorFrontendHost::~InspectorFrontendHost()