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

Unified Diff: third_party/WebKit/Source/core/css/CSSSelectorList.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/CSSSelectorList.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSSelectorList.cpp b/third_party/WebKit/Source/core/css/CSSSelectorList.cpp
index 01544222a9f4c6edcf81c512cd93dd8de1cdfbb2..541104dab0c342f5b8dd0bfb1bb2d838842860f0 100644
--- a/third_party/WebKit/Source/core/css/CSSSelectorList.cpp
+++ b/third_party/WebKit/Source/core/css/CSSSelectorList.cpp
@@ -29,7 +29,6 @@
#include "core/css/parser/CSSParserSelector.h"
#include "wtf/allocator/Partitions.h"
#include "wtf/text/StringBuilder.h"
-#include <memory>
namespace {
// CSSSelector is one of the top types that consume renderer memory,
@@ -53,7 +52,7 @@ CSSSelectorList CSSSelectorList::copy() const
return list;
}
-CSSSelectorList CSSSelectorList::adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectorVector)
+CSSSelectorList CSSSelectorList::adoptSelectorVector(Vector<OwnPtr<CSSParserSelector>>& selectorVector)
{
size_t flattenedSize = 0;
for (size_t i = 0; i < selectorVector.size(); ++i) {
@@ -69,7 +68,7 @@ CSSSelectorList CSSSelectorList::adoptSelectorVector(Vector<std::unique_ptr<CSSP
CSSParserSelector* current = selectorVector[i].get();
while (current) {
// Move item from the parser selector vector into m_selectorArray without invoking destructor (Ugh.)
- CSSSelector* currentSelector = current->releaseSelector().release();
+ CSSSelector* currentSelector = current->releaseSelector().leakPtr();
memcpy(&list.m_selectorArray[arrayIndex], currentSelector, sizeof(CSSSelector));
WTF::Partitions::fastFree(currentSelector);
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSSelectorList.h ('k') | third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698