| Differences between
and this patch
- a/Source/JavaScriptCore/ChangeLog +17 lines
Lines 1-3 a/Source/JavaScriptCore/ChangeLog_sec1
1
2014-02-12  Sergio Correia  <sergio.correia@openbossa.org>
2
3
        Replace uses of PassOwnPtr/OwnPtr with std::unique_ptr in WebCore/inspector
4
        https://bugs.webkit.org/show_bug.cgi?id=128681
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Another step towards getting rid of PassOwnPtr/OwnPtr, now targeting
9
        WebCore/inspector/*. Besides files in there, a few other files in
10
        JavaScriptCore/inspector, WebKit2/WebProcess/WebCoreSupport/ and
11
        WebCore/testing were touched.
12
13
        * inspector/ContentSearchUtilities.cpp:
14
        * inspector/ContentSearchUtilities.h:
15
        * inspector/agents/InspectorConsoleAgent.cpp:
16
        * inspector/agents/InspectorConsoleAgent.h:
17
1
2014-02-12  Ryosuke Niwa  <rniwa@webkit.org>
18
2014-02-12  Ryosuke Niwa  <rniwa@webkit.org>
2
19
3
        Windows build fix attempt after r163960.
20
        Windows build fix attempt after r163960.
- a/Source/WebCore/ChangeLog +54 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2014-02-12  Sergio Correia  <sergio.correia@openbossa.org>
2
3
        Replace uses of PassOwnPtr/OwnPtr with std::unique_ptr in WebCore/inspector
4
        https://bugs.webkit.org/show_bug.cgi?id=128681
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Another step towards getting rid of PassOwnPtr/OwnPtr, now targeting
9
        WebCore/inspector/*. Besides files in there, a few other files in
10
        JavaScriptCore/inspector, WebKit2/WebProcess/WebCoreSupport/ and
11
        WebCore/testing were touched.
12
13
        No new tests; no new behavior.
14
15
        * inspector/CommandLineAPIHost.cpp:
16
        * inspector/CommandLineAPIHost.h:
17
        * inspector/DOMEditor.cpp:
18
        * inspector/DOMPatchSupport.cpp:
19
        * inspector/DOMPatchSupport.h:
20
        * inspector/InspectorApplicationCacheAgent.h:
21
        * inspector/InspectorCSSAgent.cpp:
22
        * inspector/InspectorCSSAgent.h:
23
        * inspector/InspectorCanvasAgent.h:
24
        * inspector/InspectorDOMAgent.cpp:
25
        * inspector/InspectorDOMAgent.h:
26
        * inspector/InspectorDOMDebuggerAgent.h:
27
        * inspector/InspectorDOMStorageAgent.h:
28
        * inspector/InspectorDatabaseAgent.h:
29
        * inspector/InspectorFrontendClientLocal.cpp:
30
        * inspector/InspectorFrontendClientLocal.h:
31
        * inspector/InspectorHeapProfilerAgent.h:
32
        * inspector/InspectorHistory.cpp:
33
        * inspector/InspectorHistory.h:
34
        * inspector/InspectorIndexedDBAgent.h:
35
        * inspector/InspectorInputAgent.h:
36
        * inspector/InspectorLayerTreeAgent.h:
37
        * inspector/InspectorMemoryAgent.cpp:
38
        * inspector/InspectorMemoryAgent.h:
39
        * inspector/InspectorOverlay.cpp:
40
        * inspector/InspectorOverlay.h:
41
        * inspector/InspectorProfilerAgent.cpp:
42
        * inspector/InspectorProfilerAgent.h:
43
        * inspector/InspectorResourceAgent.cpp:
44
        * inspector/InspectorResourceAgent.h:
45
        * inspector/InspectorStyleSheet.cpp:
46
        * inspector/InspectorStyleSheet.h:
47
        * inspector/InspectorTimelineAgent.h:
48
        * inspector/InspectorWorkerAgent.cpp:
49
        * inspector/PageConsoleAgent.cpp:
50
        * inspector/PageRuntimeAgent.h:
51
        * inspector/WebConsoleAgent.cpp:
52
        * inspector/WorkerRuntimeAgent.h:
53
        * testing/Internals.cpp:
54
1
2014-02-12  Joseph Pecoraro  <pecoraro@apple.com>
55
2014-02-12  Joseph Pecoraro  <pecoraro@apple.com>
2
56
3
        Web Inspector: Modernize missed inspector files
57
        Web Inspector: Modernize missed inspector files
- a/Source/WebKit2/ChangeLog +14 lines
Lines 1-3 a/Source/WebKit2/ChangeLog_sec1
1
2014-02-12  Sergio Correia  <sergio.correia@openbossa.org>
2
3
        Replace uses of PassOwnPtr/OwnPtr with std::unique_ptr in WebCore/inspector
4
        https://bugs.webkit.org/show_bug.cgi?id=128681
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Another step towards getting rid of PassOwnPtr/OwnPtr, now targeting
9
        WebCore/inspector/*. Besides files in there, a few other files in
10
        JavaScriptCore/inspector, WebKit2/WebProcess/WebCoreSupport/ and
11
        WebCore/testing were touched.
12
13
        * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
14
1
2014-02-12  Dan Bernstein  <mitz@apple.com>
15
2014-02-12  Dan Bernstein  <mitz@apple.com>
2
16
3
        Stop using PLATFORM(MAC) in WebKit2/{Database,Network}Process except where it means “OS X but not iOS”
17
        Stop using PLATFORM(MAC) in WebKit2/{Database,Network}Process except where it means “OS X but not iOS”
- a/Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp -4 / +4 lines
Lines 82-88 static Vector<std::pair<int, String>> getRegularExpressionMatchesByLines(const J a/Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp_sec1
82
    if (text.isEmpty())
82
    if (text.isEmpty())
83
        return result;
83
        return result;
84
84
85
    OwnPtr<Vector<size_t>> endings(lineEndings(text));
85
    std::unique_ptr<Vector<size_t>> endings(lineEndings(text));
86
    size_t size = endings->size();
86
    size_t size = endings->size();
87
    unsigned start = 0;
87
    unsigned start = 0;
88
    for (size_t lineNumber = 0; lineNumber < size; ++lineNumber) {
88
    for (size_t lineNumber = 0; lineNumber < size; ++lineNumber) {
Lines 100-108 static Vector<std::pair<int, String>> getRegularExpressionMatchesByLines(const J a/Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp_sec2
100
    return result;
100
    return result;
101
}
101
}
102
102
103
PassOwnPtr<Vector<size_t>> lineEndings(const String& text)
103
std::unique_ptr<Vector<size_t>> lineEndings(const String& text)
104
{
104
{
105
    OwnPtr<Vector<size_t>> result(adoptPtr(new Vector<size_t>()));
105
    auto result = std::make_unique<Vector<size_t>>();
106
106
107
    unsigned start = 0;
107
    unsigned start = 0;
108
    while (start < text.length()) {
108
    while (start < text.length()) {
Lines 115-121 PassOwnPtr<Vector<size_t>> lineEndings(const String& text) a/Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp_sec3
115
    }
115
    }
116
    result->append(text.length());
116
    result->append(text.length());
117
117
118
    return result.release();
118
    return result;
119
}
119
}
120
120
121
static PassRefPtr<Inspector::TypeBuilder::GenericTypes::SearchMatch> buildObjectForSearchMatch(int lineNumber, const String& lineContent)
121
static PassRefPtr<Inspector::TypeBuilder::GenericTypes::SearchMatch> buildObjectForSearchMatch(int lineNumber, const String& lineContent)
- a/Source/JavaScriptCore/inspector/ContentSearchUtilities.h -1 / +1 lines
Lines 48-54 JS_EXPORT_PRIVATE JSC::Yarr::RegularExpression createSearchRegex(const String& q a/Source/JavaScriptCore/inspector/ContentSearchUtilities.h_sec1
48
JS_EXPORT_PRIVATE int countRegularExpressionMatches(const JSC::Yarr::RegularExpression&, const String&);
48
JS_EXPORT_PRIVATE int countRegularExpressionMatches(const JSC::Yarr::RegularExpression&, const String&);
49
JS_EXPORT_PRIVATE PassRefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::GenericTypes::SearchMatch>> searchInTextByLines(const String& text, const String& query, const bool caseSensitive, const bool isRegex);
49
JS_EXPORT_PRIVATE PassRefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::GenericTypes::SearchMatch>> searchInTextByLines(const String& text, const String& query, const bool caseSensitive, const bool isRegex);
50
JS_EXPORT_PRIVATE TextPosition textPositionFromOffset(size_t offset, const Vector<size_t>& lineEndings);
50
JS_EXPORT_PRIVATE TextPosition textPositionFromOffset(size_t offset, const Vector<size_t>& lineEndings);
51
JS_EXPORT_PRIVATE PassOwnPtr<Vector<size_t>> lineEndings(const String&);
51
JS_EXPORT_PRIVATE std::unique_ptr<Vector<size_t>> lineEndings(const String&);
52
52
53
JS_EXPORT_PRIVATE String findScriptSourceURL(const String& content);
53
JS_EXPORT_PRIVATE String findScriptSourceURL(const String& content);
54
JS_EXPORT_PRIVATE String findScriptSourceMapURL(const String& content);
54
JS_EXPORT_PRIVATE String findScriptSourceMapURL(const String& content);
- a/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp -7 / +5 lines
Lines 36-43 a/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp_sec1
36
#include "ScriptCallStackFactory.h"
36
#include "ScriptCallStackFactory.h"
37
#include "ScriptObject.h"
37
#include "ScriptObject.h"
38
#include <wtf/CurrentTime.h>
38
#include <wtf/CurrentTime.h>
39
#include <wtf/OwnPtr.h>
40
#include <wtf/PassOwnPtr.h>
41
#include <wtf/text/StringBuilder.h>
39
#include <wtf/text/StringBuilder.h>
42
#include <wtf/text/WTFString.h>
40
#include <wtf/text/WTFString.h>
43
41
Lines 130-136 void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageTyp a/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp_sec2
130
        clearMessages(&error);
128
        clearMessages(&error);
131
    }
129
    }
132
130
133
    addConsoleMessage(adoptPtr(new ConsoleMessage(!isWorkerAgent(), source, type, level, message, callStack, requestIdentifier)));
131
    addConsoleMessage(std::make_unique<ConsoleMessage>(!isWorkerAgent(), source, type, level, message, callStack, requestIdentifier));
134
}
132
}
135
133
136
void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, JSC::ExecState* state, PassRefPtr<ScriptArguments> arguments, unsigned long requestIdentifier)
134
void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, JSC::ExecState* state, PassRefPtr<ScriptArguments> arguments, unsigned long requestIdentifier)
Lines 143-149 void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageTyp a/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp_sec3
143
        clearMessages(&error);
141
        clearMessages(&error);
144
    }
142
    }
145
143
146
    addConsoleMessage(adoptPtr(new ConsoleMessage(!isWorkerAgent(), source, type, level, message, arguments, state, requestIdentifier)));
144
    addConsoleMessage(std::make_unique<ConsoleMessage>(!isWorkerAgent(), source, type, level, message, arguments, state, requestIdentifier));
147
}
145
}
148
146
149
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)
147
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)
Lines 157-163 void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageTyp a/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp_sec4
157
    }
155
    }
158
156
159
    bool canGenerateCallStack = !isWorkerAgent() && m_frontendDispatcher;
157
    bool canGenerateCallStack = !isWorkerAgent() && m_frontendDispatcher;
160
    addConsoleMessage(adoptPtr(new ConsoleMessage(canGenerateCallStack, source, type, level, message, scriptID, lineNumber, columnNumber, state, requestIdentifier)));
158
    addConsoleMessage(std::make_unique<ConsoleMessage>(canGenerateCallStack, source, type, level, message, scriptID, lineNumber, columnNumber, state, requestIdentifier));
161
}
159
}
162
160
163
Vector<unsigned> InspectorConsoleAgent::consoleMessageArgumentCounts() const
161
Vector<unsigned> InspectorConsoleAgent::consoleMessageArgumentCounts() const
Lines 229-235 static bool isGroupMessage(MessageType type) a/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp_sec5
229
        || type == MessageType::EndGroup;
227
        || type == MessageType::EndGroup;
230
}
228
}
231
229
232
void InspectorConsoleAgent::addConsoleMessage(PassOwnPtr<ConsoleMessage> consoleMessage)
230
void InspectorConsoleAgent::addConsoleMessage(std::unique_ptr<ConsoleMessage> consoleMessage)
233
{
231
{
234
    ASSERT(m_injectedScriptManager->inspectorEnvironment().developerExtrasEnabled());
232
    ASSERT(m_injectedScriptManager->inspectorEnvironment().developerExtrasEnabled());
235
    ASSERT_ARG(consoleMessage, consoleMessage);
233
    ASSERT_ARG(consoleMessage, consoleMessage);
Lines 240-246 void InspectorConsoleAgent::addConsoleMessage(PassOwnPtr<ConsoleMessage> console a/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp_sec6
240
            m_previousMessage->updateRepeatCountInConsole(m_frontendDispatcher.get());
238
            m_previousMessage->updateRepeatCountInConsole(m_frontendDispatcher.get());
241
    } else {
239
    } else {
242
        m_previousMessage = consoleMessage.get();
240
        m_previousMessage = consoleMessage.get();
243
        m_consoleMessages.append(consoleMessage);
241
        m_consoleMessages.append(std::move(consoleMessage));
244
        if (m_frontendDispatcher && m_enabled)
242
        if (m_frontendDispatcher && m_enabled)
245
            m_previousMessage->addToFrontend(m_frontendDispatcher.get(), m_injectedScriptManager, true);
243
            m_previousMessage->addToFrontend(m_frontendDispatcher.get(), m_injectedScriptManager, true);
246
    }
244
    }
- a/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.h -2 / +2 lines
Lines 83-95 public: a/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.h_sec1
83
    void count(JSC::ExecState*, PassRefPtr<ScriptArguments>);
83
    void count(JSC::ExecState*, PassRefPtr<ScriptArguments>);
84
84
85
protected:
85
protected:
86
    void addConsoleMessage(PassOwnPtr<ConsoleMessage>);
86
    void addConsoleMessage(std::unique_ptr<ConsoleMessage>);
87
87
88
    InjectedScriptManager* m_injectedScriptManager;
88
    InjectedScriptManager* m_injectedScriptManager;
89
    std::unique_ptr<InspectorConsoleFrontendDispatcher> m_frontendDispatcher;
89
    std::unique_ptr<InspectorConsoleFrontendDispatcher> m_frontendDispatcher;
90
    RefPtr<InspectorConsoleBackendDispatcher> m_backendDispatcher;
90
    RefPtr<InspectorConsoleBackendDispatcher> m_backendDispatcher;
91
    ConsoleMessage* m_previousMessage;
91
    ConsoleMessage* m_previousMessage;
92
    Vector<OwnPtr<ConsoleMessage>> m_consoleMessages;
92
    Vector<std::unique_ptr<ConsoleMessage>> m_consoleMessages;
93
    int m_expiredConsoleMessageCount;
93
    int m_expiredConsoleMessageCount;
94
    HashMap<String, unsigned> m_counts;
94
    HashMap<String, unsigned> m_counts;
95
    HashMap<String, double> m_times;
95
    HashMap<String, double> m_times;
- a/Source/WebCore/inspector/CommandLineAPIHost.cpp -3 / +3 lines
Lines 74-80 CommandLineAPIHost::CommandLineAPIHost() a/Source/WebCore/inspector/CommandLineAPIHost.cpp_sec1
74
    , m_databaseAgent(nullptr)
74
    , m_databaseAgent(nullptr)
75
#endif
75
#endif
76
{
76
{
77
    m_defaultInspectableObject = adoptPtr(new InspectableObject);
77
    m_defaultInspectableObject = std::make_unique<InspectableObject>();
78
}
78
}
79
79
80
CommandLineAPIHost::~CommandLineAPIHost()
80
CommandLineAPIHost::~CommandLineAPIHost()
Lines 124-132 Deprecated::ScriptValue CommandLineAPIHost::InspectableObject::get(JSC::ExecStat a/Source/WebCore/inspector/CommandLineAPIHost.cpp_sec2
124
    return Deprecated::ScriptValue();
124
    return Deprecated::ScriptValue();
125
};
125
};
126
126
127
void CommandLineAPIHost::addInspectedObject(PassOwnPtr<CommandLineAPIHost::InspectableObject> object)
127
void CommandLineAPIHost::addInspectedObject(std::unique_ptr<CommandLineAPIHost::InspectableObject> object)
128
{
128
{
129
    m_inspectedObjects.insert(0, object);
129
    m_inspectedObjects.insert(0, std::move(object));
130
    while (m_inspectedObjects.size() > 5)
130
    while (m_inspectedObjects.size() > 5)
131
        m_inspectedObjects.removeLast();
131
        m_inspectedObjects.removeLast();
132
}
132
}
- a/Source/WebCore/inspector/CommandLineAPIHost.h -3 / +3 lines
Lines 92-98 public: a/Source/WebCore/inspector/CommandLineAPIHost.h_sec1
92
        virtual Deprecated::ScriptValue get(JSC::ExecState*);
92
        virtual Deprecated::ScriptValue get(JSC::ExecState*);
93
        virtual ~InspectableObject() { }
93
        virtual ~InspectableObject() { }
94
    };
94
    };
95
    void addInspectedObject(PassOwnPtr<InspectableObject>);
95
    void addInspectedObject(std::unique_ptr<InspectableObject>);
96
    void clearInspectedObjects();
96
    void clearInspectedObjects();
97
    InspectableObject* inspectedObject(unsigned index);
97
    InspectableObject* inspectedObject(unsigned index);
98
    void inspectImpl(PassRefPtr<Inspector::InspectorValue> objectToInspect, PassRefPtr<Inspector::InspectorValue> hints);
98
    void inspectImpl(PassRefPtr<Inspector::InspectorValue> objectToInspect, PassRefPtr<Inspector::InspectorValue> hints);
Lines 115-122 private: a/Source/WebCore/inspector/CommandLineAPIHost.h_sec2
115
    InspectorDatabaseAgent* m_databaseAgent;
115
    InspectorDatabaseAgent* m_databaseAgent;
116
#endif
116
#endif
117
117
118
    Vector<OwnPtr<InspectableObject>> m_inspectedObjects;
118
    Vector<std::unique_ptr<InspectableObject>> m_inspectedObjects;
119
    OwnPtr<InspectableObject> m_defaultInspectableObject;
119
    std::unique_ptr<InspectableObject> m_defaultInspectableObject;
120
};
120
};
121
121
122
} // namespace WebCore
122
} // namespace WebCore
- a/Source/WebCore/inspector/DOMEditor.cpp -15 / +15 lines
Lines 92-98 public: a/Source/WebCore/inspector/DOMEditor.cpp_sec1
92
    virtual bool perform(ExceptionCode& ec) override
92
    virtual bool perform(ExceptionCode& ec) override
93
    {
93
    {
94
        if (m_node->parentNode()) {
94
        if (m_node->parentNode()) {
95
            m_removeChildAction = adoptPtr(new RemoveChildAction(m_node->parentNode(), m_node.get()));
95
            m_removeChildAction = std::make_unique<RemoveChildAction>(m_node->parentNode(), m_node.get());
96
            if (!m_removeChildAction->perform(ec))
96
            if (!m_removeChildAction->perform(ec))
97
                return false;
97
                return false;
98
        }
98
        }
Lines 119-125 private: a/Source/WebCore/inspector/DOMEditor.cpp_sec2
119
    RefPtr<Node> m_parentNode;
119
    RefPtr<Node> m_parentNode;
120
    RefPtr<Node> m_node;
120
    RefPtr<Node> m_node;
121
    RefPtr<Node> m_anchorNode;
121
    RefPtr<Node> m_anchorNode;
122
    OwnPtr<RemoveChildAction> m_removeChildAction;
122
    std::unique_ptr<RemoveChildAction> m_removeChildAction;
123
};
123
};
124
124
125
class DOMEditor::RemoveAttributeAction : public InspectorHistory::Action {
125
class DOMEditor::RemoveAttributeAction : public InspectorHistory::Action {
Lines 208-215 public: a/Source/WebCore/inspector/DOMEditor.cpp_sec3
208
        , m_nextSibling(node.nextSibling())
208
        , m_nextSibling(node.nextSibling())
209
        , m_html(html)
209
        , m_html(html)
210
        , m_newNode(nullptr)
210
        , m_newNode(nullptr)
211
        , m_history(adoptPtr(new InspectorHistory()))
211
        , m_history(std::make_unique<InspectorHistory>())
212
        , m_domEditor(adoptPtr(new DOMEditor(m_history.get())))
212
        , m_domEditor(std::make_unique<DOMEditor>(m_history.get()))
213
    {
213
    {
214
    }
214
    }
215
215
Lines 242-249 private: a/Source/WebCore/inspector/DOMEditor.cpp_sec4
242
    String m_html;
242
    String m_html;
243
    String m_oldHTML;
243
    String m_oldHTML;
244
    Node* m_newNode;
244
    Node* m_newNode;
245
    OwnPtr<InspectorHistory> m_history;
245
    std::unique_ptr<InspectorHistory> m_history;
246
    OwnPtr<DOMEditor> m_domEditor;
246
    std::unique_ptr<DOMEditor> m_domEditor;
247
};
247
};
248
248
249
class DOMEditor::ReplaceWholeTextAction : public InspectorHistory::Action {
249
class DOMEditor::ReplaceWholeTextAction : public InspectorHistory::Action {
Lines 352-380 DOMEditor::~DOMEditor() { } a/Source/WebCore/inspector/DOMEditor.cpp_sec5
352
352
353
bool DOMEditor::insertBefore(Node* parentNode, PassRefPtr<Node> node, Node* anchorNode, ExceptionCode& ec)
353
bool DOMEditor::insertBefore(Node* parentNode, PassRefPtr<Node> node, Node* anchorNode, ExceptionCode& ec)
354
{
354
{
355
    return m_history->perform(adoptPtr(new InsertBeforeAction(parentNode, node, anchorNode)), ec);
355
    return m_history->perform(std::make_unique<InsertBeforeAction>(parentNode, node, anchorNode), ec);
356
}
356
}
357
357
358
bool DOMEditor::removeChild(Node* parentNode, Node* node, ExceptionCode& ec)
358
bool DOMEditor::removeChild(Node* parentNode, Node* node, ExceptionCode& ec)
359
{
359
{
360
    return m_history->perform(adoptPtr(new RemoveChildAction(parentNode, node)), ec);
360
    return m_history->perform(std::make_unique<RemoveChildAction>(parentNode, node), ec);
361
}
361
}
362
362
363
bool DOMEditor::setAttribute(Element* element, const String& name, const String& value, ExceptionCode& ec)
363
bool DOMEditor::setAttribute(Element* element, const String& name, const String& value, ExceptionCode& ec)
364
{
364
{
365
    return m_history->perform(adoptPtr(new SetAttributeAction(element, name, value)), ec);
365
    return m_history->perform(std::make_unique<SetAttributeAction>(element, name, value), ec);
366
}
366
}
367
367
368
bool DOMEditor::removeAttribute(Element* element, const String& name, ExceptionCode& ec)
368
bool DOMEditor::removeAttribute(Element* element, const String& name, ExceptionCode& ec)
369
{
369
{
370
    return m_history->perform(adoptPtr(new RemoveAttributeAction(element, name)), ec);
370
    return m_history->perform(std::make_unique<RemoveAttributeAction>(element, name), ec);
371
}
371
}
372
372
373
bool DOMEditor::setOuterHTML(Node& node, const String& html, Node** newNode, ExceptionCode& ec)
373
bool DOMEditor::setOuterHTML(Node& node, const String& html, Node** newNode, ExceptionCode& ec)
374
{
374
{
375
    OwnPtr<SetOuterHTMLAction> action = adoptPtr(new SetOuterHTMLAction(node, html));
375
    auto action = std::make_unique<SetOuterHTMLAction>(node, html);
376
    SetOuterHTMLAction* rawAction = action.get();
376
    SetOuterHTMLAction* rawAction = action.get();
377
    bool result = m_history->perform(action.release(), ec);
377
    bool result = m_history->perform(std::move(action), ec);
378
    if (result)
378
    if (result)
379
        *newNode = rawAction->newNode();
379
        *newNode = rawAction->newNode();
380
    return result;
380
    return result;
Lines 382-398 bool DOMEditor::setOuterHTML(Node& node, const String& html, Node** newNode, Exc a/Source/WebCore/inspector/DOMEditor.cpp_sec6
382
382
383
bool DOMEditor::replaceWholeText(Text* textNode, const String& text, ExceptionCode& ec)
383
bool DOMEditor::replaceWholeText(Text* textNode, const String& text, ExceptionCode& ec)
384
{
384
{
385
    return m_history->perform(adoptPtr(new ReplaceWholeTextAction(textNode, text)), ec);
385
    return m_history->perform(std::make_unique<ReplaceWholeTextAction>(textNode, text), ec);
386
}
386
}
387
387
388
bool DOMEditor::replaceChild(Node* parentNode, PassRefPtr<Node> newNode, Node* oldNode, ExceptionCode& ec)
388
bool DOMEditor::replaceChild(Node* parentNode, PassRefPtr<Node> newNode, Node* oldNode, ExceptionCode& ec)
389
{
389
{
390
    return m_history->perform(adoptPtr(new ReplaceChildNodeAction(parentNode, newNode, oldNode)), ec);
390
    return m_history->perform(std::make_unique<ReplaceChildNodeAction>(parentNode, newNode, oldNode), ec);
391
}
391
}
392
392
393
bool DOMEditor::setNodeValue(Node* node, const String& value, ExceptionCode& ec)
393
bool DOMEditor::setNodeValue(Node* node, const String& value, ExceptionCode& ec)
394
{
394
{
395
    return m_history->perform(adoptPtr(new SetNodeValueAction(node, value)), ec);
395
    return m_history->perform(std::make_unique<SetNodeValueAction>(node, value), ec);
396
}
396
}
397
397
398
static void populateErrorString(const ExceptionCode& ec, ErrorString* errorString)
398
static void populateErrorString(const ExceptionCode& ec, ErrorString* errorString)
- a/Source/WebCore/inspector/DOMPatchSupport.cpp -14 / +14 lines
Lines 66-72 struct DOMPatchSupport::Digest { a/Source/WebCore/inspector/DOMPatchSupport.cpp_sec1
66
    String m_sha1;
66
    String m_sha1;
67
    String m_attrsSHA1;
67
    String m_attrsSHA1;
68
    Node* m_node;
68
    Node* m_node;
69
    Vector<OwnPtr<Digest>> m_children;
69
    Vector<std::unique_ptr<Digest>> m_children;
70
};
70
};
71
71
72
void DOMPatchSupport::patchDocument(Document* document, const String& markup)
72
void DOMPatchSupport::patchDocument(Document* document, const String& markup)
Lines 105-112 void DOMPatchSupport::patchDocument(const String& markup) a/Source/WebCore/inspector/DOMPatchSupport.cpp_sec2
105
    parser->finish();
105
    parser->finish();
106
    parser->detach();
106
    parser->detach();
107
107
108
    OwnPtr<Digest> oldInfo = createDigest(m_document->documentElement(), nullptr);
108
    std::unique_ptr<Digest> oldInfo = createDigest(m_document->documentElement(), nullptr);
109
    OwnPtr<Digest> newInfo = createDigest(newDocument->documentElement(), &m_unusedNodesMap);
109
    std::unique_ptr<Digest> newInfo = createDigest(newDocument->documentElement(), &m_unusedNodesMap);
110
110
111
    if (!innerPatchNode(oldInfo.get(), newInfo.get(), IGNORE_EXCEPTION)) {
111
    if (!innerPatchNode(oldInfo.get(), newInfo.get(), IGNORE_EXCEPTION)) {
112
        // Fall back to rewrite.
112
        // Fall back to rewrite.
Lines 133-145 Node* DOMPatchSupport::patchNode(Node& node, const String& markup, ExceptionCode a/Source/WebCore/inspector/DOMPatchSupport.cpp_sec3
133
133
134
    // Compose the old list.
134
    // Compose the old list.
135
    ContainerNode* parentNode = node.parentNode();
135
    ContainerNode* parentNode = node.parentNode();
136
    Vector<OwnPtr<Digest>> oldList;
136
    Vector<std::unique_ptr<Digest>> oldList;
137
    for (Node* child = parentNode->firstChild(); child; child = child->nextSibling())
137
    for (Node* child = parentNode->firstChild(); child; child = child->nextSibling())
138
        oldList.append(createDigest(child, nullptr));
138
        oldList.append(createDigest(child, nullptr));
139
139
140
    // Compose the new list.
140
    // Compose the new list.
141
    String markupCopy = markup.lower();
141
    String markupCopy = markup.lower();
142
    Vector<OwnPtr<Digest>> newList;
142
    Vector<std::unique_ptr<Digest>> newList;
143
    for (Node* child = parentNode->firstChild(); child != &node; child = child->nextSibling())
143
    for (Node* child = parentNode->firstChild(); child != &node; child = child->nextSibling())
144
        newList.append(createDigest(child, nullptr));
144
        newList.append(createDigest(child, nullptr));
145
    for (Node* child = fragment->firstChild(); child; child = child->nextSibling()) {
145
    for (Node* child = fragment->firstChild(); child; child = child->nextSibling()) {
Lines 208-214 bool DOMPatchSupport::innerPatchNode(Digest* oldDigest, Digest* newDigest, Excep a/Source/WebCore/inspector/DOMPatchSupport.cpp_sec4
208
}
208
}
209
209
210
std::pair<DOMPatchSupport::ResultMap, DOMPatchSupport::ResultMap>
210
std::pair<DOMPatchSupport::ResultMap, DOMPatchSupport::ResultMap>
211
DOMPatchSupport::diff(const Vector<OwnPtr<Digest>>& oldList, const Vector<OwnPtr<Digest>>& newList)
211
DOMPatchSupport::diff(const Vector<std::unique_ptr<Digest>>& oldList, const Vector<std::unique_ptr<Digest>>& newList)
212
{
212
{
213
    ResultMap newMap(newList.size());
213
    ResultMap newMap(newList.size());
214
    ResultMap oldMap(oldList.size());
214
    ResultMap oldMap(oldList.size());
Lines 295-301 DOMPatchSupport::diff(const Vector<OwnPtr<Digest>>& oldList, const Vector<OwnPtr a/Source/WebCore/inspector/DOMPatchSupport.cpp_sec5
295
    return std::make_pair(oldMap, newMap);
295
    return std::make_pair(oldMap, newMap);
296
}
296
}
297
297
298
bool DOMPatchSupport::innerPatchChildren(ContainerNode* parentNode, const Vector<OwnPtr<Digest>>& oldList, const Vector<OwnPtr<Digest>>& newList, ExceptionCode& ec)
298
bool DOMPatchSupport::innerPatchChildren(ContainerNode* parentNode, const Vector<std::unique_ptr<Digest>>& oldList, const Vector<std::unique_ptr<Digest>>& newList, ExceptionCode& ec)
299
{
299
{
300
    std::pair<ResultMap, ResultMap> resultMaps = diff(oldList, newList);
300
    std::pair<ResultMap, ResultMap> resultMaps = diff(oldList, newList);
301
    ResultMap& oldMap = resultMaps.first;
301
    ResultMap& oldMap = resultMaps.first;
Lines 407-416 static void addStringToSHA1(SHA1& sha1, const String& string) a/Source/WebCore/inspector/DOMPatchSupport.cpp_sec6
407
    sha1.addBytes(reinterpret_cast<const uint8_t*>(cString.data()), cString.length());
407
    sha1.addBytes(reinterpret_cast<const uint8_t*>(cString.data()), cString.length());
408
}
408
}
409
409
410
PassOwnPtr<DOMPatchSupport::Digest> DOMPatchSupport::createDigest(Node* node, UnusedNodesMap* unusedNodesMap)
410
std::unique_ptr<DOMPatchSupport::Digest> DOMPatchSupport::createDigest(Node* node, UnusedNodesMap* unusedNodesMap)
411
{
411
{
412
    Digest* digest = new Digest(node);
412
    auto digest = std::make_unique<Digest>(node);
413
414
    SHA1 sha1;
413
    SHA1 sha1;
415
414
416
    Node::NodeType nodeType = node->nodeType();
415
    Node::NodeType nodeType = node->nodeType();
Lines 421-430 PassOwnPtr<DOMPatchSupport::Digest> DOMPatchSupport::createDigest(Node* node, Un a/Source/WebCore/inspector/DOMPatchSupport.cpp_sec7
421
    if (node->nodeType() == Node::ELEMENT_NODE) {
420
    if (node->nodeType() == Node::ELEMENT_NODE) {
422
        Node* child = node->firstChild();
421
        Node* child = node->firstChild();
423
        while (child) {
422
        while (child) {
424
            OwnPtr<Digest> childInfo = createDigest(child, unusedNodesMap);
423
            std::unique_ptr<Digest> childInfo = createDigest(child, unusedNodesMap);
425
            addStringToSHA1(sha1, childInfo->m_sha1);
424
            addStringToSHA1(sha1, childInfo->m_sha1);
426
            child = child->nextSibling();
425
            child = child->nextSibling();
427
            digest->m_children.append(childInfo.release());
426
            digest->m_children.append(std::move(childInfo));
428
        }
427
        }
429
        Element* element = toElement(node);
428
        Element* element = toElement(node);
430
429
Lines 445-452 PassOwnPtr<DOMPatchSupport::Digest> DOMPatchSupport::createDigest(Node* node, Un a/Source/WebCore/inspector/DOMPatchSupport.cpp_sec8
445
    sha1.computeHash(hash);
444
    sha1.computeHash(hash);
446
    digest->m_sha1 = base64Encode(hash.data(), 10);
445
    digest->m_sha1 = base64Encode(hash.data(), 10);
447
    if (unusedNodesMap)
446
    if (unusedNodesMap)
448
        unusedNodesMap->add(digest->m_sha1, digest);
447
        unusedNodesMap->add(digest->m_sha1, digest.get());
449
    return adoptPtr(digest);
448
449
    return digest;
450
}
450
}
451
451
452
bool DOMPatchSupport::insertBeforeAndMarkAsUsed(ContainerNode* parentNode, Digest* digest, Node* anchor, ExceptionCode& ec)
452
bool DOMPatchSupport::insertBeforeAndMarkAsUsed(ContainerNode* parentNode, Digest* digest, Node* anchor, ExceptionCode& ec)
- a/Source/WebCore/inspector/DOMPatchSupport.h -5 / +3 lines
Lines 34-41 a/Source/WebCore/inspector/DOMPatchSupport.h_sec1
34
#include "ExceptionCode.h"
34
#include "ExceptionCode.h"
35
35
36
#include <wtf/HashMap.h>
36
#include <wtf/HashMap.h>
37
#include <wtf/OwnPtr.h>
38
#include <wtf/PassOwnPtr.h>
39
#include <wtf/Vector.h>
37
#include <wtf/Vector.h>
40
#include <wtf/text/WTFString.h>
38
#include <wtf/text/WTFString.h>
41
39
Lines 65-73 private: a/Source/WebCore/inspector/DOMPatchSupport.h_sec2
65
    typedef HashMap<String, Digest*> UnusedNodesMap;
63
    typedef HashMap<String, Digest*> UnusedNodesMap;
66
64
67
    bool innerPatchNode(Digest* oldNode, Digest* newNode, ExceptionCode&);
65
    bool innerPatchNode(Digest* oldNode, Digest* newNode, ExceptionCode&);
68
    std::pair<ResultMap, ResultMap> diff(const Vector<OwnPtr<Digest>>& oldChildren, const Vector<OwnPtr<Digest>>& newChildren);
66
    std::pair<ResultMap, ResultMap> diff(const Vector<std::unique_ptr<Digest>>& oldChildren, const Vector<std::unique_ptr<Digest>>& newChildren);
69
    bool innerPatchChildren(ContainerNode*, const Vector<OwnPtr<Digest>>& oldChildren, const Vector<OwnPtr<Digest>>& newChildren, ExceptionCode&);
67
    bool innerPatchChildren(ContainerNode*, const Vector<std::unique_ptr<Digest>>& oldChildren, const Vector<std::unique_ptr<Digest>>& newChildren, ExceptionCode&);
70
    PassOwnPtr<Digest> createDigest(Node*, UnusedNodesMap*);
68
    std::unique_ptr<Digest> createDigest(Node*, UnusedNodesMap*);
71
    bool insertBeforeAndMarkAsUsed(ContainerNode*, Digest*, Node* anchor, ExceptionCode&);
69
    bool insertBeforeAndMarkAsUsed(ContainerNode*, Digest*, Node* anchor, ExceptionCode&);
72
    bool removeChildAndMoveToNew(Digest*, ExceptionCode&);
70
    bool removeChildAndMoveToNew(Digest*, ExceptionCode&);
73
    void markNodeAsUsed(Digest*);
71
    void markNodeAsUsed(Digest*);
- a/Source/WebCore/inspector/InspectorApplicationCacheAgent.h -1 lines
Lines 32-38 a/Source/WebCore/inspector/InspectorApplicationCacheAgent.h_sec1
32
#include "InspectorWebBackendDispatchers.h"
32
#include "InspectorWebBackendDispatchers.h"
33
#include "InspectorWebFrontendDispatchers.h"
33
#include "InspectorWebFrontendDispatchers.h"
34
#include <wtf/Noncopyable.h>
34
#include <wtf/Noncopyable.h>
35
#include <wtf/PassOwnPtr.h>
36
35
37
namespace Inspector {
36
namespace Inspector {
38
class InspectorApplicationCacheFrontendDispatcher;
37
class InspectorApplicationCacheFrontendDispatcher;
- a/Source/WebCore/inspector/InspectorCSSAgent.cpp -19 / +19 lines
Lines 165-171 void UpdateRegionLayoutTask::timerFired(Timer<UpdateRegionLayoutTask>&) a/Source/WebCore/inspector/InspectorCSSAgent.cpp_sec1
165
    if (!m_namedFlows.isEmpty() && !m_timer.isActive())
165
    if (!m_namedFlows.isEmpty() && !m_timer.isActive())
166
        m_timer.startOneShot(0);
166
        m_timer.startOneShot(0);
167
}
167
}
168
    
168
169
class ChangeRegionOversetTask {
169
class ChangeRegionOversetTask {
170
public:
170
public:
171
    ChangeRegionOversetTask(InspectorCSSAgent*);
171
    ChangeRegionOversetTask(InspectorCSSAgent*);
Lines 173-179 public: a/Source/WebCore/inspector/InspectorCSSAgent.cpp_sec2
173
    void unschedule(WebKitNamedFlow*);
173
    void unschedule(WebKitNamedFlow*);
174
    void reset();
174
    void reset();
175
    void timerFired(Timer<ChangeRegionOversetTask>&);
175
    void timerFired(Timer<ChangeRegionOversetTask>&);
176
    
176
177
private:
177
private:
178
    InspectorCSSAgent* m_cssAgent;
178
    InspectorCSSAgent* m_cssAgent;
179
    Timer<ChangeRegionOversetTask> m_timer;
179
    Timer<ChangeRegionOversetTask> m_timer;
Lines 189-195 ChangeRegionOversetTask::ChangeRegionOversetTask(InspectorCSSAgent* cssAgent) a/Source/WebCore/inspector/InspectorCSSAgent.cpp_sec3
189
void ChangeRegionOversetTask::scheduleFor(WebKitNamedFlow* namedFlow, int documentNodeId)
189
void ChangeRegionOversetTask::scheduleFor(WebKitNamedFlow* namedFlow, int documentNodeId)
190
{
190
{
191
    m_namedFlows.add(namedFlow, documentNodeId);
191
    m_namedFlows.add(namedFlow, documentNodeId);
192
    
192
193
    if (!m_timer.isActive())
193
    if (!m_timer.isActive())
194
        m_timer.startOneShot(0);
194
        m_timer.startOneShot(0);
195
}
195
}
Lines 266-272 public: a/Source/WebCore/inspector/InspectorCSSAgent.cpp_sec4
266
        return String::format("SetStyleSheetText %s", m_styleSheet->id().utf8().data());
266
        return String::format("SetStyleSheetText %s", m_styleSheet->id().utf8().data());
267
    }
267
    }
268
268
269
    virtual void merge(PassOwnPtr<Action> action) override
269
    virtual void merge(std::unique_ptr<Action> action) override
270
    {
270
    {
271
        ASSERT(action->mergeId() == mergeId());
271
        ASSERT(action->mergeId() == mergeId());
272
272
Lines 310-316 public: a/Source/WebCore/inspector/InspectorCSSAgent.cpp_sec5
310
        return String::format("SetStyleText %s:%u", m_styleSheet->id().utf8().data(), m_cssId.ordinal());
310
        return String::format("SetStyleText %s:%u", m_styleSheet->id().utf8().data(), m_cssId.ordinal());
311
    }
311
    }
312
312
313
    virtual void merge(PassOwnPtr<Action> action) override
313
    virtual void merge(std::unique_ptr<Action> action) override
314
    {
314
    {
315
        ASSERT(action->mergeId() == mergeId());
315
        ASSERT(action->mergeId() == mergeId());
316
316
Lines 369-375 public: a/Source/WebCore/inspector/InspectorCSSAgent.cpp_sec6
369
        return String::format("SetPropertyText %s:%u:%s", m_styleSheet->id().utf8().data(), m_propertyIndex, m_overwrite ? "true" : "false");
369
        return String::format("SetPropertyText %s:%u:%s", m_styleSheet->id().utf8().data(), m_propertyIndex, m_overwrite ? "true" : "false");
370
    }
370
    }
371
371
372
    virtual void merge(PassOwnPtr<Action> action) override
372
    virtual void merge(std::unique_ptr<Action> action) override
373
    {
373
    {
374
        ASSERT(action->mergeId() == mergeId());
374
        ASSERT(action->mergeId() == mergeId());
375
375
Lines 582-588 void InspectorCSSAgent::willRemoveNamedFlow(Document* document, WebKitNamedFlow* a/Source/WebCore/inspector/InspectorCSSAgent.cpp_sec7
582
582
583
    if (m_updateRegionLayoutTask)
583
    if (m_updateRegionLayoutTask)
584
        m_updateRegionLayoutTask->unschedule(namedFlow);
584
        m_updateRegionLayoutTask->unschedule(namedFlow);
585
    
585
586
    if (m_changeRegionOversetTask)
586
    if (m_changeRegionOversetTask)
587
        m_changeRegionOversetTask->unschedule(namedFlow);
587
        m_changeRegionOversetTask->unschedule(namedFlow);
588
588
Lines 596-602 void InspectorCSSAgent::didUpdateRegionLayout(Document* document, WebKitNamedFlo a/Source/WebCore/inspector/InspectorCSSAgent.cpp_sec8
596
        return;
596
        return;
597
597
598
    if (!m_updateRegionLayoutTask)
598
    if (!m_updateRegionLayoutTask)
599
        m_updateRegionLayoutTask = adoptPtr(new UpdateRegionLayoutTask(this));
599
        m_updateRegionLayoutTask = std::make_unique<UpdateRegionLayoutTask>(this);
600
    m_updateRegionLayoutTask->scheduleFor(namedFlow, documentNodeId);
600
    m_updateRegionLayoutTask->scheduleFor(namedFlow, documentNodeId);
601
}
601
}
602
602
Lines 616-624 void InspectorCSSAgent::didChangeRegionOverset(Document* document, WebKitNamedFl a/Source/WebCore/inspector/InspectorCSSAgent.cpp_sec9
616
    int documentNodeId = documentNodeWithRequestedFlowsId(document);
616
    int documentNodeId = documentNodeWithRequestedFlowsId(document);
617
    if (!documentNodeId)
617
    if (!documentNodeId)
618
        return;
618
        return;
619
    
619
620
    if (!m_changeRegionOversetTask)
620
    if (!m_changeRegionOversetTask)
621
        m_changeRegionOversetTask = adoptPtr(new ChangeRegionOversetTask(this));
621
        m_changeRegionOversetTask = std::make_unique<ChangeRegionOversetTask>(this);
622
    m_changeRegionOversetTask->scheduleFor(namedFlow, documentNodeId);
622
    m_changeRegionOversetTask->scheduleFor(namedFlow, documentNodeId);
623
}
623
}
624
624
Lines 626-635 void InspectorCSSAgent::regionOversetChanged(WebKitNamedFlow* namedFlow, int doc a/Source/WebCore/inspector/InspectorCSSAgent.cpp_sec10
626
{
626
{
627
    if (namedFlow->flowState() == WebKitNamedFlow::FlowStateNull)
627
    if (namedFlow->flowState() == WebKitNamedFlow::FlowStateNull)
628
        return;
628
        return;
629
    
629
630
    ErrorString errorString;
630
    ErrorString errorString;
631
    Ref<WebKitNamedFlow> protect(*namedFlow);
631
    Ref<WebKitNamedFlow> protect(*namedFlow);
632
    
632
633
    m_frontendDispatcher->regionOversetChanged(buildObjectForNamedFlow(&errorString, namedFlow, documentNodeId));
633
    m_frontendDispatcher->regionOversetChanged(buildObjectForNamedFlow(&errorString, namedFlow, documentNodeId));
634
}
634
}
635
635
Lines 803-809 void InspectorCSSAgent::setStyleSheetText(ErrorString* errorString, const String a/Source/WebCore/inspector/InspectorCSSAgent.cpp_sec11
803
        return;
803
        return;
804
804
805
    ExceptionCode ec = 0;
805
    ExceptionCode ec = 0;
806
    m_domAgent->history()->perform(adoptPtr(new SetStyleSheetTextAction(inspectorStyleSheet, text)), ec);
806
    m_domAgent->history()->perform(std::make_unique<SetStyleSheetTextAction>(inspectorStyleSheet, text), ec);
807
    *errorString = InspectorDOMAgent::toErrorString(ec);
807
    *errorString = InspectorDOMAgent::toErrorString(ec);
808
}
808
}
809
809
Lines 817-823 void InspectorCSSAgent::setStyleText(ErrorString* errorString, const RefPtr<Insp a/Source/WebCore/inspector/InspectorCSSAgent.cpp_sec12
817
        return;
817
        return;
818
818
819
    ExceptionCode ec = 0;
819
    ExceptionCode ec = 0;
820
    bool success = m_domAgent->history()->perform(adoptPtr(new SetStyleTextAction(inspectorStyleSheet, compoundId, text)), ec);
820
    bool success = m_domAgent->history()->perform(std::make_unique<SetStyleTextAction>(inspectorStyleSheet, compoundId, text), ec);
821
    if (success)
821
    if (success)
822
        result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId));
822
        result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId));
823
    *errorString = InspectorDOMAgent::toErrorString(ec);
823
    *errorString = InspectorDOMAgent::toErrorString(ec);
Lines 833-839 void InspectorCSSAgent::setPropertyText(ErrorString* errorString, const RefPtr<I a/Source/WebCore/inspector/InspectorCSSAgent.cpp_sec13
833
        return;
833
        return;
834
834
835
    ExceptionCode ec = 0;
835
    ExceptionCode ec = 0;
836
    bool success = m_domAgent->history()->perform(adoptPtr(new SetPropertyTextAction(inspectorStyleSheet, compoundId, propertyIndex, text, overwrite)), ec);
836
    bool success = m_domAgent->history()->perform(std::make_unique<SetPropertyTextAction>(inspectorStyleSheet, compoundId, propertyIndex, text, overwrite), ec);
837
    if (success)
837
    if (success)
838
        result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId));
838
        result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId));
839
    *errorString = InspectorDOMAgent::toErrorString(ec);
839
    *errorString = InspectorDOMAgent::toErrorString(ec);
Lines 849-855 void InspectorCSSAgent::toggleProperty(ErrorString* errorString, const RefPtr<In a/Source/WebCore/inspector/InspectorCSSAgent.cpp_sec14
849
        return;
849
        return;
850
850
851
    ExceptionCode ec = 0;
851
    ExceptionCode ec = 0;
852
    bool success = m_domAgent->history()->perform(adoptPtr(new TogglePropertyAction(inspectorStyleSheet, compoundId, propertyIndex, disable)), ec);
852
    bool success = m_domAgent->history()->perform(std::make_unique<TogglePropertyAction>(inspectorStyleSheet, compoundId, propertyIndex, disable), ec);
853
    if (success)
853
    if (success)
854
        result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId));
854
        result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId));
855
    *errorString = InspectorDOMAgent::toErrorString(ec);
855
    *errorString = InspectorDOMAgent::toErrorString(ec);
Lines 865-871 void InspectorCSSAgent::setRuleSelector(ErrorString* errorString, const RefPtr<I a/Source/WebCore/inspector/InspectorCSSAgent.cpp_sec15
865
        return;
865
        return;
866
866
867
    ExceptionCode ec = 0;
867
    ExceptionCode ec = 0;
868
    bool success = m_domAgent->history()->perform(adoptPtr(new SetRuleSelectorAction(inspectorStyleSheet, compoundId, selector)), ec);
868
    bool success = m_domAgent->history()->perform(std::make_unique<SetRuleSelectorAction>(inspectorStyleSheet, compoundId, selector), ec);
869
869
870
    if (success)
870
    if (success)
871
        result = inspectorStyleSheet->buildObjectForRule(inspectorStyleSheet->ruleForId(compoundId));
871
        result = inspectorStyleSheet->buildObjectForRule(inspectorStyleSheet->ruleForId(compoundId));
Lines 885-893 void InspectorCSSAgent::addRule(ErrorString* errorString, const int contextNodeI a/Source/WebCore/inspector/InspectorCSSAgent.cpp_sec16
885
    }
885
    }
886
886
887
    ExceptionCode ec = 0;
887
    ExceptionCode ec = 0;
888
    OwnPtr<AddRuleAction> action = adoptPtr(new AddRuleAction(inspectorStyleSheet, selector));
888
    auto action = std::make_unique<AddRuleAction>(inspectorStyleSheet, selector);
889
    AddRuleAction* rawAction = action.get();
889
    AddRuleAction* rawAction = action.get();
890
    bool success = m_domAgent->history()->perform(action.release(), ec);
890
    bool success = m_domAgent->history()->perform(std::move(action), ec);
891
    if (!success) {
891
    if (!success) {
892
        *errorString = InspectorDOMAgent::toErrorString(ec);
892
        *errorString = InspectorDOMAgent::toErrorString(ec);
893
        return;
893
        return;
- a/Source/WebCore/inspector/InspectorCSSAgent.h -2 / +2 lines
Lines 181-188 private: a/Source/WebCore/inspector/InspectorCSSAgent.h_sec1
181
    DocumentToViaInspectorStyleSheet m_documentToInspectorStyleSheet;
181
    DocumentToViaInspectorStyleSheet m_documentToInspectorStyleSheet;
182
    NodeIdToForcedPseudoState m_nodeIdToForcedPseudoState;
182
    NodeIdToForcedPseudoState m_nodeIdToForcedPseudoState;
183
    HashSet<int> m_namedFlowCollectionsRequested;
183
    HashSet<int> m_namedFlowCollectionsRequested;
184
    OwnPtr<UpdateRegionLayoutTask> m_updateRegionLayoutTask;
184
    std::unique_ptr<UpdateRegionLayoutTask> m_updateRegionLayoutTask;
185
    OwnPtr<ChangeRegionOversetTask> m_changeRegionOversetTask;
185
    std::unique_ptr<ChangeRegionOversetTask> m_changeRegionOversetTask;
186
186
187
    int m_lastStyleSheetId;
187
    int m_lastStyleSheetId;
188
};
188
};
- a/Source/WebCore/inspector/InspectorCanvasAgent.h -1 lines
Lines 39-45 a/Source/WebCore/inspector/InspectorCanvasAgent.h_sec1
39
#include "InspectorWebTypeBuilders.h"
39
#include "InspectorWebTypeBuilders.h"
40
#include "ScriptState.h"
40
#include "ScriptState.h"
41
#include <wtf/HashMap.h>
41
#include <wtf/HashMap.h>
42
#include <wtf/PassOwnPtr.h>
43
#include <wtf/PassRefPtr.h>
42
#include <wtf/PassRefPtr.h>
44
#include <wtf/text/WTFString.h>
43
#include <wtf/text/WTFString.h>
45
44
- a/Source/WebCore/inspector/InspectorDOMAgent.cpp -19 / +18 lines
Lines 96-102 a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec1
96
#include <inspector/InjectedScriptManager.h>
96
#include <inspector/InjectedScriptManager.h>
97
#include <runtime/JSCInlines.h>
97
#include <runtime/JSCInlines.h>
98
#include <wtf/HashSet.h>
98
#include <wtf/HashSet.h>
99
#include <wtf/OwnPtr.h>
100
#include <wtf/Vector.h>
99
#include <wtf/Vector.h>
101
#include <wtf/text/CString.h>
100
#include <wtf/text/CString.h>
102
#include <wtf/text/WTFString.h>
101
#include <wtf/text/WTFString.h>
Lines 236-243 void InspectorDOMAgent::didCreateFrontendAndBackend(Inspector::InspectorFrontend a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec2
236
    m_frontendDispatcher = std::make_unique<InspectorDOMFrontendDispatcher>(frontendChannel);
235
    m_frontendDispatcher = std::make_unique<InspectorDOMFrontendDispatcher>(frontendChannel);
237
    m_backendDispatcher = InspectorDOMBackendDispatcher::create(backendDispatcher, this);
236
    m_backendDispatcher = InspectorDOMBackendDispatcher::create(backendDispatcher, this);
238
237
239
    m_history = adoptPtr(new InspectorHistory());
238
    m_history = std::make_unique<InspectorHistory>();
240
    m_domEditor = adoptPtr(new DOMEditor(m_history.get()));
239
    m_domEditor = std::make_unique<DOMEditor>(m_history.get());
241
240
242
    m_instrumentingAgents->setInspectorDOMAgent(this);
241
    m_instrumentingAgents->setInspectorDOMAgent(this);
243
    m_document = m_pageAgent->mainFrame()->document();
242
    m_document = m_pageAgent->mainFrame()->document();
Lines 251-258 void InspectorDOMAgent::willDestroyFrontendAndBackend(InspectorDisconnectReason) a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec3
251
    m_frontendDispatcher = nullptr;
250
    m_frontendDispatcher = nullptr;
252
    m_backendDispatcher.clear();
251
    m_backendDispatcher.clear();
253
252
254
    m_history.clear();
253
    m_history.reset();
255
    m_domEditor.clear();
254
    m_domEditor.reset();
256
255
257
    ErrorString error;
256
    ErrorString error;
258
    setSearchingForNode(&error, false, 0);
257
    setSearchingForNode(&error, false, 0);
Lines 584-590 int InspectorDOMAgent::pushNodePathToFrontend(Node* nodeToPush) a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec4
584
        Node* parent = innerParentNode(node);
583
        Node* parent = innerParentNode(node);
585
        if (!parent) {
584
        if (!parent) {
586
            // Node being pushed is detached -> push subtree root.
585
            // Node being pushed is detached -> push subtree root.
587
            OwnPtr<NodeToIdMap> newMap = adoptPtr(new NodeToIdMap);
586
            auto newMap = std::make_unique<NodeToIdMap>();
588
            danglingMap = newMap.get();
587
            danglingMap = newMap.get();
589
            m_danglingNodeToIdMaps.append(newMap.release());
588
            m_danglingNodeToIdMaps.append(newMap.release());
590
            RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::DOM::Node>> children = Inspector::TypeBuilder::Array<Inspector::TypeBuilder::DOM::Node>::create();
589
            RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::DOM::Node>> children = Inspector::TypeBuilder::Array<Inspector::TypeBuilder::DOM::Node>::create();
Lines 1032-1045 void InspectorDOMAgent::setSearchingForNode(ErrorString* errorString, bool enabl a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec5
1032
    m_overlay->didSetSearchingForNode(m_searchingForNode);
1031
    m_overlay->didSetSearchingForNode(m_searchingForNode);
1033
}
1032
}
1034
1033
1035
PassOwnPtr<HighlightConfig> InspectorDOMAgent::highlightConfigFromInspectorObject(ErrorString* errorString, InspectorObject* highlightInspectorObject)
1034
std::unique_ptr<HighlightConfig> InspectorDOMAgent::highlightConfigFromInspectorObject(ErrorString* errorString, InspectorObject* highlightInspectorObject)
1036
{
1035
{
1037
    if (!highlightInspectorObject) {
1036
    if (!highlightInspectorObject) {
1038
        *errorString = "Internal error: highlight configuration parameter is missing";
1037
        *errorString = "Internal error: highlight configuration parameter is missing";
1039
        return nullptr;
1038
        return nullptr;
1040
    }
1039
    }
1041
1040
1042
    OwnPtr<HighlightConfig> highlightConfig = adoptPtr(new HighlightConfig());
1041
    auto highlightConfig = std::make_unique<HighlightConfig>();
1043
    bool showInfo = false; // Default: false (do not show a tooltip).
1042
    bool showInfo = false; // Default: false (do not show a tooltip).
1044
    highlightInspectorObject->getBoolean("showInfo", &showInfo);
1043
    highlightInspectorObject->getBoolean("showInfo", &showInfo);
1045
    highlightConfig->showInfo = showInfo;
1044
    highlightConfig->showInfo = showInfo;
Lines 1051-1057 PassOwnPtr<HighlightConfig> InspectorDOMAgent::highlightConfigFromInspectorObjec a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec6
1051
    highlightConfig->padding = parseConfigColor("paddingColor", highlightInspectorObject);
1050
    highlightConfig->padding = parseConfigColor("paddingColor", highlightInspectorObject);
1052
    highlightConfig->border = parseConfigColor("borderColor", highlightInspectorObject);
1051
    highlightConfig->border = parseConfigColor("borderColor", highlightInspectorObject);
1053
    highlightConfig->margin = parseConfigColor("marginColor", highlightInspectorObject);
1052
    highlightConfig->margin = parseConfigColor("marginColor", highlightInspectorObject);
1054
    return highlightConfig.release();
1053
    return highlightConfig;
1055
}
1054
}
1056
1055
1057
void InspectorDOMAgent::setInspectModeEnabled(ErrorString* errorString, bool enabled, const RefPtr<InspectorObject>* highlightConfig)
1056
void InspectorDOMAgent::setInspectModeEnabled(ErrorString* errorString, bool enabled, const RefPtr<InspectorObject>* highlightConfig)
Lines 1061-1087 void InspectorDOMAgent::setInspectModeEnabled(ErrorString* errorString, bool ena a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec7
1061
1060
1062
void InspectorDOMAgent::highlightRect(ErrorString*, int x, int y, int width, int height, const RefPtr<InspectorObject>* color, const RefPtr<InspectorObject>* outlineColor, const bool* usePageCoordinates)
1061
void InspectorDOMAgent::highlightRect(ErrorString*, int x, int y, int width, int height, const RefPtr<InspectorObject>* color, const RefPtr<InspectorObject>* outlineColor, const bool* usePageCoordinates)
1063
{
1062
{
1064
    OwnPtr<FloatQuad> quad = adoptPtr(new FloatQuad(FloatRect(x, y, width, height)));
1063
    auto quad = std::make_unique<FloatQuad>(FloatRect(x, y, width, height));
1065
    innerHighlightQuad(quad.release(), color, outlineColor, usePageCoordinates);
1064
    innerHighlightQuad(std::move(quad), color, outlineColor, usePageCoordinates);
1066
}
1065
}
1067
1066
1068
void InspectorDOMAgent::highlightQuad(ErrorString* errorString, const RefPtr<InspectorArray>& quadArray, const RefPtr<InspectorObject>* color, const RefPtr<InspectorObject>* outlineColor, const bool* usePageCoordinates)
1067
void InspectorDOMAgent::highlightQuad(ErrorString* errorString, const RefPtr<InspectorArray>& quadArray, const RefPtr<InspectorObject>* color, const RefPtr<InspectorObject>* outlineColor, const bool* usePageCoordinates)
1069
{
1068
{
1070
    OwnPtr<FloatQuad> quad = adoptPtr(new FloatQuad());
1069
    auto quad = std::make_unique<FloatQuad>();
1071
    if (!parseQuad(quadArray, quad.get())) {
1070
    if (!parseQuad(quadArray, quad.get())) {
1072
        *errorString = "Invalid Quad format";
1071
        *errorString = "Invalid Quad format";
1073
        return;
1072
        return;
1074
    }
1073
    }
1075
    innerHighlightQuad(quad.release(), color, outlineColor, usePageCoordinates);
1074
    innerHighlightQuad(std::move(quad), color, outlineColor, usePageCoordinates);
1076
}
1075
}
1077
1076
1078
void InspectorDOMAgent::innerHighlightQuad(PassOwnPtr<FloatQuad> quad, const RefPtr<InspectorObject>* color, const RefPtr<InspectorObject>* outlineColor, const bool* usePageCoordinates)
1077
void InspectorDOMAgent::innerHighlightQuad(std::unique_ptr<FloatQuad> quad, const RefPtr<InspectorObject>* color, const RefPtr<InspectorObject>* outlineColor, const bool* usePageCoordinates)
1079
{
1078
{
1080
    OwnPtr<HighlightConfig> highlightConfig = adoptPtr(new HighlightConfig());
1079
    auto highlightConfig = std::make_unique<HighlightConfig>();
1081
    highlightConfig->content = parseColor(color);
1080
    highlightConfig->content = parseColor(color);
1082
    highlightConfig->contentOutline = parseColor(outlineColor);
1081
    highlightConfig->contentOutline = parseColor(outlineColor);
1083
    highlightConfig->usePageCoordinates = usePageCoordinates ? *usePageCoordinates : false;
1082
    highlightConfig->usePageCoordinates = usePageCoordinates ? *usePageCoordinates : false;
1084
    m_overlay->highlightQuad(quad, *highlightConfig);
1083
    m_overlay->highlightQuad(std::move(quad), *highlightConfig);
1085
}
1084
}
1086
1085
1087
void InspectorDOMAgent::highlightNode(ErrorString* errorString, const RefPtr<InspectorObject>& highlightInspectorObject, const int* nodeId, const String* objectId)
1086
void InspectorDOMAgent::highlightNode(ErrorString* errorString, const RefPtr<InspectorObject>& highlightInspectorObject, const int* nodeId, const String* objectId)
Lines 1099-1105 void InspectorDOMAgent::highlightNode(ErrorString* errorString, const RefPtr<Ins a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec8
1099
    if (!node)
1098
    if (!node)
1100
        return;
1099
        return;
1101
1100
1102
    OwnPtr<HighlightConfig> highlightConfig = highlightConfigFromInspectorObject(errorString, highlightInspectorObject.get());
1101
    std::unique_ptr<HighlightConfig> highlightConfig = highlightConfigFromInspectorObject(errorString, highlightInspectorObject.get());
1103
    if (!highlightConfig)
1102
    if (!highlightConfig)
1104
        return;
1103
        return;
1105
1104
Lines 1114-1120 void InspectorDOMAgent::highlightFrame( a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec9
1114
{
1113
{
1115
    Frame* frame = m_pageAgent->frameForId(frameId);
1114
    Frame* frame = m_pageAgent->frameForId(frameId);
1116
    if (frame && frame->ownerElement()) {
1115
    if (frame && frame->ownerElement()) {
1117
        OwnPtr<HighlightConfig> highlightConfig = adoptPtr(new HighlightConfig());
1116
        auto highlightConfig = std::make_unique<HighlightConfig>();
1118
        highlightConfig->showInfo = true; // Always show tooltips for frames.
1117
        highlightConfig->showInfo = true; // Always show tooltips for frames.
1119
        highlightConfig->content = parseColor(color);
1118
        highlightConfig->content = parseColor(color);
1120
        highlightConfig->contentOutline = parseColor(outlineColor);
1119
        highlightConfig->contentOutline = parseColor(outlineColor);
Lines 1642-1648 void InspectorDOMAgent::didInvalidateStyleAttr(Node* node) a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec10
1642
        return;
1641
        return;
1643
1642
1644
    if (!m_revalidateStyleAttrTask)
1643
    if (!m_revalidateStyleAttrTask)
1645
        m_revalidateStyleAttrTask = adoptPtr(new RevalidateStyleAttributeTask(this));
1644
        m_revalidateStyleAttrTask = std::make_unique<RevalidateStyleAttributeTask>(this);
1646
    m_revalidateStyleAttrTask->scheduleFor(toElement(node));
1645
    m_revalidateStyleAttrTask->scheduleFor(toElement(node));
1647
}
1646
}
1648
1647
- a/Source/WebCore/inspector/InspectorDOMAgent.h -9 / +7 lines
Lines 41-48 a/Source/WebCore/inspector/InspectorDOMAgent.h_sec1
41
#include <wtf/Deque.h>
41
#include <wtf/Deque.h>
42
#include <wtf/HashMap.h>
42
#include <wtf/HashMap.h>
43
#include <wtf/HashSet.h>
43
#include <wtf/HashSet.h>
44
#include <wtf/OwnPtr.h>
45
#include <wtf/PassOwnPtr.h>
46
#include <wtf/RefPtr.h>
44
#include <wtf/RefPtr.h>
47
#include <wtf/Vector.h>
45
#include <wtf/Vector.h>
48
#include <wtf/text/AtomicString.h>
46
#include <wtf/text/AtomicString.h>
Lines 213-219 public: a/Source/WebCore/inspector/InspectorDOMAgent.h_sec2
213
211
214
private:
212
private:
215
    void setSearchingForNode(ErrorString*, bool enabled, Inspector::InspectorObject* highlightConfig);
213
    void setSearchingForNode(ErrorString*, bool enabled, Inspector::InspectorObject* highlightConfig);
216
    PassOwnPtr<HighlightConfig> highlightConfigFromInspectorObject(ErrorString*, Inspector::InspectorObject* highlightInspectorObject);
214
    std::unique_ptr<HighlightConfig> highlightConfigFromInspectorObject(ErrorString*, Inspector::InspectorObject* highlightInspectorObject);
217
215
218
    // Node-related methods.
216
    // Node-related methods.
219
    typedef HashMap<RefPtr<Node>, int> NodeToIdMap;
217
    typedef HashMap<RefPtr<Node>, int> NodeToIdMap;
Lines 241-247 private: a/Source/WebCore/inspector/InspectorDOMAgent.h_sec3
241
239
242
    void discardBindings();
240
    void discardBindings();
243
241
244
    void innerHighlightQuad(PassOwnPtr<FloatQuad>, const RefPtr<Inspector::InspectorObject>* color, const RefPtr<Inspector::InspectorObject>* outlineColor, const bool* usePageCoordinates);
242
    void innerHighlightQuad(std::unique_ptr<FloatQuad>, const RefPtr<Inspector::InspectorObject>* color, const RefPtr<Inspector::InspectorObject>* outlineColor, const bool* usePageCoordinates);
245
243
246
    InspectorPageAgent* m_pageAgent;
244
    InspectorPageAgent* m_pageAgent;
247
    Inspector::InjectedScriptManager* m_injectedScriptManager;
245
    Inspector::InjectedScriptManager* m_injectedScriptManager;
Lines 253-259 private: a/Source/WebCore/inspector/InspectorDOMAgent.h_sec4
253
    typedef HashMap<RefPtr<Node>, BackendNodeId> NodeToBackendIdMap;
251
    typedef HashMap<RefPtr<Node>, BackendNodeId> NodeToBackendIdMap;
254
    HashMap<String, NodeToBackendIdMap> m_nodeGroupToBackendIdMap;
252
    HashMap<String, NodeToBackendIdMap> m_nodeGroupToBackendIdMap;
255
    // Owns node mappings for dangling nodes.
253
    // Owns node mappings for dangling nodes.
256
    Vector<OwnPtr<NodeToIdMap>> m_danglingNodeToIdMaps;
254
    Vector<std::unique_ptr<NodeToIdMap>> m_danglingNodeToIdMaps;
257
    HashMap<int, Node*> m_idToNode;
255
    HashMap<int, Node*> m_idToNode;
258
    HashMap<int, NodeToIdMap*> m_idToNodesMap;
256
    HashMap<int, NodeToIdMap*> m_idToNodesMap;
259
    HashSet<int> m_childrenRequested;
257
    HashSet<int> m_childrenRequested;
Lines 263-274 private: a/Source/WebCore/inspector/InspectorDOMAgent.h_sec5
263
    RefPtr<Document> m_document;
261
    RefPtr<Document> m_document;
264
    typedef HashMap<String, Vector<RefPtr<Node>>> SearchResults;
262
    typedef HashMap<String, Vector<RefPtr<Node>>> SearchResults;
265
    SearchResults m_searchResults;
263
    SearchResults m_searchResults;
266
    OwnPtr<RevalidateStyleAttributeTask> m_revalidateStyleAttrTask;
264
    std::unique_ptr<RevalidateStyleAttributeTask> m_revalidateStyleAttrTask;
267
    RefPtr<Node> m_nodeToFocus;
265
    RefPtr<Node> m_nodeToFocus;
268
    bool m_searchingForNode;
266
    bool m_searchingForNode;
269
    OwnPtr<HighlightConfig> m_inspectModeHighlightConfig;
267
    std::unique_ptr<HighlightConfig> m_inspectModeHighlightConfig;
270
    OwnPtr<InspectorHistory> m_history;
268
    std::unique_ptr<InspectorHistory> m_history;
271
    OwnPtr<DOMEditor> m_domEditor;
269
    std::unique_ptr<DOMEditor> m_domEditor;
272
    bool m_suppressAttributeModifiedEvent;
270
    bool m_suppressAttributeModifiedEvent;
273
    bool m_documentRequested;
271
    bool m_documentRequested;
274
};
272
};
- a/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h -1 lines
Lines 37-43 a/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h_sec1
37
#include "InspectorWebBackendDispatchers.h"
37
#include "InspectorWebBackendDispatchers.h"
38
#include <inspector/agents/InspectorDebuggerAgent.h>
38
#include <inspector/agents/InspectorDebuggerAgent.h>
39
#include <wtf/HashMap.h>
39
#include <wtf/HashMap.h>
40
#include <wtf/PassOwnPtr.h>
41
#include <wtf/RefCounted.h>
40
#include <wtf/RefCounted.h>
42
#include <wtf/text/WTFString.h>
41
#include <wtf/text/WTFString.h>
43
42
- a/Source/WebCore/inspector/InspectorDOMStorageAgent.h -1 lines
Lines 33-39 a/Source/WebCore/inspector/InspectorDOMStorageAgent.h_sec1
33
#include "InspectorWebBackendDispatchers.h"
33
#include "InspectorWebBackendDispatchers.h"
34
#include "StorageArea.h"
34
#include "StorageArea.h"
35
#include <wtf/HashMap.h>
35
#include <wtf/HashMap.h>
36
#include <wtf/PassOwnPtr.h>
37
#include <wtf/text/WTFString.h>
36
#include <wtf/text/WTFString.h>
38
37
39
namespace Inspector {
38
namespace Inspector {
- a/Source/WebCore/inspector/InspectorDatabaseAgent.h -1 lines
Lines 35-41 a/Source/WebCore/inspector/InspectorDatabaseAgent.h_sec1
35
#include "InspectorWebBackendDispatchers.h"
35
#include "InspectorWebBackendDispatchers.h"
36
#include "InspectorWebFrontendDispatchers.h"
36
#include "InspectorWebFrontendDispatchers.h"
37
#include <wtf/HashMap.h>
37
#include <wtf/HashMap.h>
38
#include <wtf/PassOwnPtr.h>
39
#include <wtf/text/WTFString.h>
38
#include <wtf/text/WTFString.h>
40
39
41
namespace Inspector {
40
namespace Inspector {
- a/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp -3 / +3 lines
Lines 116-130 void InspectorFrontendClientLocal::Settings::setProperty(const String&, const St a/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp_sec1
116
{
116
{
117
}
117
}
118
118
119
InspectorFrontendClientLocal::InspectorFrontendClientLocal(InspectorController* inspectorController, Page* frontendPage, PassOwnPtr<Settings> settings)
119
InspectorFrontendClientLocal::InspectorFrontendClientLocal(InspectorController* inspectorController, Page* frontendPage, std::unique_ptr<Settings> settings)
120
    : m_inspectorController(inspectorController)
120
    : m_inspectorController(inspectorController)
121
    , m_frontendPage(frontendPage)
121
    , m_frontendPage(frontendPage)
122
    , m_settings(settings)
122
    , m_settings(std::move(settings))
123
    , m_frontendLoaded(false)
123
    , m_frontendLoaded(false)
124
    , m_dockSide(UNDOCKED)
124
    , m_dockSide(UNDOCKED)
125
{
125
{
126
    m_frontendPage->settings().setAllowFileAccessFromFileURLs(true);
126
    m_frontendPage->settings().setAllowFileAccessFromFileURLs(true);
127
    m_dispatchTask = adoptPtr(new InspectorBackendDispatchTask(inspectorController));
127
    m_dispatchTask = std::make_unique<InspectorBackendDispatchTask>(inspectorController);
128
}
128
}
129
129
130
InspectorFrontendClientLocal::~InspectorFrontendClientLocal()
130
InspectorFrontendClientLocal::~InspectorFrontendClientLocal()
- a/Source/WebCore/inspector/InspectorFrontendClientLocal.h -5 / +5 lines
Lines 55-63 public: a/Source/WebCore/inspector/InspectorFrontendClientLocal.h_sec1
55
        virtual void setProperty(const String& name, const String& value);
55
        virtual void setProperty(const String& name, const String& value);
56
    };
56
    };
57
57
58
    InspectorFrontendClientLocal(InspectorController*, Page*, PassOwnPtr<Settings>);
58
    InspectorFrontendClientLocal(InspectorController*, Page*, std::unique_ptr<Settings>);
59
    virtual ~InspectorFrontendClientLocal();
59
    virtual ~InspectorFrontendClientLocal();
60
    
60
61
    virtual void windowObjectCleared() override;
61
    virtual void windowObjectCleared() override;
62
    virtual void frontendLoaded() override;
62
    virtual void frontendLoaded() override;
63
63
Lines 98-104 public: a/Source/WebCore/inspector/InspectorFrontendClientLocal.h_sec2
98
    void showConsole();
98
    void showConsole();
99
99
100
    void showMainResourceForFrame(Frame*);
100
    void showMainResourceForFrame(Frame*);
101
    
101
102
    void showResources();
102
    void showResources();
103
103
104
    void setAttachedWindow(DockSide);
104
    void setAttachedWindow(DockSide);
Lines 117-127 private: a/Source/WebCore/inspector/InspectorFrontendClientLocal.h_sec3
117
    Page* m_frontendPage;
117
    Page* m_frontendPage;
118
    // TODO(yurys): this ref shouldn't be needed.
118
    // TODO(yurys): this ref shouldn't be needed.
119
    RefPtr<InspectorFrontendHost> m_frontendHost;
119
    RefPtr<InspectorFrontendHost> m_frontendHost;
120
    OwnPtr<InspectorFrontendClientLocal::Settings> m_settings;
120
    std::unique_ptr<InspectorFrontendClientLocal::Settings> m_settings;
121
    bool m_frontendLoaded;
121
    bool m_frontendLoaded;
122
    DockSide m_dockSide;
122
    DockSide m_dockSide;
123
    Vector<String> m_evaluateOnLoad;
123
    Vector<String> m_evaluateOnLoad;
124
    OwnPtr<InspectorBackendDispatchTask> m_dispatchTask;
124
    std::unique_ptr<InspectorBackendDispatchTask> m_dispatchTask;
125
};
125
};
126
126
127
} // namespace WebCore
127
} // namespace WebCore
- a/Source/WebCore/inspector/InspectorHeapProfilerAgent.h -1 lines
Lines 39-45 a/Source/WebCore/inspector/InspectorHeapProfilerAgent.h_sec1
39
#include <wtf/Forward.h>
39
#include <wtf/Forward.h>
40
#include <wtf/HashMap.h>
40
#include <wtf/HashMap.h>
41
#include <wtf/Noncopyable.h>
41
#include <wtf/Noncopyable.h>
42
#include <wtf/PassOwnPtr.h>
43
#include <wtf/text/WTFString.h>
42
#include <wtf/text/WTFString.h>
44
43
45
namespace WebCore {
44
namespace WebCore {
- a/Source/WebCore/inspector/InspectorHistory.cpp -5 / +5 lines
Lines 79-85 String InspectorHistory::Action::mergeId() a/Source/WebCore/inspector/InspectorHistory.cpp_sec1
79
    return "";
79
    return "";
80
}
80
}
81
81
82
void InspectorHistory::Action::merge(PassOwnPtr<Action>)
82
void InspectorHistory::Action::merge(std::unique_ptr<Action>)
83
{
83
{
84
}
84
}
85
85
Lines 87-102 InspectorHistory::InspectorHistory() : m_afterLastActionIndex(0) { } a/Source/WebCore/inspector/InspectorHistory.cpp_sec2
87
87
88
InspectorHistory::~InspectorHistory() { }
88
InspectorHistory::~InspectorHistory() { }
89
89
90
bool InspectorHistory::perform(PassOwnPtr<Action> action, ExceptionCode& ec)
90
bool InspectorHistory::perform(std::unique_ptr<Action> action, ExceptionCode& ec)
91
{
91
{
92
    if (!action->perform(ec))
92
    if (!action->perform(ec))
93
        return false;
93
        return false;
94
94
95
    if (!action->mergeId().isEmpty() && m_afterLastActionIndex > 0 && action->mergeId() == m_history[m_afterLastActionIndex - 1]->mergeId())
95
    if (!action->mergeId().isEmpty() && m_afterLastActionIndex > 0 && action->mergeId() == m_history[m_afterLastActionIndex - 1]->mergeId())
96
        m_history[m_afterLastActionIndex - 1]->merge(action);
96
        m_history[m_afterLastActionIndex - 1]->merge(std::move(action));
97
    else {
97
    else {
98
        m_history.resize(m_afterLastActionIndex);
98
        m_history.resize(m_afterLastActionIndex);
99
        m_history.append(action);
99
        m_history.append(std::move(action));
100
        ++m_afterLastActionIndex;
100
        ++m_afterLastActionIndex;
101
    }
101
    }
102
    return true;
102
    return true;
Lines 104-110 bool InspectorHistory::perform(PassOwnPtr<Action> action, ExceptionCode& ec) a/Source/WebCore/inspector/InspectorHistory.cpp_sec3
104
104
105
void InspectorHistory::markUndoableState()
105
void InspectorHistory::markUndoableState()
106
{
106
{
107
    perform(adoptPtr(new UndoableStateMark()), IGNORE_EXCEPTION);
107
    perform(std::make_unique<UndoableStateMark>(), IGNORE_EXCEPTION);
108
}
108
}
109
109
110
bool InspectorHistory::undo(ExceptionCode& ec)
110
bool InspectorHistory::undo(ExceptionCode& ec)
- a/Source/WebCore/inspector/InspectorHistory.h -4 / +3 lines
Lines 33-39 a/Source/WebCore/inspector/InspectorHistory.h_sec1
33
33
34
#include "ExceptionCode.h"
34
#include "ExceptionCode.h"
35
35
36
#include <wtf/OwnPtr.h>
37
#include <wtf/Vector.h>
36
#include <wtf/Vector.h>
38
#include <wtf/text/WTFString.h>
37
#include <wtf/text/WTFString.h>
39
38
Lines 56-62 public: a/Source/WebCore/inspector/InspectorHistory.h_sec2
56
        virtual String toString();
55
        virtual String toString();
57
56
58
        virtual String mergeId();
57
        virtual String mergeId();
59
        virtual void merge(PassOwnPtr<Action>);
58
        virtual void merge(std::unique_ptr<Action>);
60
59
61
        virtual bool perform(ExceptionCode&) = 0;
60
        virtual bool perform(ExceptionCode&) = 0;
62
61
Lines 71-77 public: a/Source/WebCore/inspector/InspectorHistory.h_sec3
71
    InspectorHistory();
70
    InspectorHistory();
72
    virtual ~InspectorHistory();
71
    virtual ~InspectorHistory();
73
72
74
    bool perform(PassOwnPtr<Action>, ExceptionCode&);
73
    bool perform(std::unique_ptr<Action>, ExceptionCode&);
75
    void markUndoableState();
74
    void markUndoableState();
76
75
77
    bool undo(ExceptionCode&);
76
    bool undo(ExceptionCode&);
Lines 79-85 public: a/Source/WebCore/inspector/InspectorHistory.h_sec4
79
    void reset();
78
    void reset();
80
79
81
private:
80
private:
82
    Vector<OwnPtr<Action>> m_history;
81
    Vector<std::unique_ptr<Action>> m_history;
83
    size_t m_afterLastActionIndex;
82
    size_t m_afterLastActionIndex;
84
};
83
};
85
84
- a/Source/WebCore/inspector/InspectorIndexedDBAgent.h -1 lines
Lines 35-41 a/Source/WebCore/inspector/InspectorIndexedDBAgent.h_sec1
35
35
36
#include "InspectorWebAgentBase.h"
36
#include "InspectorWebAgentBase.h"
37
#include "InspectorWebBackendDispatchers.h"
37
#include "InspectorWebBackendDispatchers.h"
38
#include <wtf/PassOwnPtr.h>
39
#include <wtf/text/WTFString.h>
38
#include <wtf/text/WTFString.h>
40
39
41
namespace Inspector {
40
namespace Inspector {
- a/Source/WebCore/inspector/InspectorInputAgent.h -1 lines
Lines 36-42 a/Source/WebCore/inspector/InspectorInputAgent.h_sec1
36
#include "InspectorWebAgentBase.h"
36
#include "InspectorWebAgentBase.h"
37
#include "InspectorWebBackendDispatchers.h"
37
#include "InspectorWebBackendDispatchers.h"
38
#include <wtf/Noncopyable.h>
38
#include <wtf/Noncopyable.h>
39
#include <wtf/PassOwnPtr.h>
40
#include <wtf/text/WTFString.h>
39
#include <wtf/text/WTFString.h>
41
40
42
namespace WebCore {
41
namespace WebCore {
- a/Source/WebCore/inspector/InspectorLayerTreeAgent.h -1 lines
Lines 36-42 a/Source/WebCore/inspector/InspectorLayerTreeAgent.h_sec1
36
#include "InspectorWebFrontendDispatchers.h"
36
#include "InspectorWebFrontendDispatchers.h"
37
#include "InspectorWebTypeBuilders.h"
37
#include "InspectorWebTypeBuilders.h"
38
#include "RenderLayer.h"
38
#include "RenderLayer.h"
39
#include <wtf/PassOwnPtr.h>
40
#include <wtf/PassRefPtr.h>
39
#include <wtf/PassRefPtr.h>
41
#include <wtf/Vector.h>
40
#include <wtf/Vector.h>
42
#include <wtf/text/WTFString.h>
41
#include <wtf/text/WTFString.h>
- a/Source/WebCore/inspector/InspectorMemoryAgent.cpp -2 lines
Lines 49-56 a/Source/WebCore/inspector/InspectorMemoryAgent.cpp_sec1
49
#include <inspector/InspectorValues.h>
49
#include <inspector/InspectorValues.h>
50
#include <runtime/ArrayBufferView.h>
50
#include <runtime/ArrayBufferView.h>
51
#include <wtf/HashSet.h>
51
#include <wtf/HashSet.h>
52
#include <wtf/OwnPtr.h>
53
#include <wtf/PassOwnPtr.h>
54
#include <wtf/Vector.h>
52
#include <wtf/Vector.h>
55
#include <wtf/text/StringBuilder.h>
53
#include <wtf/text/StringBuilder.h>
56
#include <wtf/text/StringImpl.h>
54
#include <wtf/text/StringImpl.h>
- a/Source/WebCore/inspector/InspectorMemoryAgent.h -1 lines
Lines 35-41 a/Source/WebCore/inspector/InspectorMemoryAgent.h_sec1
35
35
36
#include "InspectorWebAgentBase.h"
36
#include "InspectorWebAgentBase.h"
37
#include "InspectorWebBackendDispatchers.h"
37
#include "InspectorWebBackendDispatchers.h"
38
#include <wtf/PassOwnPtr.h>
39
#include <wtf/RefPtr.h>
38
#include <wtf/RefPtr.h>
40
39
41
namespace WebCore {
40
namespace WebCore {
- a/Source/WebCore/inspector/InspectorOverlay.cpp -5 / +5 lines
Lines 280-286 void InspectorOverlay::setPausedInDebuggerMessage(const String* message) a/Source/WebCore/inspector/InspectorOverlay.cpp_sec1
280
void InspectorOverlay::hideHighlight()
280
void InspectorOverlay::hideHighlight()
281
{
281
{
282
    m_highlightNode.clear();
282
    m_highlightNode.clear();
283
    m_highlightQuad.clear();
283
    m_highlightQuad.reset();
284
    update();
284
    update();
285
}
285
}
286
286
Lines 291-303 void InspectorOverlay::highlightNode(Node* node, const HighlightConfig& highligh a/Source/WebCore/inspector/InspectorOverlay.cpp_sec2
291
    update();
291
    update();
292
}
292
}
293
293
294
void InspectorOverlay::highlightQuad(PassOwnPtr<FloatQuad> quad, const HighlightConfig& highlightConfig)
294
void InspectorOverlay::highlightQuad(std::unique_ptr<FloatQuad> quad, const HighlightConfig& highlightConfig)
295
{
295
{
296
    if (m_quadHighlightConfig.usePageCoordinates)
296
    if (m_quadHighlightConfig.usePageCoordinates)
297
        *quad -= m_page.mainFrame().view()->scrollOffset();
297
        *quad -= m_page.mainFrame().view()->scrollOffset();
298
298
299
    m_quadHighlightConfig = highlightConfig;
299
    m_quadHighlightConfig = highlightConfig;
300
    m_highlightQuad = quad;
300
    m_highlightQuad = std::move(quad);
301
    update();
301
    update();
302
}
302
}
303
303
Lines 748-754 Page* InspectorOverlay::overlayPage() a/Source/WebCore/inspector/InspectorOverlay.cpp_sec3
748
748
749
    Page::PageClients pageClients;
749
    Page::PageClients pageClients;
750
    fillWithEmptyClients(pageClients);
750
    fillWithEmptyClients(pageClients);
751
    m_overlayPage = adoptPtr(new Page(pageClients));
751
    m_overlayPage = std::make_unique<Page>(pageClients);
752
752
753
    Settings& settings = m_page.settings();
753
    Settings& settings = m_page.settings();
754
    Settings& overlaySettings = m_overlayPage->settings();
754
    Settings& overlaySettings = m_overlayPage->settings();
Lines 815-821 void InspectorOverlay::evaluateInOverlay(const String& method, PassRefPtr<Inspec a/Source/WebCore/inspector/InspectorOverlay.cpp_sec4
815
815
816
void InspectorOverlay::freePage()
816
void InspectorOverlay::freePage()
817
{
817
{
818
    m_overlayPage.clear();
818
    m_overlayPage.reset();
819
}
819
}
820
820
821
} // namespace WebCore
821
} // namespace WebCore
- a/Source/WebCore/inspector/InspectorOverlay.h -5 / +3 lines
Lines 32-39 a/Source/WebCore/inspector/InspectorOverlay.h_sec1
32
#include "Color.h"
32
#include "Color.h"
33
#include "FloatQuad.h"
33
#include "FloatQuad.h"
34
#include "LayoutRect.h"
34
#include "LayoutRect.h"
35
#include <wtf/OwnPtr.h>
36
#include <wtf/PassOwnPtr.h>
37
#include <wtf/RefPtr.h>
35
#include <wtf/RefPtr.h>
38
#include <wtf/Vector.h>
36
#include <wtf/Vector.h>
39
#include <wtf/text/WTFString.h>
37
#include <wtf/text/WTFString.h>
Lines 117-123 public: a/Source/WebCore/inspector/InspectorOverlay.h_sec2
117
115
118
    void hideHighlight();
116
    void hideHighlight();
119
    void highlightNode(Node*, const HighlightConfig&);
117
    void highlightNode(Node*, const HighlightConfig&);
120
    void highlightQuad(PassOwnPtr<FloatQuad>, const HighlightConfig&);
118
    void highlightQuad(std::unique_ptr<FloatQuad>, const HighlightConfig&);
121
119
122
    Node* highlightedNode() const;
120
    Node* highlightedNode() const;
123
121
Lines 141-148 private: a/Source/WebCore/inspector/InspectorOverlay.h_sec3
141
    String m_pausedInDebuggerMessage;
139
    String m_pausedInDebuggerMessage;
142
    RefPtr<Node> m_highlightNode;
140
    RefPtr<Node> m_highlightNode;
143
    HighlightConfig m_nodeHighlightConfig;
141
    HighlightConfig m_nodeHighlightConfig;
144
    OwnPtr<FloatQuad> m_highlightQuad;
142
    std::unique_ptr<FloatQuad> m_highlightQuad;
145
    OwnPtr<Page> m_overlayPage;
143
    std::unique_ptr<Page> m_overlayPage;
146
    HighlightConfig m_quadHighlightConfig;
144
    HighlightConfig m_quadHighlightConfig;
147
    IntSize m_size;
145
    IntSize m_size;
148
};
146
};
- a/Source/WebCore/inspector/InspectorProfilerAgent.cpp -1 lines
Lines 50-56 a/Source/WebCore/inspector/InspectorProfilerAgent.cpp_sec1
50
#include <inspector/InspectorValues.h>
50
#include <inspector/InspectorValues.h>
51
#include <inspector/agents/InspectorConsoleAgent.h>
51
#include <inspector/agents/InspectorConsoleAgent.h>
52
#include <wtf/CurrentTime.h>
52
#include <wtf/CurrentTime.h>
53
#include <wtf/OwnPtr.h>
54
#include <wtf/text/StringConcatenate.h>
53
#include <wtf/text/StringConcatenate.h>
55
54
56
using namespace Inspector;
55
using namespace Inspector;
- a/Source/WebCore/inspector/InspectorProfilerAgent.h -1 lines
Lines 38-44 a/Source/WebCore/inspector/InspectorProfilerAgent.h_sec1
38
#include <wtf/Forward.h>
38
#include <wtf/Forward.h>
39
#include <wtf/HashMap.h>
39
#include <wtf/HashMap.h>
40
#include <wtf/Noncopyable.h>
40
#include <wtf/Noncopyable.h>
41
#include <wtf/PassOwnPtr.h>
42
#include <wtf/text/WTFString.h>
41
#include <wtf/text/WTFString.h>
43
42
44
namespace Inspector {
43
namespace Inspector {
- a/Source/WebCore/inspector/InspectorResourceAgent.cpp -1 / +1 lines
Lines 643-649 InspectorResourceAgent::InspectorResourceAgent(InstrumentingAgents* instrumentin a/Source/WebCore/inspector/InspectorResourceAgent.cpp_sec1
643
    : InspectorAgentBase(ASCIILiteral("Network"), instrumentingAgents)
643
    : InspectorAgentBase(ASCIILiteral("Network"), instrumentingAgents)
644
    , m_pageAgent(pageAgent)
644
    , m_pageAgent(pageAgent)
645
    , m_client(client)
645
    , m_client(client)
646
    , m_resourcesData(adoptPtr(new NetworkResourcesData()))
646
    , m_resourcesData(std::make_unique<NetworkResourcesData>())
647
    , m_enabled(false)
647
    , m_enabled(false)
648
    , m_cacheDisabled(false)
648
    , m_cacheDisabled(false)
649
    , m_loadingXHRSynchronously(false)
649
    , m_loadingXHRSynchronously(false)
- a/Source/WebCore/inspector/InspectorResourceAgent.h -2 / +1 lines
Lines 34-40 a/Source/WebCore/inspector/InspectorResourceAgent.h_sec1
34
#include "InspectorWebAgentBase.h"
34
#include "InspectorWebAgentBase.h"
35
#include "InspectorWebBackendDispatchers.h"
35
#include "InspectorWebBackendDispatchers.h"
36
#include "InspectorWebFrontendDispatchers.h"
36
#include "InspectorWebFrontendDispatchers.h"
37
#include <wtf/PassOwnPtr.h>
38
#include <wtf/RefCounted.h>
37
#include <wtf/RefCounted.h>
39
#include <wtf/Vector.h>
38
#include <wtf/Vector.h>
40
#include <wtf/text/WTFString.h>
39
#include <wtf/text/WTFString.h>
Lines 145-151 private: a/Source/WebCore/inspector/InspectorResourceAgent.h_sec2
145
    InspectorClient* m_client;
144
    InspectorClient* m_client;
146
    std::unique_ptr<Inspector::InspectorNetworkFrontendDispatcher> m_frontendDispatcher;
145
    std::unique_ptr<Inspector::InspectorNetworkFrontendDispatcher> m_frontendDispatcher;
147
    RefPtr<Inspector::InspectorNetworkBackendDispatcher> m_backendDispatcher;
146
    RefPtr<Inspector::InspectorNetworkBackendDispatcher> m_backendDispatcher;
148
    OwnPtr<NetworkResourcesData> m_resourcesData;
147
    std::unique_ptr<NetworkResourcesData> m_resourcesData;
149
    bool m_enabled;
148
    bool m_enabled;
150
    bool m_cacheDisabled;
149
    bool m_cacheDisabled;
151
    bool m_loadingXHRSynchronously;
150
    bool m_loadingXHRSynchronously;
- a/Source/WebCore/inspector/InspectorStyleSheet.cpp -16 / +14 lines
Lines 58-65 a/Source/WebCore/inspector/InspectorStyleSheet.cpp_sec1
58
#include "WebKitCSSKeyframesRule.h"
58
#include "WebKitCSSKeyframesRule.h"
59
#include <inspector/ContentSearchUtilities.h>
59
#include <inspector/ContentSearchUtilities.h>
60
#include <inspector/InspectorValues.h>
60
#include <inspector/InspectorValues.h>
61
#include <wtf/OwnPtr.h>
62
#include <wtf/PassOwnPtr.h>
63
#include <wtf/Vector.h>
61
#include <wtf/Vector.h>
64
#include <wtf/text/StringBuilder.h>
62
#include <wtf/text/StringBuilder.h>
65
#include <yarr/RegularExpression.h>
63
#include <yarr/RegularExpression.h>
Lines 77-91 public: a/Source/WebCore/inspector/InspectorStyleSheet.cpp_sec2
77
    void setText(const String& text);
75
    void setText(const String& text);
78
    bool hasText() const { return m_hasText; }
76
    bool hasText() const { return m_hasText; }
79
    RuleSourceDataList* sourceData() const { return m_sourceData.get(); }
77
    RuleSourceDataList* sourceData() const { return m_sourceData.get(); }
80
    void setSourceData(PassOwnPtr<RuleSourceDataList>);
78
    void setSourceData(std::unique_ptr<RuleSourceDataList>);
81
    bool hasSourceData() const { return m_sourceData; }
79
    bool hasSourceData() const { return m_sourceData != nullptr; }
82
    PassRefPtr<WebCore::CSSRuleSourceData> ruleSourceDataAt(unsigned) const;
80
    PassRefPtr<WebCore::CSSRuleSourceData> ruleSourceDataAt(unsigned) const;
83
81
84
private:
82
private:
85
83
86
    String m_text;
84
    String m_text;
87
    bool m_hasText;
85
    bool m_hasText;
88
    OwnPtr<RuleSourceDataList> m_sourceData;
86
    std::unique_ptr<RuleSourceDataList> m_sourceData;
89
};
87
};
90
88
91
ParsedStyleSheet::ParsedStyleSheet()
89
ParsedStyleSheet::ParsedStyleSheet()
Lines 115-128 static void flattenSourceData(RuleSourceDataList* dataList, RuleSourceDataList* a/Source/WebCore/inspector/InspectorStyleSheet.cpp_sec3
115
    }
113
    }
116
}
114
}
117
115
118
void ParsedStyleSheet::setSourceData(PassOwnPtr<RuleSourceDataList> sourceData)
116
void ParsedStyleSheet::setSourceData(std::unique_ptr<RuleSourceDataList> sourceData)
119
{
117
{
120
    if (!sourceData) {
118
    if (!sourceData) {
121
        m_sourceData.clear();
119
        m_sourceData.reset();
122
        return;
120
        return;
123
    }
121
    }
124
122
125
    m_sourceData = adoptPtr(new RuleSourceDataList());
123
    m_sourceData = std::make_unique<RuleSourceDataList>();
126
124
127
    // FIXME: This is a temporary solution to retain the original flat sourceData structure
125
    // FIXME: This is a temporary solution to retain the original flat sourceData structure
128
    // containing only style rules, even though CSSParser now provides the full rule source data tree.
126
    // containing only style rules, even though CSSParser now provides the full rule source data tree.
Lines 284-292 static void fillMediaListChain(CSSRule* rule, Array<Inspector::TypeBuilder::CSS: a/Source/WebCore/inspector/InspectorStyleSheet.cpp_sec4
284
    }
282
    }
285
}
283
}
286
284
287
static PassOwnPtr<CSSParser> createCSSParser(Document* document)
285
static std::unique_ptr<CSSParser> createCSSParser(Document* document)
288
{
286
{
289
    return adoptPtr(new CSSParser(document ? CSSParserContext(*document) : strictCSSParserContext()));
287
    return std::make_unique<CSSParser>(document ? CSSParserContext(*document) : strictCSSParserContext());
290
}
288
}
291
289
292
PassRefPtr<InspectorStyle> InspectorStyle::create(const InspectorCSSId& styleId, PassRefPtr<CSSStyleDeclaration> style, InspectorStyleSheet* parentStyleSheet)
290
PassRefPtr<InspectorStyle> InspectorStyle::create(const InspectorCSSId& styleId, PassRefPtr<CSSStyleDeclaration> style, InspectorStyleSheet* parentStyleSheet)
Lines 521-527 PassRefPtr<Inspector::TypeBuilder::CSS::CSSStyle> InspectorStyle::styleWithPrope a/Source/WebCore/inspector/InspectorStyleSheet.cpp_sec5
521
    HashSet<String> foundShorthands;
519
    HashSet<String> foundShorthands;
522
    String previousPriority;
520
    String previousPriority;
523
    String previousStatus;
521
    String previousStatus;
524
    OwnPtr<Vector<size_t>> lineEndings(m_parentStyleSheet ? m_parentStyleSheet->lineEndings() : PassOwnPtr<Vector<size_t>>());
522
    std::unique_ptr<Vector<size_t>> lineEndings(m_parentStyleSheet ? m_parentStyleSheet->lineEndings() : nullptr);
525
    RefPtr<CSSRuleSourceData> sourceData = extractSourceData();
523
    RefPtr<CSSRuleSourceData> sourceData = extractSourceData();
526
    unsigned ruleBodyRangeStart = sourceData ? sourceData->ruleBodyRange.start : 0;
524
    unsigned ruleBodyRangeStart = sourceData ? sourceData->ruleBodyRange.start : 0;
527
525
Lines 1211-1220 RefPtr<CSSRuleSourceData> InspectorStyleSheet::ruleSourceDataFor(CSSStyleDeclara a/Source/WebCore/inspector/InspectorStyleSheet.cpp_sec6
1211
    return m_parsedStyleSheet->ruleSourceDataAt(ruleIndexByStyle(style));
1209
    return m_parsedStyleSheet->ruleSourceDataAt(ruleIndexByStyle(style));
1212
}
1210
}
1213
1211
1214
PassOwnPtr<Vector<size_t>> InspectorStyleSheet::lineEndings() const
1212
std::unique_ptr<Vector<size_t>> InspectorStyleSheet::lineEndings() const
1215
{
1213
{
1216
    if (!m_parsedStyleSheet->hasText())
1214
    if (!m_parsedStyleSheet->hasText())
1217
        return PassOwnPtr<Vector<size_t>>();
1215
        return nullptr;
1218
    return ContentSearchUtilities::lineEndings(m_parsedStyleSheet->text());
1216
    return ContentSearchUtilities::lineEndings(m_parsedStyleSheet->text());
1219
}
1217
}
1220
1218
Lines 1270-1278 bool InspectorStyleSheet::ensureSourceData() a/Source/WebCore/inspector/InspectorStyleSheet.cpp_sec7
1270
        return false;
1268
        return false;
1271
1269
1272
    RefPtr<StyleSheetContents> newStyleSheet = StyleSheetContents::create();
1270
    RefPtr<StyleSheetContents> newStyleSheet = StyleSheetContents::create();
1273
    OwnPtr<RuleSourceDataList> ruleSourceDataResult = adoptPtr(new RuleSourceDataList());
1271
    auto ruleSourceDataResult = std::make_unique<RuleSourceDataList>();
1274
    createCSSParser(m_pageStyleSheet->ownerDocument())->parseSheet(newStyleSheet.get(), m_parsedStyleSheet->text(), 0, ruleSourceDataResult.get());
1272
    createCSSParser(m_pageStyleSheet->ownerDocument())->parseSheet(newStyleSheet.get(), m_parsedStyleSheet->text(), 0, ruleSourceDataResult.get());
1275
    m_parsedStyleSheet->setSourceData(ruleSourceDataResult.release());
1273
    m_parsedStyleSheet->setSourceData(std::move(ruleSourceDataResult));
1276
    return m_parsedStyleSheet->hasSourceData();
1274
    return m_parsedStyleSheet->hasSourceData();
1277
}
1275
}
1278
1276
Lines 1476-1482 bool InspectorStyleSheetForInlineStyle::setStyleText(CSSStyleDeclaration* style, a/Source/WebCore/inspector/InspectorStyleSheet.cpp_sec8
1476
    return !ec;
1474
    return !ec;
1477
}
1475
}
1478
1476
1479
PassOwnPtr<Vector<size_t>> InspectorStyleSheetForInlineStyle::lineEndings() const
1477
std::unique_ptr<Vector<size_t>> InspectorStyleSheetForInlineStyle::lineEndings() const
1480
{
1478
{
1481
    return ContentSearchUtilities::lineEndings(elementStyleText());
1479
    return ContentSearchUtilities::lineEndings(elementStyleText());
1482
}
1480
}
- a/Source/WebCore/inspector/InspectorStyleSheet.h -2 / +2 lines
Lines 226-232 protected: a/Source/WebCore/inspector/InspectorStyleSheet.h_sec1
226
226
227
    // Also accessed by friend class InspectorStyle.
227
    // Also accessed by friend class InspectorStyle.
228
    virtual bool setStyleText(CSSStyleDeclaration*, const String&, ExceptionCode&);
228
    virtual bool setStyleText(CSSStyleDeclaration*, const String&, ExceptionCode&);
229
    virtual PassOwnPtr<Vector<size_t>> lineEndings() const;
229
    virtual std::unique_ptr<Vector<size_t>> lineEndings() const;
230
230
231
private:
231
private:
232
    typedef Vector<RefPtr<CSSStyleRule>> CSSStyleRuleVector;
232
    typedef Vector<RefPtr<CSSStyleRule>> CSSStyleRuleVector;
Lines 278-284 protected: a/Source/WebCore/inspector/InspectorStyleSheet.h_sec2
278
278
279
    // Also accessed by friend class InspectorStyle.
279
    // Also accessed by friend class InspectorStyle.
280
    virtual bool setStyleText(CSSStyleDeclaration*, const String&, ExceptionCode&) override;
280
    virtual bool setStyleText(CSSStyleDeclaration*, const String&, ExceptionCode&) override;
281
    virtual PassOwnPtr<Vector<size_t>> lineEndings() const override;
281
    virtual std::unique_ptr<Vector<size_t>> lineEndings() const override;
282
282
283
private:
283
private:
284
    CSSStyleDeclaration* inlineStyle() const;
284
    CSSStyleDeclaration* inlineStyle() const;
- a/Source/WebCore/inspector/InspectorTimelineAgent.h -1 lines
Lines 38-44 a/Source/WebCore/inspector/InspectorTimelineAgent.h_sec1
38
#include "InspectorWebFrontendDispatchers.h"
38
#include "InspectorWebFrontendDispatchers.h"
39
#include "LayoutRect.h"
39
#include "LayoutRect.h"
40
#include <inspector/InspectorValues.h>
40
#include <inspector/InspectorValues.h>
41
#include <wtf/PassOwnPtr.h>
42
#include <wtf/Vector.h>
41
#include <wtf/Vector.h>
43
#include <wtf/WeakPtr.h>
42
#include <wtf/WeakPtr.h>
44
43
- a/Source/WebCore/inspector/InspectorWorkerAgent.cpp -1 lines
Lines 40-46 a/Source/WebCore/inspector/InspectorWorkerAgent.cpp_sec1
40
#include "URL.h"
40
#include "URL.h"
41
#include "WorkerGlobalScopeProxy.h"
41
#include "WorkerGlobalScopeProxy.h"
42
#include <inspector/InspectorValues.h>
42
#include <inspector/InspectorValues.h>
43
#include <wtf/PassOwnPtr.h>
44
#include <wtf/RefPtr.h>
43
#include <wtf/RefPtr.h>
45
44
46
using namespace Inspector;
45
using namespace Inspector;
- a/Source/WebCore/inspector/PageConsoleAgent.cpp -1 / +1 lines
Lines 75-81 void PageConsoleAgent::addInspectedNode(ErrorString* errorString, int nodeId) a/Source/WebCore/inspector/PageConsoleAgent.cpp_sec1
75
    }
75
    }
76
76
77
    if (CommandLineAPIHost* commandLineAPIHost = static_cast<PageInjectedScriptManager*>(m_injectedScriptManager)->commandLineAPIHost())
77
    if (CommandLineAPIHost* commandLineAPIHost = static_cast<PageInjectedScriptManager*>(m_injectedScriptManager)->commandLineAPIHost())
78
        commandLineAPIHost->addInspectedObject(adoptPtr(new InspectableNode(node)));
78
        commandLineAPIHost->addInspectedObject(std::make_unique<InspectableNode>(node));
79
}
79
}
80
80
81
} // namespace WebCore
81
} // namespace WebCore
- a/Source/WebCore/inspector/PageRuntimeAgent.h -1 lines
Lines 35-41 a/Source/WebCore/inspector/PageRuntimeAgent.h_sec1
35
35
36
#include <inspector/InspectorJSFrontendDispatchers.h>
36
#include <inspector/InspectorJSFrontendDispatchers.h>
37
#include <inspector/agents/InspectorRuntimeAgent.h>
37
#include <inspector/agents/InspectorRuntimeAgent.h>
38
#include <wtf/PassOwnPtr.h>
39
38
40
namespace JSC {
39
namespace JSC {
41
class ExecState;
40
class ExecState;
- a/Source/WebCore/inspector/WebConsoleAgent.cpp -1 / +1 lines
Lines 131-137 private: a/Source/WebCore/inspector/WebConsoleAgent.cpp_sec1
131
void WebConsoleAgent::addInspectedHeapObject(ErrorString*, int inspectedHeapObjectId)
131
void WebConsoleAgent::addInspectedHeapObject(ErrorString*, int inspectedHeapObjectId)
132
{
132
{
133
    if (CommandLineAPIHost* commandLineAPIHost = static_cast<PageInjectedScriptManager*>(m_injectedScriptManager)->commandLineAPIHost())
133
    if (CommandLineAPIHost* commandLineAPIHost = static_cast<PageInjectedScriptManager*>(m_injectedScriptManager)->commandLineAPIHost())
134
        commandLineAPIHost->addInspectedObject(adoptPtr(new InspectableHeapObject(inspectedHeapObjectId)));
134
        commandLineAPIHost->addInspectedObject(std::make_unique<InspectableHeapObject>(inspectedHeapObjectId));
135
}
135
}
136
136
137
} // namespace WebCore
137
} // namespace WebCore
- a/Source/WebCore/inspector/WorkerRuntimeAgent.h -1 lines
Lines 34-40 a/Source/WebCore/inspector/WorkerRuntimeAgent.h_sec1
34
#if ENABLE(INSPECTOR)
34
#if ENABLE(INSPECTOR)
35
35
36
#include <inspector/agents/InspectorRuntimeAgent.h>
36
#include <inspector/agents/InspectorRuntimeAgent.h>
37
#include <wtf/PassOwnPtr.h>
38
37
39
namespace WebCore {
38
namespace WebCore {
40
39
- a/Source/WebCore/testing/Internals.cpp -1 / +1 lines
Lines 194-200 protected: a/Source/WebCore/testing/Internals.cpp_sec1
194
};
194
};
195
195
196
InspectorFrontendClientDummy::InspectorFrontendClientDummy(InspectorController* controller, Page* page)
196
InspectorFrontendClientDummy::InspectorFrontendClientDummy(InspectorController* controller, Page* page)
197
    : InspectorFrontendClientLocal(controller, page, adoptPtr(new InspectorFrontendClientLocal::Settings()))
197
    : InspectorFrontendClientLocal(controller, page, std::make_unique<InspectorFrontendClientLocal::Settings>())
198
{
198
{
199
}
199
}
200
200
- a/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp -1 / +1 lines
Lines 41-47 using namespace WebCore; a/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp_sec1
41
namespace WebKit {
41
namespace WebKit {
42
42
43
WebInspectorFrontendClient::WebInspectorFrontendClient(WebPage* page, WebPage* inspectorPage)
43
WebInspectorFrontendClient::WebInspectorFrontendClient(WebPage* page, WebPage* inspectorPage)
44
    : InspectorFrontendClientLocal(&page->corePage()->inspectorController(), inspectorPage->corePage(), adoptPtr(new Settings()))
44
    : InspectorFrontendClientLocal(&page->corePage()->inspectorController(), inspectorPage->corePage(), std::make_unique<Settings>())
45
    , m_page(page)
45
    , m_page(page)
46
{
46
{
47
}
47
}

Return to Bug 128681