WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-128681-20140212174348.patch (text/plain), 70.23 KB, created by
Sergio Correia (qrwteyrutiyoup)
on 2014-02-12 12:43:40 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Sergio Correia (qrwteyrutiyoup)
Created:
2014-02-12 12:43:40 PST
Size:
70.23 KB
patch
obsolete
>Subversion Revision: 163967 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 36cc8b3d40836d29c155109bc17a254ccc539a41..172a40e47cebd1322feaf34b9acd32299e1559c2 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,20 @@ >+2014-02-12 Sergio Correia <sergio.correia@openbossa.org> >+ >+ Replace uses of PassOwnPtr/OwnPtr with std::unique_ptr in WebCore/inspector >+ https://bugs.webkit.org/show_bug.cgi?id=128681 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Another step towards getting rid of PassOwnPtr/OwnPtr, now targeting >+ WebCore/inspector/*. Besides files in there, a few other files in >+ JavaScriptCore/inspector, WebKit2/WebProcess/WebCoreSupport/ and >+ WebCore/testing were touched. >+ >+ * inspector/ContentSearchUtilities.cpp: >+ * inspector/ContentSearchUtilities.h: >+ * inspector/agents/InspectorConsoleAgent.cpp: >+ * inspector/agents/InspectorConsoleAgent.h: >+ > 2014-02-12 Ryosuke Niwa <rniwa@webkit.org> > > Windows build fix attempt after r163960. >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 5cf738848eab619b85cd75116fef984956e1915e..9d3b6cca26e5e0b16edee6c812438e567c834f73 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,57 @@ >+2014-02-12 Sergio Correia <sergio.correia@openbossa.org> >+ >+ Replace uses of PassOwnPtr/OwnPtr with std::unique_ptr in WebCore/inspector >+ https://bugs.webkit.org/show_bug.cgi?id=128681 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Another step towards getting rid of PassOwnPtr/OwnPtr, now targeting >+ WebCore/inspector/*. Besides files in there, a few other files in >+ JavaScriptCore/inspector, WebKit2/WebProcess/WebCoreSupport/ and >+ WebCore/testing were touched. >+ >+ No new tests; no new behavior. >+ >+ * inspector/CommandLineAPIHost.cpp: >+ * inspector/CommandLineAPIHost.h: >+ * inspector/DOMEditor.cpp: >+ * inspector/DOMPatchSupport.cpp: >+ * inspector/DOMPatchSupport.h: >+ * inspector/InspectorApplicationCacheAgent.h: >+ * inspector/InspectorCSSAgent.cpp: >+ * inspector/InspectorCSSAgent.h: >+ * inspector/InspectorCanvasAgent.h: >+ * inspector/InspectorDOMAgent.cpp: >+ * inspector/InspectorDOMAgent.h: >+ * inspector/InspectorDOMDebuggerAgent.h: >+ * inspector/InspectorDOMStorageAgent.h: >+ * inspector/InspectorDatabaseAgent.h: >+ * inspector/InspectorFrontendClientLocal.cpp: >+ * inspector/InspectorFrontendClientLocal.h: >+ * inspector/InspectorHeapProfilerAgent.h: >+ * inspector/InspectorHistory.cpp: >+ * inspector/InspectorHistory.h: >+ * inspector/InspectorIndexedDBAgent.h: >+ * inspector/InspectorInputAgent.h: >+ * inspector/InspectorLayerTreeAgent.h: >+ * inspector/InspectorMemoryAgent.cpp: >+ * inspector/InspectorMemoryAgent.h: >+ * inspector/InspectorOverlay.cpp: >+ * inspector/InspectorOverlay.h: >+ * inspector/InspectorProfilerAgent.cpp: >+ * inspector/InspectorProfilerAgent.h: >+ * inspector/InspectorResourceAgent.cpp: >+ * inspector/InspectorResourceAgent.h: >+ * inspector/InspectorStyleSheet.cpp: >+ * inspector/InspectorStyleSheet.h: >+ * inspector/InspectorTimelineAgent.h: >+ * inspector/InspectorWorkerAgent.cpp: >+ * inspector/PageConsoleAgent.cpp: >+ * inspector/PageRuntimeAgent.h: >+ * inspector/WebConsoleAgent.cpp: >+ * inspector/WorkerRuntimeAgent.h: >+ * testing/Internals.cpp: >+ > 2014-02-12 Joseph Pecoraro <pecoraro@apple.com> > > Web Inspector: Modernize missed inspector files >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index be853b31d8f5b77407bce589747cb5efd046448d..92e3a5c1441b781ab63310398df07458e4a5c65f 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,17 @@ >+2014-02-12 Sergio Correia <sergio.correia@openbossa.org> >+ >+ Replace uses of PassOwnPtr/OwnPtr with std::unique_ptr in WebCore/inspector >+ https://bugs.webkit.org/show_bug.cgi?id=128681 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Another step towards getting rid of PassOwnPtr/OwnPtr, now targeting >+ WebCore/inspector/*. Besides files in there, a few other files in >+ JavaScriptCore/inspector, WebKit2/WebProcess/WebCoreSupport/ and >+ WebCore/testing were touched. >+ >+ * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp: >+ > 2014-02-12 Dan Bernstein <mitz@apple.com> > > Stop using PLATFORM(MAC) in WebKit2/{Database,Network}Process except where it means âOS X but not iOSâ >diff --git a/Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp b/Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp >index 8f1f91cf1c751d115b57c3d918364fe7b36a41c2..f1599f77ac319905192407af84c1693b9809085a 100644 >--- a/Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp >+++ b/Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp >@@ -82,7 +82,7 @@ static Vector<std::pair<int, String>> getRegularExpressionMatchesByLines(const J > if (text.isEmpty()) > return result; > >- OwnPtr<Vector<size_t>> endings(lineEndings(text)); >+ std::unique_ptr<Vector<size_t>> endings(lineEndings(text)); > size_t size = endings->size(); > unsigned start = 0; > for (size_t lineNumber = 0; lineNumber < size; ++lineNumber) { >@@ -100,9 +100,9 @@ static Vector<std::pair<int, String>> getRegularExpressionMatchesByLines(const J > return result; > } > >-PassOwnPtr<Vector<size_t>> lineEndings(const String& text) >+std::unique_ptr<Vector<size_t>> lineEndings(const String& text) > { >- OwnPtr<Vector<size_t>> result(adoptPtr(new Vector<size_t>())); >+ auto result = std::make_unique<Vector<size_t>>(); > > unsigned start = 0; > while (start < text.length()) { >@@ -115,7 +115,7 @@ PassOwnPtr<Vector<size_t>> lineEndings(const String& text) > } > result->append(text.length()); > >- return result.release(); >+ return result; > } > > static PassRefPtr<Inspector::TypeBuilder::GenericTypes::SearchMatch> buildObjectForSearchMatch(int lineNumber, const String& lineContent) >diff --git a/Source/JavaScriptCore/inspector/ContentSearchUtilities.h b/Source/JavaScriptCore/inspector/ContentSearchUtilities.h >index 3eaa06641c3da541b79db4be49d57d2207d27387..2bc2d3c7c0dd2de2f1c22a3c2db6fa11a6b322f0 100644 >--- a/Source/JavaScriptCore/inspector/ContentSearchUtilities.h >+++ b/Source/JavaScriptCore/inspector/ContentSearchUtilities.h >@@ -48,7 +48,7 @@ JS_EXPORT_PRIVATE JSC::Yarr::RegularExpression createSearchRegex(const String& q > JS_EXPORT_PRIVATE int countRegularExpressionMatches(const JSC::Yarr::RegularExpression&, const String&); > JS_EXPORT_PRIVATE PassRefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::GenericTypes::SearchMatch>> searchInTextByLines(const String& text, const String& query, const bool caseSensitive, const bool isRegex); > JS_EXPORT_PRIVATE TextPosition textPositionFromOffset(size_t offset, const Vector<size_t>& lineEndings); >-JS_EXPORT_PRIVATE PassOwnPtr<Vector<size_t>> lineEndings(const String&); >+JS_EXPORT_PRIVATE std::unique_ptr<Vector<size_t>> lineEndings(const String&); > > JS_EXPORT_PRIVATE String findScriptSourceURL(const String& content); > JS_EXPORT_PRIVATE String findScriptSourceMapURL(const String& content); >diff --git a/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp b/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp >index db6f9106cde6da16a8eece945b7d9b2ea489e7ea..72f60c1f2429758e5f731f423418379ab95ffbf8 100644 >--- a/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp >+++ b/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp >@@ -36,8 +36,6 @@ > #include "ScriptCallStackFactory.h" > #include "ScriptObject.h" > #include <wtf/CurrentTime.h> >-#include <wtf/OwnPtr.h> >-#include <wtf/PassOwnPtr.h> > #include <wtf/text/StringBuilder.h> > #include <wtf/text/WTFString.h> > >@@ -130,7 +128,7 @@ void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageTyp > clearMessages(&error); > } > >- addConsoleMessage(adoptPtr(new ConsoleMessage(!isWorkerAgent(), source, type, level, message, callStack, requestIdentifier))); >+ addConsoleMessage(std::make_unique<ConsoleMessage>(!isWorkerAgent(), source, type, level, message, callStack, requestIdentifier)); > } > > void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, JSC::ExecState* state, PassRefPtr<ScriptArguments> arguments, unsigned long requestIdentifier) >@@ -143,7 +141,7 @@ void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageTyp > clearMessages(&error); > } > >- addConsoleMessage(adoptPtr(new ConsoleMessage(!isWorkerAgent(), source, type, level, message, arguments, state, requestIdentifier))); >+ addConsoleMessage(std::make_unique<ConsoleMessage>(!isWorkerAgent(), source, type, level, message, arguments, state, requestIdentifier)); > } > > void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, const String& scriptID, unsigned lineNumber, unsigned columnNumber, JSC::ExecState* state, unsigned long requestIdentifier) >@@ -157,7 +155,7 @@ void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageTyp > } > > bool canGenerateCallStack = !isWorkerAgent() && m_frontendDispatcher; >- addConsoleMessage(adoptPtr(new ConsoleMessage(canGenerateCallStack, source, type, level, message, scriptID, lineNumber, columnNumber, state, requestIdentifier))); >+ addConsoleMessage(std::make_unique<ConsoleMessage>(canGenerateCallStack, source, type, level, message, scriptID, lineNumber, columnNumber, state, requestIdentifier)); > } > > Vector<unsigned> InspectorConsoleAgent::consoleMessageArgumentCounts() const >@@ -229,7 +227,7 @@ static bool isGroupMessage(MessageType type) > || type == MessageType::EndGroup; > } > >-void InspectorConsoleAgent::addConsoleMessage(PassOwnPtr<ConsoleMessage> consoleMessage) >+void InspectorConsoleAgent::addConsoleMessage(std::unique_ptr<ConsoleMessage> consoleMessage) > { > ASSERT(m_injectedScriptManager->inspectorEnvironment().developerExtrasEnabled()); > ASSERT_ARG(consoleMessage, consoleMessage); >@@ -240,7 +238,7 @@ void InspectorConsoleAgent::addConsoleMessage(PassOwnPtr<ConsoleMessage> console > m_previousMessage->updateRepeatCountInConsole(m_frontendDispatcher.get()); > } else { > m_previousMessage = consoleMessage.get(); >- m_consoleMessages.append(consoleMessage); >+ m_consoleMessages.append(std::move(consoleMessage)); > if (m_frontendDispatcher && m_enabled) > m_previousMessage->addToFrontend(m_frontendDispatcher.get(), m_injectedScriptManager, true); > } >diff --git a/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.h b/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.h >index 49a79e63d3998fa38a04115bcc58c7f15d2f83a2..f857fc78a6bb478e8264ef8a587700bd68c8c8b5 100644 >--- a/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.h >+++ b/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.h >@@ -83,13 +83,13 @@ public: > void count(JSC::ExecState*, PassRefPtr<ScriptArguments>); > > protected: >- void addConsoleMessage(PassOwnPtr<ConsoleMessage>); >+ void addConsoleMessage(std::unique_ptr<ConsoleMessage>); > > InjectedScriptManager* m_injectedScriptManager; > std::unique_ptr<InspectorConsoleFrontendDispatcher> m_frontendDispatcher; > RefPtr<InspectorConsoleBackendDispatcher> m_backendDispatcher; > ConsoleMessage* m_previousMessage; >- Vector<OwnPtr<ConsoleMessage>> m_consoleMessages; >+ Vector<std::unique_ptr<ConsoleMessage>> m_consoleMessages; > int m_expiredConsoleMessageCount; > HashMap<String, unsigned> m_counts; > HashMap<String, double> m_times; >diff --git a/Source/WebCore/inspector/CommandLineAPIHost.cpp b/Source/WebCore/inspector/CommandLineAPIHost.cpp >index f404a52febef111f82797bc1ada22a917b0f515a..1e0fad37fa798f2baeb7711b7f42064c93ae4f7d 100644 >--- a/Source/WebCore/inspector/CommandLineAPIHost.cpp >+++ b/Source/WebCore/inspector/CommandLineAPIHost.cpp >@@ -74,7 +74,7 @@ CommandLineAPIHost::CommandLineAPIHost() > , m_databaseAgent(nullptr) > #endif > { >- m_defaultInspectableObject = adoptPtr(new InspectableObject); >+ m_defaultInspectableObject = std::make_unique<InspectableObject>(); > } > > CommandLineAPIHost::~CommandLineAPIHost() >@@ -124,9 +124,9 @@ Deprecated::ScriptValue CommandLineAPIHost::InspectableObject::get(JSC::ExecStat > return Deprecated::ScriptValue(); > }; > >-void CommandLineAPIHost::addInspectedObject(PassOwnPtr<CommandLineAPIHost::InspectableObject> object) >+void CommandLineAPIHost::addInspectedObject(std::unique_ptr<CommandLineAPIHost::InspectableObject> object) > { >- m_inspectedObjects.insert(0, object); >+ m_inspectedObjects.insert(0, std::move(object)); > while (m_inspectedObjects.size() > 5) > m_inspectedObjects.removeLast(); > } >diff --git a/Source/WebCore/inspector/CommandLineAPIHost.h b/Source/WebCore/inspector/CommandLineAPIHost.h >index 08f0c15d61ec1f0018d88ee77381ae0f5d8c72aa..6178eeec28e7f9dcd81e5025b0cdd8ac67b680cb 100644 >--- a/Source/WebCore/inspector/CommandLineAPIHost.h >+++ b/Source/WebCore/inspector/CommandLineAPIHost.h >@@ -92,7 +92,7 @@ public: > virtual Deprecated::ScriptValue get(JSC::ExecState*); > virtual ~InspectableObject() { } > }; >- void addInspectedObject(PassOwnPtr<InspectableObject>); >+ void addInspectedObject(std::unique_ptr<InspectableObject>); > void clearInspectedObjects(); > InspectableObject* inspectedObject(unsigned index); > void inspectImpl(PassRefPtr<Inspector::InspectorValue> objectToInspect, PassRefPtr<Inspector::InspectorValue> hints); >@@ -115,8 +115,8 @@ private: > InspectorDatabaseAgent* m_databaseAgent; > #endif > >- Vector<OwnPtr<InspectableObject>> m_inspectedObjects; >- OwnPtr<InspectableObject> m_defaultInspectableObject; >+ Vector<std::unique_ptr<InspectableObject>> m_inspectedObjects; >+ std::unique_ptr<InspectableObject> m_defaultInspectableObject; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/inspector/DOMEditor.cpp b/Source/WebCore/inspector/DOMEditor.cpp >index 7f2fab8bb6e71abb89d3296cd20a23bff80af9e3..b912d14ef6d8cf6e242b19e56429446ae8b91b0b 100644 >--- a/Source/WebCore/inspector/DOMEditor.cpp >+++ b/Source/WebCore/inspector/DOMEditor.cpp >@@ -92,7 +92,7 @@ public: > virtual bool perform(ExceptionCode& ec) override > { > if (m_node->parentNode()) { >- m_removeChildAction = adoptPtr(new RemoveChildAction(m_node->parentNode(), m_node.get())); >+ m_removeChildAction = std::make_unique<RemoveChildAction>(m_node->parentNode(), m_node.get()); > if (!m_removeChildAction->perform(ec)) > return false; > } >@@ -119,7 +119,7 @@ private: > RefPtr<Node> m_parentNode; > RefPtr<Node> m_node; > RefPtr<Node> m_anchorNode; >- OwnPtr<RemoveChildAction> m_removeChildAction; >+ std::unique_ptr<RemoveChildAction> m_removeChildAction; > }; > > class DOMEditor::RemoveAttributeAction : public InspectorHistory::Action { >@@ -208,8 +208,8 @@ public: > , m_nextSibling(node.nextSibling()) > , m_html(html) > , m_newNode(nullptr) >- , m_history(adoptPtr(new InspectorHistory())) >- , m_domEditor(adoptPtr(new DOMEditor(m_history.get()))) >+ , m_history(std::make_unique<InspectorHistory>()) >+ , m_domEditor(std::make_unique<DOMEditor>(m_history.get())) > { > } > >@@ -242,8 +242,8 @@ private: > String m_html; > String m_oldHTML; > Node* m_newNode; >- OwnPtr<InspectorHistory> m_history; >- OwnPtr<DOMEditor> m_domEditor; >+ std::unique_ptr<InspectorHistory> m_history; >+ std::unique_ptr<DOMEditor> m_domEditor; > }; > > class DOMEditor::ReplaceWholeTextAction : public InspectorHistory::Action { >@@ -352,29 +352,29 @@ DOMEditor::~DOMEditor() { } > > bool DOMEditor::insertBefore(Node* parentNode, PassRefPtr<Node> node, Node* anchorNode, ExceptionCode& ec) > { >- return m_history->perform(adoptPtr(new InsertBeforeAction(parentNode, node, anchorNode)), ec); >+ return m_history->perform(std::make_unique<InsertBeforeAction>(parentNode, node, anchorNode), ec); > } > > bool DOMEditor::removeChild(Node* parentNode, Node* node, ExceptionCode& ec) > { >- return m_history->perform(adoptPtr(new RemoveChildAction(parentNode, node)), ec); >+ return m_history->perform(std::make_unique<RemoveChildAction>(parentNode, node), ec); > } > > bool DOMEditor::setAttribute(Element* element, const String& name, const String& value, ExceptionCode& ec) > { >- return m_history->perform(adoptPtr(new SetAttributeAction(element, name, value)), ec); >+ return m_history->perform(std::make_unique<SetAttributeAction>(element, name, value), ec); > } > > bool DOMEditor::removeAttribute(Element* element, const String& name, ExceptionCode& ec) > { >- return m_history->perform(adoptPtr(new RemoveAttributeAction(element, name)), ec); >+ return m_history->perform(std::make_unique<RemoveAttributeAction>(element, name), ec); > } > > bool DOMEditor::setOuterHTML(Node& node, const String& html, Node** newNode, ExceptionCode& ec) > { >- OwnPtr<SetOuterHTMLAction> action = adoptPtr(new SetOuterHTMLAction(node, html)); >+ auto action = std::make_unique<SetOuterHTMLAction>(node, html); > SetOuterHTMLAction* rawAction = action.get(); >- bool result = m_history->perform(action.release(), ec); >+ bool result = m_history->perform(std::move(action), ec); > if (result) > *newNode = rawAction->newNode(); > return result; >@@ -382,17 +382,17 @@ bool DOMEditor::setOuterHTML(Node& node, const String& html, Node** newNode, Exc > > bool DOMEditor::replaceWholeText(Text* textNode, const String& text, ExceptionCode& ec) > { >- return m_history->perform(adoptPtr(new ReplaceWholeTextAction(textNode, text)), ec); >+ return m_history->perform(std::make_unique<ReplaceWholeTextAction>(textNode, text), ec); > } > > bool DOMEditor::replaceChild(Node* parentNode, PassRefPtr<Node> newNode, Node* oldNode, ExceptionCode& ec) > { >- return m_history->perform(adoptPtr(new ReplaceChildNodeAction(parentNode, newNode, oldNode)), ec); >+ return m_history->perform(std::make_unique<ReplaceChildNodeAction>(parentNode, newNode, oldNode), ec); > } > > bool DOMEditor::setNodeValue(Node* node, const String& value, ExceptionCode& ec) > { >- return m_history->perform(adoptPtr(new SetNodeValueAction(node, value)), ec); >+ return m_history->perform(std::make_unique<SetNodeValueAction>(node, value), ec); > } > > static void populateErrorString(const ExceptionCode& ec, ErrorString* errorString) >diff --git a/Source/WebCore/inspector/DOMPatchSupport.cpp b/Source/WebCore/inspector/DOMPatchSupport.cpp >index 943e18a1a3b37cae239ce40e6cce3d98f27073da..f6a38c509d259ecbddfb3a0fcae4d8a32e8e2b20 100644 >--- a/Source/WebCore/inspector/DOMPatchSupport.cpp >+++ b/Source/WebCore/inspector/DOMPatchSupport.cpp >@@ -66,7 +66,7 @@ struct DOMPatchSupport::Digest { > String m_sha1; > String m_attrsSHA1; > Node* m_node; >- Vector<OwnPtr<Digest>> m_children; >+ Vector<std::unique_ptr<Digest>> m_children; > }; > > void DOMPatchSupport::patchDocument(Document* document, const String& markup) >@@ -105,8 +105,8 @@ void DOMPatchSupport::patchDocument(const String& markup) > parser->finish(); > parser->detach(); > >- OwnPtr<Digest> oldInfo = createDigest(m_document->documentElement(), nullptr); >- OwnPtr<Digest> newInfo = createDigest(newDocument->documentElement(), &m_unusedNodesMap); >+ std::unique_ptr<Digest> oldInfo = createDigest(m_document->documentElement(), nullptr); >+ std::unique_ptr<Digest> newInfo = createDigest(newDocument->documentElement(), &m_unusedNodesMap); > > if (!innerPatchNode(oldInfo.get(), newInfo.get(), IGNORE_EXCEPTION)) { > // Fall back to rewrite. >@@ -133,13 +133,13 @@ Node* DOMPatchSupport::patchNode(Node& node, const String& markup, ExceptionCode > > // Compose the old list. > ContainerNode* parentNode = node.parentNode(); >- Vector<OwnPtr<Digest>> oldList; >+ Vector<std::unique_ptr<Digest>> oldList; > for (Node* child = parentNode->firstChild(); child; child = child->nextSibling()) > oldList.append(createDigest(child, nullptr)); > > // Compose the new list. > String markupCopy = markup.lower(); >- Vector<OwnPtr<Digest>> newList; >+ Vector<std::unique_ptr<Digest>> newList; > for (Node* child = parentNode->firstChild(); child != &node; child = child->nextSibling()) > newList.append(createDigest(child, nullptr)); > for (Node* child = fragment->firstChild(); child; child = child->nextSibling()) { >@@ -208,7 +208,7 @@ bool DOMPatchSupport::innerPatchNode(Digest* oldDigest, Digest* newDigest, Excep > } > > std::pair<DOMPatchSupport::ResultMap, DOMPatchSupport::ResultMap> >-DOMPatchSupport::diff(const Vector<OwnPtr<Digest>>& oldList, const Vector<OwnPtr<Digest>>& newList) >+DOMPatchSupport::diff(const Vector<std::unique_ptr<Digest>>& oldList, const Vector<std::unique_ptr<Digest>>& newList) > { > ResultMap newMap(newList.size()); > ResultMap oldMap(oldList.size()); >@@ -295,7 +295,7 @@ DOMPatchSupport::diff(const Vector<OwnPtr<Digest>>& oldList, const Vector<OwnPtr > return std::make_pair(oldMap, newMap); > } > >-bool DOMPatchSupport::innerPatchChildren(ContainerNode* parentNode, const Vector<OwnPtr<Digest>>& oldList, const Vector<OwnPtr<Digest>>& newList, ExceptionCode& ec) >+bool DOMPatchSupport::innerPatchChildren(ContainerNode* parentNode, const Vector<std::unique_ptr<Digest>>& oldList, const Vector<std::unique_ptr<Digest>>& newList, ExceptionCode& ec) > { > std::pair<ResultMap, ResultMap> resultMaps = diff(oldList, newList); > ResultMap& oldMap = resultMaps.first; >@@ -407,10 +407,9 @@ static void addStringToSHA1(SHA1& sha1, const String& string) > sha1.addBytes(reinterpret_cast<const uint8_t*>(cString.data()), cString.length()); > } > >-PassOwnPtr<DOMPatchSupport::Digest> DOMPatchSupport::createDigest(Node* node, UnusedNodesMap* unusedNodesMap) >+std::unique_ptr<DOMPatchSupport::Digest> DOMPatchSupport::createDigest(Node* node, UnusedNodesMap* unusedNodesMap) > { >- Digest* digest = new Digest(node); >- >+ auto digest = std::make_unique<Digest>(node); > SHA1 sha1; > > Node::NodeType nodeType = node->nodeType(); >@@ -421,10 +420,10 @@ PassOwnPtr<DOMPatchSupport::Digest> DOMPatchSupport::createDigest(Node* node, Un > if (node->nodeType() == Node::ELEMENT_NODE) { > Node* child = node->firstChild(); > while (child) { >- OwnPtr<Digest> childInfo = createDigest(child, unusedNodesMap); >+ std::unique_ptr<Digest> childInfo = createDigest(child, unusedNodesMap); > addStringToSHA1(sha1, childInfo->m_sha1); > child = child->nextSibling(); >- digest->m_children.append(childInfo.release()); >+ digest->m_children.append(std::move(childInfo)); > } > Element* element = toElement(node); > >@@ -445,8 +444,9 @@ PassOwnPtr<DOMPatchSupport::Digest> DOMPatchSupport::createDigest(Node* node, Un > sha1.computeHash(hash); > digest->m_sha1 = base64Encode(hash.data(), 10); > if (unusedNodesMap) >- unusedNodesMap->add(digest->m_sha1, digest); >- return adoptPtr(digest); >+ unusedNodesMap->add(digest->m_sha1, digest.get()); >+ >+ return digest; > } > > bool DOMPatchSupport::insertBeforeAndMarkAsUsed(ContainerNode* parentNode, Digest* digest, Node* anchor, ExceptionCode& ec) >diff --git a/Source/WebCore/inspector/DOMPatchSupport.h b/Source/WebCore/inspector/DOMPatchSupport.h >index ad544848764db79c5bb092ce7d1fcb487a11fb4a..6a960e85def5762f1e222eb667c61921430726bf 100644 >--- a/Source/WebCore/inspector/DOMPatchSupport.h >+++ b/Source/WebCore/inspector/DOMPatchSupport.h >@@ -34,8 +34,6 @@ > #include "ExceptionCode.h" > > #include <wtf/HashMap.h> >-#include <wtf/OwnPtr.h> >-#include <wtf/PassOwnPtr.h> > #include <wtf/Vector.h> > #include <wtf/text/WTFString.h> > >@@ -65,9 +63,9 @@ private: > typedef HashMap<String, Digest*> UnusedNodesMap; > > bool innerPatchNode(Digest* oldNode, Digest* newNode, ExceptionCode&); >- std::pair<ResultMap, ResultMap> diff(const Vector<OwnPtr<Digest>>& oldChildren, const Vector<OwnPtr<Digest>>& newChildren); >- bool innerPatchChildren(ContainerNode*, const Vector<OwnPtr<Digest>>& oldChildren, const Vector<OwnPtr<Digest>>& newChildren, ExceptionCode&); >- PassOwnPtr<Digest> createDigest(Node*, UnusedNodesMap*); >+ std::pair<ResultMap, ResultMap> diff(const Vector<std::unique_ptr<Digest>>& oldChildren, const Vector<std::unique_ptr<Digest>>& newChildren); >+ bool innerPatchChildren(ContainerNode*, const Vector<std::unique_ptr<Digest>>& oldChildren, const Vector<std::unique_ptr<Digest>>& newChildren, ExceptionCode&); >+ std::unique_ptr<Digest> createDigest(Node*, UnusedNodesMap*); > bool insertBeforeAndMarkAsUsed(ContainerNode*, Digest*, Node* anchor, ExceptionCode&); > bool removeChildAndMoveToNew(Digest*, ExceptionCode&); > void markNodeAsUsed(Digest*); >diff --git a/Source/WebCore/inspector/InspectorApplicationCacheAgent.h b/Source/WebCore/inspector/InspectorApplicationCacheAgent.h >index 52d8e0ede5d55c5238bcd627de195f65a60eaeda..a9c7642887125d7cb70da50a924597161f3f8d1f 100644 >--- a/Source/WebCore/inspector/InspectorApplicationCacheAgent.h >+++ b/Source/WebCore/inspector/InspectorApplicationCacheAgent.h >@@ -32,7 +32,6 @@ > #include "InspectorWebBackendDispatchers.h" > #include "InspectorWebFrontendDispatchers.h" > #include <wtf/Noncopyable.h> >-#include <wtf/PassOwnPtr.h> > > namespace Inspector { > class InspectorApplicationCacheFrontendDispatcher; >diff --git a/Source/WebCore/inspector/InspectorCSSAgent.cpp b/Source/WebCore/inspector/InspectorCSSAgent.cpp >index 9339bba7ffe0f072bb7c0e37cbc13ffef485e89b..bdc2c9c7f99207e314c11994b3b63ce6f0f7ceda 100644 >--- a/Source/WebCore/inspector/InspectorCSSAgent.cpp >+++ b/Source/WebCore/inspector/InspectorCSSAgent.cpp >@@ -165,7 +165,7 @@ void UpdateRegionLayoutTask::timerFired(Timer<UpdateRegionLayoutTask>&) > if (!m_namedFlows.isEmpty() && !m_timer.isActive()) > m_timer.startOneShot(0); > } >- >+ > class ChangeRegionOversetTask { > public: > ChangeRegionOversetTask(InspectorCSSAgent*); >@@ -173,7 +173,7 @@ public: > void unschedule(WebKitNamedFlow*); > void reset(); > void timerFired(Timer<ChangeRegionOversetTask>&); >- >+ > private: > InspectorCSSAgent* m_cssAgent; > Timer<ChangeRegionOversetTask> m_timer; >@@ -189,7 +189,7 @@ ChangeRegionOversetTask::ChangeRegionOversetTask(InspectorCSSAgent* cssAgent) > void ChangeRegionOversetTask::scheduleFor(WebKitNamedFlow* namedFlow, int documentNodeId) > { > m_namedFlows.add(namedFlow, documentNodeId); >- >+ > if (!m_timer.isActive()) > m_timer.startOneShot(0); > } >@@ -266,7 +266,7 @@ public: > return String::format("SetStyleSheetText %s", m_styleSheet->id().utf8().data()); > } > >- virtual void merge(PassOwnPtr<Action> action) override >+ virtual void merge(std::unique_ptr<Action> action) override > { > ASSERT(action->mergeId() == mergeId()); > >@@ -310,7 +310,7 @@ public: > return String::format("SetStyleText %s:%u", m_styleSheet->id().utf8().data(), m_cssId.ordinal()); > } > >- virtual void merge(PassOwnPtr<Action> action) override >+ virtual void merge(std::unique_ptr<Action> action) override > { > ASSERT(action->mergeId() == mergeId()); > >@@ -369,7 +369,7 @@ public: > return String::format("SetPropertyText %s:%u:%s", m_styleSheet->id().utf8().data(), m_propertyIndex, m_overwrite ? "true" : "false"); > } > >- virtual void merge(PassOwnPtr<Action> action) override >+ virtual void merge(std::unique_ptr<Action> action) override > { > ASSERT(action->mergeId() == mergeId()); > >@@ -582,7 +582,7 @@ void InspectorCSSAgent::willRemoveNamedFlow(Document* document, WebKitNamedFlow* > > if (m_updateRegionLayoutTask) > m_updateRegionLayoutTask->unschedule(namedFlow); >- >+ > if (m_changeRegionOversetTask) > m_changeRegionOversetTask->unschedule(namedFlow); > >@@ -596,7 +596,7 @@ void InspectorCSSAgent::didUpdateRegionLayout(Document* document, WebKitNamedFlo > return; > > if (!m_updateRegionLayoutTask) >- m_updateRegionLayoutTask = adoptPtr(new UpdateRegionLayoutTask(this)); >+ m_updateRegionLayoutTask = std::make_unique<UpdateRegionLayoutTask>(this); > m_updateRegionLayoutTask->scheduleFor(namedFlow, documentNodeId); > } > >@@ -616,9 +616,9 @@ void InspectorCSSAgent::didChangeRegionOverset(Document* document, WebKitNamedFl > int documentNodeId = documentNodeWithRequestedFlowsId(document); > if (!documentNodeId) > return; >- >+ > if (!m_changeRegionOversetTask) >- m_changeRegionOversetTask = adoptPtr(new ChangeRegionOversetTask(this)); >+ m_changeRegionOversetTask = std::make_unique<ChangeRegionOversetTask>(this); > m_changeRegionOversetTask->scheduleFor(namedFlow, documentNodeId); > } > >@@ -626,10 +626,10 @@ void InspectorCSSAgent::regionOversetChanged(WebKitNamedFlow* namedFlow, int doc > { > if (namedFlow->flowState() == WebKitNamedFlow::FlowStateNull) > return; >- >+ > ErrorString errorString; > Ref<WebKitNamedFlow> protect(*namedFlow); >- >+ > m_frontendDispatcher->regionOversetChanged(buildObjectForNamedFlow(&errorString, namedFlow, documentNodeId)); > } > >@@ -803,7 +803,7 @@ void InspectorCSSAgent::setStyleSheetText(ErrorString* errorString, const String > return; > > ExceptionCode ec = 0; >- m_domAgent->history()->perform(adoptPtr(new SetStyleSheetTextAction(inspectorStyleSheet, text)), ec); >+ m_domAgent->history()->perform(std::make_unique<SetStyleSheetTextAction>(inspectorStyleSheet, text), ec); > *errorString = InspectorDOMAgent::toErrorString(ec); > } > >@@ -817,7 +817,7 @@ void InspectorCSSAgent::setStyleText(ErrorString* errorString, const RefPtr<Insp > return; > > ExceptionCode ec = 0; >- bool success = m_domAgent->history()->perform(adoptPtr(new SetStyleTextAction(inspectorStyleSheet, compoundId, text)), ec); >+ bool success = m_domAgent->history()->perform(std::make_unique<SetStyleTextAction>(inspectorStyleSheet, compoundId, text), ec); > if (success) > result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId)); > *errorString = InspectorDOMAgent::toErrorString(ec); >@@ -833,7 +833,7 @@ void InspectorCSSAgent::setPropertyText(ErrorString* errorString, const RefPtr<I > return; > > ExceptionCode ec = 0; >- bool success = m_domAgent->history()->perform(adoptPtr(new SetPropertyTextAction(inspectorStyleSheet, compoundId, propertyIndex, text, overwrite)), ec); >+ bool success = m_domAgent->history()->perform(std::make_unique<SetPropertyTextAction>(inspectorStyleSheet, compoundId, propertyIndex, text, overwrite), ec); > if (success) > result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId)); > *errorString = InspectorDOMAgent::toErrorString(ec); >@@ -849,7 +849,7 @@ void InspectorCSSAgent::toggleProperty(ErrorString* errorString, const RefPtr<In > return; > > ExceptionCode ec = 0; >- bool success = m_domAgent->history()->perform(adoptPtr(new TogglePropertyAction(inspectorStyleSheet, compoundId, propertyIndex, disable)), ec); >+ bool success = m_domAgent->history()->perform(std::make_unique<TogglePropertyAction>(inspectorStyleSheet, compoundId, propertyIndex, disable), ec); > if (success) > result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId)); > *errorString = InspectorDOMAgent::toErrorString(ec); >@@ -865,7 +865,7 @@ void InspectorCSSAgent::setRuleSelector(ErrorString* errorString, const RefPtr<I > return; > > ExceptionCode ec = 0; >- bool success = m_domAgent->history()->perform(adoptPtr(new SetRuleSelectorAction(inspectorStyleSheet, compoundId, selector)), ec); >+ bool success = m_domAgent->history()->perform(std::make_unique<SetRuleSelectorAction>(inspectorStyleSheet, compoundId, selector), ec); > > if (success) > result = inspectorStyleSheet->buildObjectForRule(inspectorStyleSheet->ruleForId(compoundId)); >@@ -885,9 +885,9 @@ void InspectorCSSAgent::addRule(ErrorString* errorString, const int contextNodeI > } > > ExceptionCode ec = 0; >- OwnPtr<AddRuleAction> action = adoptPtr(new AddRuleAction(inspectorStyleSheet, selector)); >+ auto action = std::make_unique<AddRuleAction>(inspectorStyleSheet, selector); > AddRuleAction* rawAction = action.get(); >- bool success = m_domAgent->history()->perform(action.release(), ec); >+ bool success = m_domAgent->history()->perform(std::move(action), ec); > if (!success) { > *errorString = InspectorDOMAgent::toErrorString(ec); > return; >diff --git a/Source/WebCore/inspector/InspectorCSSAgent.h b/Source/WebCore/inspector/InspectorCSSAgent.h >index 10b4fe91f8290a473ee846a439cbb6787db115b9..20b3c150759899788339c9362490fb5021f9fd31 100644 >--- a/Source/WebCore/inspector/InspectorCSSAgent.h >+++ b/Source/WebCore/inspector/InspectorCSSAgent.h >@@ -181,8 +181,8 @@ private: > DocumentToViaInspectorStyleSheet m_documentToInspectorStyleSheet; > NodeIdToForcedPseudoState m_nodeIdToForcedPseudoState; > HashSet<int> m_namedFlowCollectionsRequested; >- OwnPtr<UpdateRegionLayoutTask> m_updateRegionLayoutTask; >- OwnPtr<ChangeRegionOversetTask> m_changeRegionOversetTask; >+ std::unique_ptr<UpdateRegionLayoutTask> m_updateRegionLayoutTask; >+ std::unique_ptr<ChangeRegionOversetTask> m_changeRegionOversetTask; > > int m_lastStyleSheetId; > }; >diff --git a/Source/WebCore/inspector/InspectorCanvasAgent.h b/Source/WebCore/inspector/InspectorCanvasAgent.h >index a9a38e237bf5b08a8b9e9002b4c19be6f1908204..fbe32c23fd7c51acd153a3a683188f9cfdc68383 100644 >--- a/Source/WebCore/inspector/InspectorCanvasAgent.h >+++ b/Source/WebCore/inspector/InspectorCanvasAgent.h >@@ -39,7 +39,6 @@ > #include "InspectorWebTypeBuilders.h" > #include "ScriptState.h" > #include <wtf/HashMap.h> >-#include <wtf/PassOwnPtr.h> > #include <wtf/PassRefPtr.h> > #include <wtf/text/WTFString.h> > >diff --git a/Source/WebCore/inspector/InspectorDOMAgent.cpp b/Source/WebCore/inspector/InspectorDOMAgent.cpp >index 903d7d5f1032d3406f4c2cfdf9647e1d3449b77b..11dc23942ec8790b04665c234f75e73a4e11ac2a 100644 >--- a/Source/WebCore/inspector/InspectorDOMAgent.cpp >+++ b/Source/WebCore/inspector/InspectorDOMAgent.cpp >@@ -96,7 +96,6 @@ > #include <inspector/InjectedScriptManager.h> > #include <runtime/JSCInlines.h> > #include <wtf/HashSet.h> >-#include <wtf/OwnPtr.h> > #include <wtf/Vector.h> > #include <wtf/text/CString.h> > #include <wtf/text/WTFString.h> >@@ -236,8 +235,8 @@ void InspectorDOMAgent::didCreateFrontendAndBackend(Inspector::InspectorFrontend > m_frontendDispatcher = std::make_unique<InspectorDOMFrontendDispatcher>(frontendChannel); > m_backendDispatcher = InspectorDOMBackendDispatcher::create(backendDispatcher, this); > >- m_history = adoptPtr(new InspectorHistory()); >- m_domEditor = adoptPtr(new DOMEditor(m_history.get())); >+ m_history = std::make_unique<InspectorHistory>(); >+ m_domEditor = std::make_unique<DOMEditor>(m_history.get()); > > m_instrumentingAgents->setInspectorDOMAgent(this); > m_document = m_pageAgent->mainFrame()->document(); >@@ -251,8 +250,8 @@ void InspectorDOMAgent::willDestroyFrontendAndBackend(InspectorDisconnectReason) > m_frontendDispatcher = nullptr; > m_backendDispatcher.clear(); > >- m_history.clear(); >- m_domEditor.clear(); >+ m_history.reset(); >+ m_domEditor.reset(); > > ErrorString error; > setSearchingForNode(&error, false, 0); >@@ -584,7 +583,7 @@ int InspectorDOMAgent::pushNodePathToFrontend(Node* nodeToPush) > Node* parent = innerParentNode(node); > if (!parent) { > // Node being pushed is detached -> push subtree root. >- OwnPtr<NodeToIdMap> newMap = adoptPtr(new NodeToIdMap); >+ auto newMap = std::make_unique<NodeToIdMap>(); > danglingMap = newMap.get(); > m_danglingNodeToIdMaps.append(newMap.release()); > RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::DOM::Node>> children = Inspector::TypeBuilder::Array<Inspector::TypeBuilder::DOM::Node>::create(); >@@ -1032,14 +1031,14 @@ void InspectorDOMAgent::setSearchingForNode(ErrorString* errorString, bool enabl > m_overlay->didSetSearchingForNode(m_searchingForNode); > } > >-PassOwnPtr<HighlightConfig> InspectorDOMAgent::highlightConfigFromInspectorObject(ErrorString* errorString, InspectorObject* highlightInspectorObject) >+std::unique_ptr<HighlightConfig> InspectorDOMAgent::highlightConfigFromInspectorObject(ErrorString* errorString, InspectorObject* highlightInspectorObject) > { > if (!highlightInspectorObject) { > *errorString = "Internal error: highlight configuration parameter is missing"; > return nullptr; > } > >- OwnPtr<HighlightConfig> highlightConfig = adoptPtr(new HighlightConfig()); >+ auto highlightConfig = std::make_unique<HighlightConfig>(); > bool showInfo = false; // Default: false (do not show a tooltip). > highlightInspectorObject->getBoolean("showInfo", &showInfo); > highlightConfig->showInfo = showInfo; >@@ -1051,7 +1050,7 @@ PassOwnPtr<HighlightConfig> InspectorDOMAgent::highlightConfigFromInspectorObjec > highlightConfig->padding = parseConfigColor("paddingColor", highlightInspectorObject); > highlightConfig->border = parseConfigColor("borderColor", highlightInspectorObject); > highlightConfig->margin = parseConfigColor("marginColor", highlightInspectorObject); >- return highlightConfig.release(); >+ return highlightConfig; > } > > void InspectorDOMAgent::setInspectModeEnabled(ErrorString* errorString, bool enabled, const RefPtr<InspectorObject>* highlightConfig) >@@ -1061,27 +1060,27 @@ void InspectorDOMAgent::setInspectModeEnabled(ErrorString* errorString, bool ena > > void InspectorDOMAgent::highlightRect(ErrorString*, int x, int y, int width, int height, const RefPtr<InspectorObject>* color, const RefPtr<InspectorObject>* outlineColor, const bool* usePageCoordinates) > { >- OwnPtr<FloatQuad> quad = adoptPtr(new FloatQuad(FloatRect(x, y, width, height))); >- innerHighlightQuad(quad.release(), color, outlineColor, usePageCoordinates); >+ auto quad = std::make_unique<FloatQuad>(FloatRect(x, y, width, height)); >+ innerHighlightQuad(std::move(quad), color, outlineColor, usePageCoordinates); > } > > void InspectorDOMAgent::highlightQuad(ErrorString* errorString, const RefPtr<InspectorArray>& quadArray, const RefPtr<InspectorObject>* color, const RefPtr<InspectorObject>* outlineColor, const bool* usePageCoordinates) > { >- OwnPtr<FloatQuad> quad = adoptPtr(new FloatQuad()); >+ auto quad = std::make_unique<FloatQuad>(); > if (!parseQuad(quadArray, quad.get())) { > *errorString = "Invalid Quad format"; > return; > } >- innerHighlightQuad(quad.release(), color, outlineColor, usePageCoordinates); >+ innerHighlightQuad(std::move(quad), color, outlineColor, usePageCoordinates); > } > >-void InspectorDOMAgent::innerHighlightQuad(PassOwnPtr<FloatQuad> quad, const RefPtr<InspectorObject>* color, const RefPtr<InspectorObject>* outlineColor, const bool* usePageCoordinates) >+void InspectorDOMAgent::innerHighlightQuad(std::unique_ptr<FloatQuad> quad, const RefPtr<InspectorObject>* color, const RefPtr<InspectorObject>* outlineColor, const bool* usePageCoordinates) > { >- OwnPtr<HighlightConfig> highlightConfig = adoptPtr(new HighlightConfig()); >+ auto highlightConfig = std::make_unique<HighlightConfig>(); > highlightConfig->content = parseColor(color); > highlightConfig->contentOutline = parseColor(outlineColor); > highlightConfig->usePageCoordinates = usePageCoordinates ? *usePageCoordinates : false; >- m_overlay->highlightQuad(quad, *highlightConfig); >+ m_overlay->highlightQuad(std::move(quad), *highlightConfig); > } > > void InspectorDOMAgent::highlightNode(ErrorString* errorString, const RefPtr<InspectorObject>& highlightInspectorObject, const int* nodeId, const String* objectId) >@@ -1099,7 +1098,7 @@ void InspectorDOMAgent::highlightNode(ErrorString* errorString, const RefPtr<Ins > if (!node) > return; > >- OwnPtr<HighlightConfig> highlightConfig = highlightConfigFromInspectorObject(errorString, highlightInspectorObject.get()); >+ std::unique_ptr<HighlightConfig> highlightConfig = highlightConfigFromInspectorObject(errorString, highlightInspectorObject.get()); > if (!highlightConfig) > return; > >@@ -1114,7 +1113,7 @@ void InspectorDOMAgent::highlightFrame( > { > Frame* frame = m_pageAgent->frameForId(frameId); > if (frame && frame->ownerElement()) { >- OwnPtr<HighlightConfig> highlightConfig = adoptPtr(new HighlightConfig()); >+ auto highlightConfig = std::make_unique<HighlightConfig>(); > highlightConfig->showInfo = true; // Always show tooltips for frames. > highlightConfig->content = parseColor(color); > highlightConfig->contentOutline = parseColor(outlineColor); >@@ -1642,7 +1641,7 @@ void InspectorDOMAgent::didInvalidateStyleAttr(Node* node) > return; > > if (!m_revalidateStyleAttrTask) >- m_revalidateStyleAttrTask = adoptPtr(new RevalidateStyleAttributeTask(this)); >+ m_revalidateStyleAttrTask = std::make_unique<RevalidateStyleAttributeTask>(this); > m_revalidateStyleAttrTask->scheduleFor(toElement(node)); > } > >diff --git a/Source/WebCore/inspector/InspectorDOMAgent.h b/Source/WebCore/inspector/InspectorDOMAgent.h >index fa41c7fa55226998200e5a191fdf586a6260d4a5..7d33bbe8af3778221f032d4f0e4e51e64fc16ef9 100644 >--- a/Source/WebCore/inspector/InspectorDOMAgent.h >+++ b/Source/WebCore/inspector/InspectorDOMAgent.h >@@ -41,8 +41,6 @@ > #include <wtf/Deque.h> > #include <wtf/HashMap.h> > #include <wtf/HashSet.h> >-#include <wtf/OwnPtr.h> >-#include <wtf/PassOwnPtr.h> > #include <wtf/RefPtr.h> > #include <wtf/Vector.h> > #include <wtf/text/AtomicString.h> >@@ -213,7 +211,7 @@ public: > > private: > void setSearchingForNode(ErrorString*, bool enabled, Inspector::InspectorObject* highlightConfig); >- PassOwnPtr<HighlightConfig> highlightConfigFromInspectorObject(ErrorString*, Inspector::InspectorObject* highlightInspectorObject); >+ std::unique_ptr<HighlightConfig> highlightConfigFromInspectorObject(ErrorString*, Inspector::InspectorObject* highlightInspectorObject); > > // Node-related methods. > typedef HashMap<RefPtr<Node>, int> NodeToIdMap; >@@ -241,7 +239,7 @@ private: > > void discardBindings(); > >- void innerHighlightQuad(PassOwnPtr<FloatQuad>, const RefPtr<Inspector::InspectorObject>* color, const RefPtr<Inspector::InspectorObject>* outlineColor, const bool* usePageCoordinates); >+ void innerHighlightQuad(std::unique_ptr<FloatQuad>, const RefPtr<Inspector::InspectorObject>* color, const RefPtr<Inspector::InspectorObject>* outlineColor, const bool* usePageCoordinates); > > InspectorPageAgent* m_pageAgent; > Inspector::InjectedScriptManager* m_injectedScriptManager; >@@ -253,7 +251,7 @@ private: > typedef HashMap<RefPtr<Node>, BackendNodeId> NodeToBackendIdMap; > HashMap<String, NodeToBackendIdMap> m_nodeGroupToBackendIdMap; > // Owns node mappings for dangling nodes. >- Vector<OwnPtr<NodeToIdMap>> m_danglingNodeToIdMaps; >+ Vector<std::unique_ptr<NodeToIdMap>> m_danglingNodeToIdMaps; > HashMap<int, Node*> m_idToNode; > HashMap<int, NodeToIdMap*> m_idToNodesMap; > HashSet<int> m_childrenRequested; >@@ -263,12 +261,12 @@ private: > RefPtr<Document> m_document; > typedef HashMap<String, Vector<RefPtr<Node>>> SearchResults; > SearchResults m_searchResults; >- OwnPtr<RevalidateStyleAttributeTask> m_revalidateStyleAttrTask; >+ std::unique_ptr<RevalidateStyleAttributeTask> m_revalidateStyleAttrTask; > RefPtr<Node> m_nodeToFocus; > bool m_searchingForNode; >- OwnPtr<HighlightConfig> m_inspectModeHighlightConfig; >- OwnPtr<InspectorHistory> m_history; >- OwnPtr<DOMEditor> m_domEditor; >+ std::unique_ptr<HighlightConfig> m_inspectModeHighlightConfig; >+ std::unique_ptr<InspectorHistory> m_history; >+ std::unique_ptr<DOMEditor> m_domEditor; > bool m_suppressAttributeModifiedEvent; > bool m_documentRequested; > }; >diff --git a/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h b/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h >index ebe26650adb6facb8def07375934a2be93eed802..fb8f79862df0885f493879375755760044b3ccfe 100644 >--- a/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h >+++ b/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h >@@ -37,7 +37,6 @@ > #include "InspectorWebBackendDispatchers.h" > #include <inspector/agents/InspectorDebuggerAgent.h> > #include <wtf/HashMap.h> >-#include <wtf/PassOwnPtr.h> > #include <wtf/RefCounted.h> > #include <wtf/text/WTFString.h> > >diff --git a/Source/WebCore/inspector/InspectorDOMStorageAgent.h b/Source/WebCore/inspector/InspectorDOMStorageAgent.h >index 5ad2b7e11f4d099fd22eef33f0fec6b283c0be86..f7dad3284bb84d25ca34a91dcbe86f4c9502f0b4 100644 >--- a/Source/WebCore/inspector/InspectorDOMStorageAgent.h >+++ b/Source/WebCore/inspector/InspectorDOMStorageAgent.h >@@ -33,7 +33,6 @@ > #include "InspectorWebBackendDispatchers.h" > #include "StorageArea.h" > #include <wtf/HashMap.h> >-#include <wtf/PassOwnPtr.h> > #include <wtf/text/WTFString.h> > > namespace Inspector { >diff --git a/Source/WebCore/inspector/InspectorDatabaseAgent.h b/Source/WebCore/inspector/InspectorDatabaseAgent.h >index 322960757c3b49ca644493dc4c9caab136a7c7eb..45dddc4e85b05ddb1f8d5e96661b697ff8d398d0 100644 >--- a/Source/WebCore/inspector/InspectorDatabaseAgent.h >+++ b/Source/WebCore/inspector/InspectorDatabaseAgent.h >@@ -35,7 +35,6 @@ > #include "InspectorWebBackendDispatchers.h" > #include "InspectorWebFrontendDispatchers.h" > #include <wtf/HashMap.h> >-#include <wtf/PassOwnPtr.h> > #include <wtf/text/WTFString.h> > > namespace Inspector { >diff --git a/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp b/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp >index 4e85bc532995ed5dda949686c4db6ad0dea9f8d0..bf1791848bb1bc488a61733553cdcb956a2d1328 100644 >--- a/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp >+++ b/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp >@@ -116,15 +116,15 @@ void InspectorFrontendClientLocal::Settings::setProperty(const String&, const St > { > } > >-InspectorFrontendClientLocal::InspectorFrontendClientLocal(InspectorController* inspectorController, Page* frontendPage, PassOwnPtr<Settings> settings) >+InspectorFrontendClientLocal::InspectorFrontendClientLocal(InspectorController* inspectorController, Page* frontendPage, std::unique_ptr<Settings> settings) > : m_inspectorController(inspectorController) > , m_frontendPage(frontendPage) >- , m_settings(settings) >+ , m_settings(std::move(settings)) > , m_frontendLoaded(false) > , m_dockSide(UNDOCKED) > { > m_frontendPage->settings().setAllowFileAccessFromFileURLs(true); >- m_dispatchTask = adoptPtr(new InspectorBackendDispatchTask(inspectorController)); >+ m_dispatchTask = std::make_unique<InspectorBackendDispatchTask>(inspectorController); > } > > InspectorFrontendClientLocal::~InspectorFrontendClientLocal() >diff --git a/Source/WebCore/inspector/InspectorFrontendClientLocal.h b/Source/WebCore/inspector/InspectorFrontendClientLocal.h >index ed2cfb10d0c09a3f0268ce16c3fa2f8fe77793a9..2f637b0f260e5b8d1cf5e975af0df4e17e66a16f 100644 >--- a/Source/WebCore/inspector/InspectorFrontendClientLocal.h >+++ b/Source/WebCore/inspector/InspectorFrontendClientLocal.h >@@ -55,9 +55,9 @@ public: > virtual void setProperty(const String& name, const String& value); > }; > >- InspectorFrontendClientLocal(InspectorController*, Page*, PassOwnPtr<Settings>); >+ InspectorFrontendClientLocal(InspectorController*, Page*, std::unique_ptr<Settings>); > virtual ~InspectorFrontendClientLocal(); >- >+ > virtual void windowObjectCleared() override; > virtual void frontendLoaded() override; > >@@ -98,7 +98,7 @@ public: > void showConsole(); > > void showMainResourceForFrame(Frame*); >- >+ > void showResources(); > > void setAttachedWindow(DockSide); >@@ -117,11 +117,11 @@ private: > Page* m_frontendPage; > // TODO(yurys): this ref shouldn't be needed. > RefPtr<InspectorFrontendHost> m_frontendHost; >- OwnPtr<InspectorFrontendClientLocal::Settings> m_settings; >+ std::unique_ptr<InspectorFrontendClientLocal::Settings> m_settings; > bool m_frontendLoaded; > DockSide m_dockSide; > Vector<String> m_evaluateOnLoad; >- OwnPtr<InspectorBackendDispatchTask> m_dispatchTask; >+ std::unique_ptr<InspectorBackendDispatchTask> m_dispatchTask; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/inspector/InspectorHeapProfilerAgent.h b/Source/WebCore/inspector/InspectorHeapProfilerAgent.h >index e417c3cb0a4358831bd57ae878cd0259f07a4b6d..e7d9ffda2c8b34ed582eb4e967032eb2a05a75a2 100644 >--- a/Source/WebCore/inspector/InspectorHeapProfilerAgent.h >+++ b/Source/WebCore/inspector/InspectorHeapProfilerAgent.h >@@ -39,7 +39,6 @@ > #include <wtf/Forward.h> > #include <wtf/HashMap.h> > #include <wtf/Noncopyable.h> >-#include <wtf/PassOwnPtr.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { >diff --git a/Source/WebCore/inspector/InspectorHistory.cpp b/Source/WebCore/inspector/InspectorHistory.cpp >index bcfef4a4b5c77c2d2a52d06621c6ad4ef09d45d0..873a8f95b4ff62830864cbe2ebe05676e0d93cb6 100644 >--- a/Source/WebCore/inspector/InspectorHistory.cpp >+++ b/Source/WebCore/inspector/InspectorHistory.cpp >@@ -79,7 +79,7 @@ String InspectorHistory::Action::mergeId() > return ""; > } > >-void InspectorHistory::Action::merge(PassOwnPtr<Action>) >+void InspectorHistory::Action::merge(std::unique_ptr<Action>) > { > } > >@@ -87,16 +87,16 @@ InspectorHistory::InspectorHistory() : m_afterLastActionIndex(0) { } > > InspectorHistory::~InspectorHistory() { } > >-bool InspectorHistory::perform(PassOwnPtr<Action> action, ExceptionCode& ec) >+bool InspectorHistory::perform(std::unique_ptr<Action> action, ExceptionCode& ec) > { > if (!action->perform(ec)) > return false; > > if (!action->mergeId().isEmpty() && m_afterLastActionIndex > 0 && action->mergeId() == m_history[m_afterLastActionIndex - 1]->mergeId()) >- m_history[m_afterLastActionIndex - 1]->merge(action); >+ m_history[m_afterLastActionIndex - 1]->merge(std::move(action)); > else { > m_history.resize(m_afterLastActionIndex); >- m_history.append(action); >+ m_history.append(std::move(action)); > ++m_afterLastActionIndex; > } > return true; >@@ -104,7 +104,7 @@ bool InspectorHistory::perform(PassOwnPtr<Action> action, ExceptionCode& ec) > > void InspectorHistory::markUndoableState() > { >- perform(adoptPtr(new UndoableStateMark()), IGNORE_EXCEPTION); >+ perform(std::make_unique<UndoableStateMark>(), IGNORE_EXCEPTION); > } > > bool InspectorHistory::undo(ExceptionCode& ec) >diff --git a/Source/WebCore/inspector/InspectorHistory.h b/Source/WebCore/inspector/InspectorHistory.h >index 7224a393efbb5a9fac1ebae96d31315257c4d6d5..a22abb530cb4af44d7829503477cbd2c2ec57af1 100644 >--- a/Source/WebCore/inspector/InspectorHistory.h >+++ b/Source/WebCore/inspector/InspectorHistory.h >@@ -33,7 +33,6 @@ > > #include "ExceptionCode.h" > >-#include <wtf/OwnPtr.h> > #include <wtf/Vector.h> > #include <wtf/text/WTFString.h> > >@@ -56,7 +55,7 @@ public: > virtual String toString(); > > virtual String mergeId(); >- virtual void merge(PassOwnPtr<Action>); >+ virtual void merge(std::unique_ptr<Action>); > > virtual bool perform(ExceptionCode&) = 0; > >@@ -71,7 +70,7 @@ public: > InspectorHistory(); > virtual ~InspectorHistory(); > >- bool perform(PassOwnPtr<Action>, ExceptionCode&); >+ bool perform(std::unique_ptr<Action>, ExceptionCode&); > void markUndoableState(); > > bool undo(ExceptionCode&); >@@ -79,7 +78,7 @@ public: > void reset(); > > private: >- Vector<OwnPtr<Action>> m_history; >+ Vector<std::unique_ptr<Action>> m_history; > size_t m_afterLastActionIndex; > }; > >diff --git a/Source/WebCore/inspector/InspectorIndexedDBAgent.h b/Source/WebCore/inspector/InspectorIndexedDBAgent.h >index d071a004f9496df2965202892a59cd2f0ad9b16d..aaf1fd93bc45271fd859cb7a412cf21149c75726 100644 >--- a/Source/WebCore/inspector/InspectorIndexedDBAgent.h >+++ b/Source/WebCore/inspector/InspectorIndexedDBAgent.h >@@ -35,7 +35,6 @@ > > #include "InspectorWebAgentBase.h" > #include "InspectorWebBackendDispatchers.h" >-#include <wtf/PassOwnPtr.h> > #include <wtf/text/WTFString.h> > > namespace Inspector { >diff --git a/Source/WebCore/inspector/InspectorInputAgent.h b/Source/WebCore/inspector/InspectorInputAgent.h >index f152af645fd58899d06bddd25c2a1a7544f04778..9091da73a53acbaef96b1a7b8de2f3e4edde8c0e 100644 >--- a/Source/WebCore/inspector/InspectorInputAgent.h >+++ b/Source/WebCore/inspector/InspectorInputAgent.h >@@ -36,7 +36,6 @@ > #include "InspectorWebAgentBase.h" > #include "InspectorWebBackendDispatchers.h" > #include <wtf/Noncopyable.h> >-#include <wtf/PassOwnPtr.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { >diff --git a/Source/WebCore/inspector/InspectorLayerTreeAgent.h b/Source/WebCore/inspector/InspectorLayerTreeAgent.h >index 7561ac754dd4a3c8a9cc6890877e79e34365f80f..0a5b88fce07a5d26daca4c0252c5f202f34c9029 100644 >--- a/Source/WebCore/inspector/InspectorLayerTreeAgent.h >+++ b/Source/WebCore/inspector/InspectorLayerTreeAgent.h >@@ -36,7 +36,6 @@ > #include "InspectorWebFrontendDispatchers.h" > #include "InspectorWebTypeBuilders.h" > #include "RenderLayer.h" >-#include <wtf/PassOwnPtr.h> > #include <wtf/PassRefPtr.h> > #include <wtf/Vector.h> > #include <wtf/text/WTFString.h> >diff --git a/Source/WebCore/inspector/InspectorMemoryAgent.cpp b/Source/WebCore/inspector/InspectorMemoryAgent.cpp >index 164d914d6f335dfb01a27591e05a1dba01e2a634..35ee01e12aa33a22ec2f5a0cfe168cc84cb64d40 100644 >--- a/Source/WebCore/inspector/InspectorMemoryAgent.cpp >+++ b/Source/WebCore/inspector/InspectorMemoryAgent.cpp >@@ -49,8 +49,6 @@ > #include <inspector/InspectorValues.h> > #include <runtime/ArrayBufferView.h> > #include <wtf/HashSet.h> >-#include <wtf/OwnPtr.h> >-#include <wtf/PassOwnPtr.h> > #include <wtf/Vector.h> > #include <wtf/text/StringBuilder.h> > #include <wtf/text/StringImpl.h> >diff --git a/Source/WebCore/inspector/InspectorMemoryAgent.h b/Source/WebCore/inspector/InspectorMemoryAgent.h >index 12f3a9c5e55f272ebc4dfb854b8b862eb26b0143..b3cd2ffe7a6c1c5db2a76e724fe8a9660af1dfcb 100644 >--- a/Source/WebCore/inspector/InspectorMemoryAgent.h >+++ b/Source/WebCore/inspector/InspectorMemoryAgent.h >@@ -35,7 +35,6 @@ > > #include "InspectorWebAgentBase.h" > #include "InspectorWebBackendDispatchers.h" >-#include <wtf/PassOwnPtr.h> > #include <wtf/RefPtr.h> > > namespace WebCore { >diff --git a/Source/WebCore/inspector/InspectorOverlay.cpp b/Source/WebCore/inspector/InspectorOverlay.cpp >index 524d9297a015d1968d64d075fc82e3ba47c74618..34cd5a4e30c9ba8f669d5dd3369e770f4458cf59 100644 >--- a/Source/WebCore/inspector/InspectorOverlay.cpp >+++ b/Source/WebCore/inspector/InspectorOverlay.cpp >@@ -280,7 +280,7 @@ void InspectorOverlay::setPausedInDebuggerMessage(const String* message) > void InspectorOverlay::hideHighlight() > { > m_highlightNode.clear(); >- m_highlightQuad.clear(); >+ m_highlightQuad.reset(); > update(); > } > >@@ -291,13 +291,13 @@ void InspectorOverlay::highlightNode(Node* node, const HighlightConfig& highligh > update(); > } > >-void InspectorOverlay::highlightQuad(PassOwnPtr<FloatQuad> quad, const HighlightConfig& highlightConfig) >+void InspectorOverlay::highlightQuad(std::unique_ptr<FloatQuad> quad, const HighlightConfig& highlightConfig) > { > if (m_quadHighlightConfig.usePageCoordinates) > *quad -= m_page.mainFrame().view()->scrollOffset(); > > m_quadHighlightConfig = highlightConfig; >- m_highlightQuad = quad; >+ m_highlightQuad = std::move(quad); > update(); > } > >@@ -748,7 +748,7 @@ Page* InspectorOverlay::overlayPage() > > Page::PageClients pageClients; > fillWithEmptyClients(pageClients); >- m_overlayPage = adoptPtr(new Page(pageClients)); >+ m_overlayPage = std::make_unique<Page>(pageClients); > > Settings& settings = m_page.settings(); > Settings& overlaySettings = m_overlayPage->settings(); >@@ -815,7 +815,7 @@ void InspectorOverlay::evaluateInOverlay(const String& method, PassRefPtr<Inspec > > void InspectorOverlay::freePage() > { >- m_overlayPage.clear(); >+ m_overlayPage.reset(); > } > > } // namespace WebCore >diff --git a/Source/WebCore/inspector/InspectorOverlay.h b/Source/WebCore/inspector/InspectorOverlay.h >index 7e3d017b235fb777291f250ff47f6f1895742431..a7e6c7849b23a01f60a69824414b35de5a20c784 100644 >--- a/Source/WebCore/inspector/InspectorOverlay.h >+++ b/Source/WebCore/inspector/InspectorOverlay.h >@@ -32,8 +32,6 @@ > #include "Color.h" > #include "FloatQuad.h" > #include "LayoutRect.h" >-#include <wtf/OwnPtr.h> >-#include <wtf/PassOwnPtr.h> > #include <wtf/RefPtr.h> > #include <wtf/Vector.h> > #include <wtf/text/WTFString.h> >@@ -117,7 +115,7 @@ public: > > void hideHighlight(); > void highlightNode(Node*, const HighlightConfig&); >- void highlightQuad(PassOwnPtr<FloatQuad>, const HighlightConfig&); >+ void highlightQuad(std::unique_ptr<FloatQuad>, const HighlightConfig&); > > Node* highlightedNode() const; > >@@ -141,8 +139,8 @@ private: > String m_pausedInDebuggerMessage; > RefPtr<Node> m_highlightNode; > HighlightConfig m_nodeHighlightConfig; >- OwnPtr<FloatQuad> m_highlightQuad; >- OwnPtr<Page> m_overlayPage; >+ std::unique_ptr<FloatQuad> m_highlightQuad; >+ std::unique_ptr<Page> m_overlayPage; > HighlightConfig m_quadHighlightConfig; > IntSize m_size; > }; >diff --git a/Source/WebCore/inspector/InspectorProfilerAgent.cpp b/Source/WebCore/inspector/InspectorProfilerAgent.cpp >index c52c66af624a43b2e9ed437454d946bf0169b95f..09ca933ce1371ce208f64f98620b3a0e2d8a4578 100644 >--- a/Source/WebCore/inspector/InspectorProfilerAgent.cpp >+++ b/Source/WebCore/inspector/InspectorProfilerAgent.cpp >@@ -50,7 +50,6 @@ > #include <inspector/InspectorValues.h> > #include <inspector/agents/InspectorConsoleAgent.h> > #include <wtf/CurrentTime.h> >-#include <wtf/OwnPtr.h> > #include <wtf/text/StringConcatenate.h> > > using namespace Inspector; >diff --git a/Source/WebCore/inspector/InspectorProfilerAgent.h b/Source/WebCore/inspector/InspectorProfilerAgent.h >index 7dfe18c1744b7850c4f53a7390d4985266751590..743cfbcd48e8aec3e95a721177ba0a0c851d2cff 100644 >--- a/Source/WebCore/inspector/InspectorProfilerAgent.h >+++ b/Source/WebCore/inspector/InspectorProfilerAgent.h >@@ -38,7 +38,6 @@ > #include <wtf/Forward.h> > #include <wtf/HashMap.h> > #include <wtf/Noncopyable.h> >-#include <wtf/PassOwnPtr.h> > #include <wtf/text/WTFString.h> > > namespace Inspector { >diff --git a/Source/WebCore/inspector/InspectorResourceAgent.cpp b/Source/WebCore/inspector/InspectorResourceAgent.cpp >index 480bde9047187f508bedd69c130d861975097466..89e5cf495eeaa78523364b10d144a18254f212f2 100644 >--- a/Source/WebCore/inspector/InspectorResourceAgent.cpp >+++ b/Source/WebCore/inspector/InspectorResourceAgent.cpp >@@ -643,7 +643,7 @@ InspectorResourceAgent::InspectorResourceAgent(InstrumentingAgents* instrumentin > : InspectorAgentBase(ASCIILiteral("Network"), instrumentingAgents) > , m_pageAgent(pageAgent) > , m_client(client) >- , m_resourcesData(adoptPtr(new NetworkResourcesData())) >+ , m_resourcesData(std::make_unique<NetworkResourcesData>()) > , m_enabled(false) > , m_cacheDisabled(false) > , m_loadingXHRSynchronously(false) >diff --git a/Source/WebCore/inspector/InspectorResourceAgent.h b/Source/WebCore/inspector/InspectorResourceAgent.h >index d2ca2a294ec9ca63cef85cf37b1fa7e5b3caee0f..12da778c4883e687eba41e122ab509e48f76b9b4 100644 >--- a/Source/WebCore/inspector/InspectorResourceAgent.h >+++ b/Source/WebCore/inspector/InspectorResourceAgent.h >@@ -34,7 +34,6 @@ > #include "InspectorWebAgentBase.h" > #include "InspectorWebBackendDispatchers.h" > #include "InspectorWebFrontendDispatchers.h" >-#include <wtf/PassOwnPtr.h> > #include <wtf/RefCounted.h> > #include <wtf/Vector.h> > #include <wtf/text/WTFString.h> >@@ -145,7 +144,7 @@ private: > InspectorClient* m_client; > std::unique_ptr<Inspector::InspectorNetworkFrontendDispatcher> m_frontendDispatcher; > RefPtr<Inspector::InspectorNetworkBackendDispatcher> m_backendDispatcher; >- OwnPtr<NetworkResourcesData> m_resourcesData; >+ std::unique_ptr<NetworkResourcesData> m_resourcesData; > bool m_enabled; > bool m_cacheDisabled; > bool m_loadingXHRSynchronously; >diff --git a/Source/WebCore/inspector/InspectorStyleSheet.cpp b/Source/WebCore/inspector/InspectorStyleSheet.cpp >index f27c3b137bbbb4cdeafea1a619e2eb7b9a592574..48670cd1df784f28903a1c7bb6c714de9dfd17af 100644 >--- a/Source/WebCore/inspector/InspectorStyleSheet.cpp >+++ b/Source/WebCore/inspector/InspectorStyleSheet.cpp >@@ -58,8 +58,6 @@ > #include "WebKitCSSKeyframesRule.h" > #include <inspector/ContentSearchUtilities.h> > #include <inspector/InspectorValues.h> >-#include <wtf/OwnPtr.h> >-#include <wtf/PassOwnPtr.h> > #include <wtf/Vector.h> > #include <wtf/text/StringBuilder.h> > #include <yarr/RegularExpression.h> >@@ -77,15 +75,15 @@ public: > void setText(const String& text); > bool hasText() const { return m_hasText; } > RuleSourceDataList* sourceData() const { return m_sourceData.get(); } >- void setSourceData(PassOwnPtr<RuleSourceDataList>); >- bool hasSourceData() const { return m_sourceData; } >+ void setSourceData(std::unique_ptr<RuleSourceDataList>); >+ bool hasSourceData() const { return m_sourceData != nullptr; } > PassRefPtr<WebCore::CSSRuleSourceData> ruleSourceDataAt(unsigned) const; > > private: > > String m_text; > bool m_hasText; >- OwnPtr<RuleSourceDataList> m_sourceData; >+ std::unique_ptr<RuleSourceDataList> m_sourceData; > }; > > ParsedStyleSheet::ParsedStyleSheet() >@@ -115,14 +113,14 @@ static void flattenSourceData(RuleSourceDataList* dataList, RuleSourceDataList* > } > } > >-void ParsedStyleSheet::setSourceData(PassOwnPtr<RuleSourceDataList> sourceData) >+void ParsedStyleSheet::setSourceData(std::unique_ptr<RuleSourceDataList> sourceData) > { > if (!sourceData) { >- m_sourceData.clear(); >+ m_sourceData.reset(); > return; > } > >- m_sourceData = adoptPtr(new RuleSourceDataList()); >+ m_sourceData = std::make_unique<RuleSourceDataList>(); > > // FIXME: This is a temporary solution to retain the original flat sourceData structure > // containing only style rules, even though CSSParser now provides the full rule source data tree. >@@ -284,9 +282,9 @@ static void fillMediaListChain(CSSRule* rule, Array<Inspector::TypeBuilder::CSS: > } > } > >-static PassOwnPtr<CSSParser> createCSSParser(Document* document) >+static std::unique_ptr<CSSParser> createCSSParser(Document* document) > { >- return adoptPtr(new CSSParser(document ? CSSParserContext(*document) : strictCSSParserContext())); >+ return std::make_unique<CSSParser>(document ? CSSParserContext(*document) : strictCSSParserContext()); > } > > PassRefPtr<InspectorStyle> InspectorStyle::create(const InspectorCSSId& styleId, PassRefPtr<CSSStyleDeclaration> style, InspectorStyleSheet* parentStyleSheet) >@@ -521,7 +519,7 @@ PassRefPtr<Inspector::TypeBuilder::CSS::CSSStyle> InspectorStyle::styleWithPrope > HashSet<String> foundShorthands; > String previousPriority; > String previousStatus; >- OwnPtr<Vector<size_t>> lineEndings(m_parentStyleSheet ? m_parentStyleSheet->lineEndings() : PassOwnPtr<Vector<size_t>>()); >+ std::unique_ptr<Vector<size_t>> lineEndings(m_parentStyleSheet ? m_parentStyleSheet->lineEndings() : nullptr); > RefPtr<CSSRuleSourceData> sourceData = extractSourceData(); > unsigned ruleBodyRangeStart = sourceData ? sourceData->ruleBodyRange.start : 0; > >@@ -1211,10 +1209,10 @@ RefPtr<CSSRuleSourceData> InspectorStyleSheet::ruleSourceDataFor(CSSStyleDeclara > return m_parsedStyleSheet->ruleSourceDataAt(ruleIndexByStyle(style)); > } > >-PassOwnPtr<Vector<size_t>> InspectorStyleSheet::lineEndings() const >+std::unique_ptr<Vector<size_t>> InspectorStyleSheet::lineEndings() const > { > if (!m_parsedStyleSheet->hasText()) >- return PassOwnPtr<Vector<size_t>>(); >+ return nullptr; > return ContentSearchUtilities::lineEndings(m_parsedStyleSheet->text()); > } > >@@ -1270,9 +1268,9 @@ bool InspectorStyleSheet::ensureSourceData() > return false; > > RefPtr<StyleSheetContents> newStyleSheet = StyleSheetContents::create(); >- OwnPtr<RuleSourceDataList> ruleSourceDataResult = adoptPtr(new RuleSourceDataList()); >+ auto ruleSourceDataResult = std::make_unique<RuleSourceDataList>(); > createCSSParser(m_pageStyleSheet->ownerDocument())->parseSheet(newStyleSheet.get(), m_parsedStyleSheet->text(), 0, ruleSourceDataResult.get()); >- m_parsedStyleSheet->setSourceData(ruleSourceDataResult.release()); >+ m_parsedStyleSheet->setSourceData(std::move(ruleSourceDataResult)); > return m_parsedStyleSheet->hasSourceData(); > } > >@@ -1476,7 +1474,7 @@ bool InspectorStyleSheetForInlineStyle::setStyleText(CSSStyleDeclaration* style, > return !ec; > } > >-PassOwnPtr<Vector<size_t>> InspectorStyleSheetForInlineStyle::lineEndings() const >+std::unique_ptr<Vector<size_t>> InspectorStyleSheetForInlineStyle::lineEndings() const > { > return ContentSearchUtilities::lineEndings(elementStyleText()); > } >diff --git a/Source/WebCore/inspector/InspectorStyleSheet.h b/Source/WebCore/inspector/InspectorStyleSheet.h >index bc1f1ac79cb1d7c234cf154a7a2fe587c1e59676..8b191fe08439b5f8e77a2759597e633da99e0f4f 100644 >--- a/Source/WebCore/inspector/InspectorStyleSheet.h >+++ b/Source/WebCore/inspector/InspectorStyleSheet.h >@@ -226,7 +226,7 @@ protected: > > // Also accessed by friend class InspectorStyle. > virtual bool setStyleText(CSSStyleDeclaration*, const String&, ExceptionCode&); >- virtual PassOwnPtr<Vector<size_t>> lineEndings() const; >+ virtual std::unique_ptr<Vector<size_t>> lineEndings() const; > > private: > typedef Vector<RefPtr<CSSStyleRule>> CSSStyleRuleVector; >@@ -278,7 +278,7 @@ protected: > > // Also accessed by friend class InspectorStyle. > virtual bool setStyleText(CSSStyleDeclaration*, const String&, ExceptionCode&) override; >- virtual PassOwnPtr<Vector<size_t>> lineEndings() const override; >+ virtual std::unique_ptr<Vector<size_t>> lineEndings() const override; > > private: > CSSStyleDeclaration* inlineStyle() const; >diff --git a/Source/WebCore/inspector/InspectorTimelineAgent.h b/Source/WebCore/inspector/InspectorTimelineAgent.h >index eff625d465e5fe9bf4b4abc827880f36a0720869..00ca6ae0aa271e251b08466ecf93e08efa6690c2 100644 >--- a/Source/WebCore/inspector/InspectorTimelineAgent.h >+++ b/Source/WebCore/inspector/InspectorTimelineAgent.h >@@ -38,7 +38,6 @@ > #include "InspectorWebFrontendDispatchers.h" > #include "LayoutRect.h" > #include <inspector/InspectorValues.h> >-#include <wtf/PassOwnPtr.h> > #include <wtf/Vector.h> > #include <wtf/WeakPtr.h> > >diff --git a/Source/WebCore/inspector/InspectorWorkerAgent.cpp b/Source/WebCore/inspector/InspectorWorkerAgent.cpp >index b8108b54f2c9caf25e2d0ebfa4fc2b92d175c0ec..8573d86ac45fa314e1ab34d288a0ea379310a0e9 100644 >--- a/Source/WebCore/inspector/InspectorWorkerAgent.cpp >+++ b/Source/WebCore/inspector/InspectorWorkerAgent.cpp >@@ -40,7 +40,6 @@ > #include "URL.h" > #include "WorkerGlobalScopeProxy.h" > #include <inspector/InspectorValues.h> >-#include <wtf/PassOwnPtr.h> > #include <wtf/RefPtr.h> > > using namespace Inspector; >diff --git a/Source/WebCore/inspector/PageConsoleAgent.cpp b/Source/WebCore/inspector/PageConsoleAgent.cpp >index 7159cdd7c04198305e06053e196fd3dd557d7156..30f55279404b275899f3229b49d8e1cb4b4203f7 100644 >--- a/Source/WebCore/inspector/PageConsoleAgent.cpp >+++ b/Source/WebCore/inspector/PageConsoleAgent.cpp >@@ -75,7 +75,7 @@ void PageConsoleAgent::addInspectedNode(ErrorString* errorString, int nodeId) > } > > if (CommandLineAPIHost* commandLineAPIHost = static_cast<PageInjectedScriptManager*>(m_injectedScriptManager)->commandLineAPIHost()) >- commandLineAPIHost->addInspectedObject(adoptPtr(new InspectableNode(node))); >+ commandLineAPIHost->addInspectedObject(std::make_unique<InspectableNode>(node)); > } > > } // namespace WebCore >diff --git a/Source/WebCore/inspector/PageRuntimeAgent.h b/Source/WebCore/inspector/PageRuntimeAgent.h >index 02058d6f43b4321cb34c472f241e9df0d385a009..fd47c74070dd544bddbe31b26b1d7089259ff25c 100644 >--- a/Source/WebCore/inspector/PageRuntimeAgent.h >+++ b/Source/WebCore/inspector/PageRuntimeAgent.h >@@ -35,7 +35,6 @@ > > #include <inspector/InspectorJSFrontendDispatchers.h> > #include <inspector/agents/InspectorRuntimeAgent.h> >-#include <wtf/PassOwnPtr.h> > > namespace JSC { > class ExecState; >diff --git a/Source/WebCore/inspector/WebConsoleAgent.cpp b/Source/WebCore/inspector/WebConsoleAgent.cpp >index 9d220d6c89f20c46650a3d6d87f1cbb79e4647d0..79b074ea9088ef23092440a9504a9182bfe3c6ed 100644 >--- a/Source/WebCore/inspector/WebConsoleAgent.cpp >+++ b/Source/WebCore/inspector/WebConsoleAgent.cpp >@@ -131,7 +131,7 @@ private: > void WebConsoleAgent::addInspectedHeapObject(ErrorString*, int inspectedHeapObjectId) > { > if (CommandLineAPIHost* commandLineAPIHost = static_cast<PageInjectedScriptManager*>(m_injectedScriptManager)->commandLineAPIHost()) >- commandLineAPIHost->addInspectedObject(adoptPtr(new InspectableHeapObject(inspectedHeapObjectId))); >+ commandLineAPIHost->addInspectedObject(std::make_unique<InspectableHeapObject>(inspectedHeapObjectId)); > } > > } // namespace WebCore >diff --git a/Source/WebCore/inspector/WorkerRuntimeAgent.h b/Source/WebCore/inspector/WorkerRuntimeAgent.h >index 95e254dcd2eff6464b5e707fa64a3f4c5d0986dd..5c2d8614b0ab3dbe72e8658d10cd19f742ddc3a7 100644 >--- a/Source/WebCore/inspector/WorkerRuntimeAgent.h >+++ b/Source/WebCore/inspector/WorkerRuntimeAgent.h >@@ -34,7 +34,6 @@ > #if ENABLE(INSPECTOR) > > #include <inspector/agents/InspectorRuntimeAgent.h> >-#include <wtf/PassOwnPtr.h> > > namespace WebCore { > >diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp >index 62ed24cb0d6f4f908c5b8a43db287be7dc7efecd..b8dddd1c990d9cfae621828dd73a8e30fdc18db2 100644 >--- a/Source/WebCore/testing/Internals.cpp >+++ b/Source/WebCore/testing/Internals.cpp >@@ -194,7 +194,7 @@ protected: > }; > > InspectorFrontendClientDummy::InspectorFrontendClientDummy(InspectorController* controller, Page* page) >- : InspectorFrontendClientLocal(controller, page, adoptPtr(new InspectorFrontendClientLocal::Settings())) >+ : InspectorFrontendClientLocal(controller, page, std::make_unique<InspectorFrontendClientLocal::Settings>()) > { > } > >diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp >index b3e6e45f9b18a6e3277969e7eca6ffac4e05339e..bb459c42691723ba1aeb85a86463eb5bcbd9d245 100644 >--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp >+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp >@@ -41,7 +41,7 @@ using namespace WebCore; > namespace WebKit { > > WebInspectorFrontendClient::WebInspectorFrontendClient(WebPage* page, WebPage* inspectorPage) >- : InspectorFrontendClientLocal(&page->corePage()->inspectorController(), inspectorPage->corePage(), adoptPtr(new Settings())) >+ : InspectorFrontendClientLocal(&page->corePage()->inspectorController(), inspectorPage->corePage(), std::make_unique<Settings>()) > , m_page(page) > { > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 128681
:
223995
|
224081
|
224087
|
224122
|
224369