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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyBase.cpp

Issue 1979493002: Remove OwnPtr::release() calls in bindings/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "bindings/core/v8/ScriptPromisePropertyBase.h" 5 #include "bindings/core/v8/ScriptPromisePropertyBase.h"
6 6
7 #include "bindings/core/v8/ScopedPersistent.h" 7 #include "bindings/core/v8/ScopedPersistent.h"
8 #include "bindings/core/v8/ScriptState.h" 8 #include "bindings/core/v8/ScriptState.h"
9 #include "bindings/core/v8/V8Binding.h" 9 #include "bindings/core/v8/V8Binding.h"
10 #include "bindings/core/v8/V8HiddenValue.h" 10 #include "bindings/core/v8/V8HiddenValue.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 v8::Local<v8::Object> wrapper = persistent->newLocal(m_isolate); 141 v8::Local<v8::Object> wrapper = persistent->newLocal(m_isolate);
142 if (wrapper->CreationContext() == context) 142 if (wrapper->CreationContext() == context)
143 return wrapper; 143 return wrapper;
144 ++i; 144 ++i;
145 } 145 }
146 v8::Local<v8::Object> wrapper = holder(m_isolate, context->Global()); 146 v8::Local<v8::Object> wrapper = holder(m_isolate, context->Global());
147 OwnPtr<ScopedPersistent<v8::Object>> weakPersistent = adoptPtr(new ScopedPer sistent<v8::Object>); 147 OwnPtr<ScopedPersistent<v8::Object>> weakPersistent = adoptPtr(new ScopedPer sistent<v8::Object>);
148 weakPersistent->set(m_isolate, wrapper); 148 weakPersistent->set(m_isolate, wrapper);
149 weakPersistent->setWeak(weakPersistent.get(), &clearHandle); 149 weakPersistent->setWeak(weakPersistent.get(), &clearHandle);
150 m_wrappers.append(weakPersistent.release()); 150 m_wrappers.append(std::move(weakPersistent));
151 return wrapper; 151 return wrapper;
152 } 152 }
153 153
154 void ScriptPromisePropertyBase::clearWrappers() 154 void ScriptPromisePropertyBase::clearWrappers()
155 { 155 {
156 checkThis(); 156 checkThis();
157 checkWrappers(); 157 checkWrappers();
158 v8::HandleScope handleScope(m_isolate); 158 v8::HandleScope handleScope(m_isolate);
159 for (WeakPersistentSet::iterator i = m_wrappers.begin(); i != m_wrappers.end (); ++i) { 159 for (WeakPersistentSet::iterator i = m_wrappers.begin(); i != m_wrappers.end (); ++i) {
160 v8::Local<v8::Object> wrapper = (*i)->newLocal(m_isolate); 160 v8::Local<v8::Object> wrapper = (*i)->newLocal(m_isolate);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 ASSERT_NOT_REACHED(); 208 ASSERT_NOT_REACHED();
209 return v8::Local<v8::String>(); 209 return v8::Local<v8::String>();
210 } 210 }
211 211
212 DEFINE_TRACE(ScriptPromisePropertyBase) 212 DEFINE_TRACE(ScriptPromisePropertyBase)
213 { 213 {
214 ContextLifecycleObserver::trace(visitor); 214 ContextLifecycleObserver::trace(visitor);
215 } 215 }
216 216
217 } // namespace blink 217 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698