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

Unified Diff: third_party/WebKit/Source/core/html/forms/FormController.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/html/forms/FormController.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/FormController.cpp b/third_party/WebKit/Source/core/html/forms/FormController.cpp
index 558ada8e8643ecfe6bd395117521aede6717fbae..e28c74de0667c4fedec6f9f2d162cf2ef23f7748 100644
--- a/third_party/WebKit/Source/core/html/forms/FormController.cpp
+++ b/third_party/WebKit/Source/core/html/forms/FormController.cpp
@@ -26,9 +26,7 @@
#include "platform/FileChooser.h"
#include "wtf/Deque.h"
#include "wtf/HashTableDeletedValueType.h"
-#include "wtf/PtrUtil.h"
#include "wtf/text/StringBuilder.h"
-#include <memory>
namespace blink {
@@ -178,8 +176,8 @@ class SavedFormState {
USING_FAST_MALLOC(SavedFormState);
public:
- static std::unique_ptr<SavedFormState> create();
- static std::unique_ptr<SavedFormState> deserialize(const Vector<String>&, size_t& index);
+ static PassOwnPtr<SavedFormState> create();
+ static PassOwnPtr<SavedFormState> deserialize(const Vector<String>&, size_t& index);
void serializeTo(Vector<String>&) const;
bool isEmpty() const { return m_stateForNewFormElements.isEmpty(); }
void appendControlState(const AtomicString& name, const AtomicString& type, const FormControlState&);
@@ -195,9 +193,9 @@ private:
size_t m_controlStateCount;
};
-std::unique_ptr<SavedFormState> SavedFormState::create()
+PassOwnPtr<SavedFormState> SavedFormState::create()
{
- return wrapUnique(new SavedFormState);
+ return adoptPtr(new SavedFormState);
}
static bool isNotFormControlTypeCharacter(UChar ch)
@@ -205,7 +203,7 @@ static bool isNotFormControlTypeCharacter(UChar ch)
return ch != '-' && (ch > 'z' || ch < 'a');
}
-std::unique_ptr<SavedFormState> SavedFormState::deserialize(const Vector<String>& stateVector, size_t& index)
+PassOwnPtr<SavedFormState> SavedFormState::deserialize(const Vector<String>& stateVector, size_t& index)
{
if (index >= stateVector.size())
return nullptr;
@@ -213,7 +211,7 @@ std::unique_ptr<SavedFormState> SavedFormState::deserialize(const Vector<String>
size_t itemCount = stateVector[index++].toUInt();
if (!itemCount)
return nullptr;
- std::unique_ptr<SavedFormState> savedFormState = wrapUnique(new SavedFormState);
+ OwnPtr<SavedFormState> savedFormState = adoptPtr(new SavedFormState);
while (itemCount--) {
if (index + 1 >= stateVector.size())
return nullptr;
@@ -413,7 +411,7 @@ static String formStateSignature()
Vector<String> DocumentState::toStateVector()
{
FormKeyGenerator* keyGenerator = FormKeyGenerator::create();
- std::unique_ptr<SavedFormStateMap> stateMap = wrapUnique(new SavedFormStateMap);
+ OwnPtr<SavedFormStateMap> stateMap = adoptPtr(new SavedFormStateMap);
for (const auto& formControl : m_formControls) {
HTMLFormControlElementWithState* control = formControl.get();
ASSERT(control->inShadowIncludingDocument());
@@ -490,7 +488,7 @@ void FormController::formStatesFromStateVector(const Vector<String>& stateVector
while (i + 1 < stateVector.size()) {
AtomicString formKey = AtomicString(stateVector[i++]);
- std::unique_ptr<SavedFormState> state = SavedFormState::deserialize(stateVector, i);
+ OwnPtr<SavedFormState> state = SavedFormState::deserialize(stateVector, i);
if (!state) {
i = 0;
break;

Powered by Google App Engine
This is Rietveld 408576698