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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyBase.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/bindings/core/v8/ScriptPromisePropertyBase.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyBase.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyBase.cpp
index ad130a9e4b444cafd3e817d62f5d9eb2cb7784c9..7c23a8f1e590020f9ec1c13d5af5a78897aac76e 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyBase.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyBase.cpp
@@ -9,6 +9,8 @@
#include "bindings/core/v8/V8Binding.h"
#include "bindings/core/v8/V8HiddenValue.h"
#include "core/dom/ExecutionContext.h"
+#include "wtf/PtrUtil.h"
+#include <memory>
namespace blink {
@@ -81,7 +83,7 @@ void ScriptPromisePropertyBase::resolveOrReject(State targetState)
v8::HandleScope handleScope(m_isolate);
size_t i = 0;
while (i < m_wrappers.size()) {
- const OwnPtr<ScopedPersistent<v8::Object>>& persistent = m_wrappers[i];
+ const std::unique_ptr<ScopedPersistent<v8::Object>>& persistent = m_wrappers[i];
if (persistent->isEmpty()) {
// wrapper has died.
// Since v8 GC can run during the iteration and clear the reference,
@@ -129,7 +131,7 @@ v8::Local<v8::Object> ScriptPromisePropertyBase::ensureHolderWrapper(ScriptState
v8::Local<v8::Context> context = scriptState->context();
size_t i = 0;
while (i < m_wrappers.size()) {
- const OwnPtr<ScopedPersistent<v8::Object>>& persistent = m_wrappers[i];
+ const std::unique_ptr<ScopedPersistent<v8::Object>>& persistent = m_wrappers[i];
if (persistent->isEmpty()) {
// wrapper has died.
// Since v8 GC can run during the iteration and clear the reference,
@@ -144,7 +146,7 @@ v8::Local<v8::Object> ScriptPromisePropertyBase::ensureHolderWrapper(ScriptState
++i;
}
v8::Local<v8::Object> wrapper = holder(m_isolate, context->Global());
- OwnPtr<ScopedPersistent<v8::Object>> weakPersistent = adoptPtr(new ScopedPersistent<v8::Object>);
+ std::unique_ptr<ScopedPersistent<v8::Object>> weakPersistent = wrapUnique(new ScopedPersistent<v8::Object>);
weakPersistent->set(m_isolate, wrapper);
weakPersistent->setWeak(weakPersistent.get(), &clearHandle);
m_wrappers.append(std::move(weakPersistent));

Powered by Google App Engine
This is Rietveld 408576698