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

Unified Diff: third_party/WebKit/Source/core/html/forms/InputType.cpp

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. 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/InputType.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/InputType.cpp b/third_party/WebKit/Source/core/html/forms/InputType.cpp
index 4144964b1bafe54d316c233652aa570ba3f01c52..ebd6b063070d5def7a87c8ed0fe7077e7aaa6710 100644
--- a/third_party/WebKit/Source/core/html/forms/InputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/InputType.cpp
@@ -71,6 +71,8 @@
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/text/PlatformLocale.h"
#include "platform/text/TextBreakIterator.h"
+#include "wtf/PtrUtil.h"
+#include <memory>
namespace blink {
@@ -80,9 +82,9 @@ using namespace HTMLNames;
using InputTypeFactoryFunction = InputType* (*)(HTMLInputElement&);
using InputTypeFactoryMap = HashMap<AtomicString, InputTypeFactoryFunction, CaseFoldingHash>;
-static PassOwnPtr<InputTypeFactoryMap> createInputTypeFactoryMap()
+static std::unique_ptr<InputTypeFactoryMap> createInputTypeFactoryMap()
{
- OwnPtr<InputTypeFactoryMap> map = adoptPtr(new InputTypeFactoryMap);
+ std::unique_ptr<InputTypeFactoryMap> map = wrapUnique(new InputTypeFactoryMap);
map->add(InputTypeNames::button, ButtonInputType::create);
map->add(InputTypeNames::checkbox, CheckboxInputType::create);
map->add(InputTypeNames::color, ColorInputType::create);
@@ -110,7 +112,7 @@ static PassOwnPtr<InputTypeFactoryMap> createInputTypeFactoryMap()
static const InputTypeFactoryMap* factoryMap()
{
- static const InputTypeFactoryMap* factoryMap = createInputTypeFactoryMap().leakPtr();
+ static const InputTypeFactoryMap* factoryMap = createInputTypeFactoryMap().release();
return factoryMap;
}

Powered by Google App Engine
This is Rietveld 408576698