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

Unified Diff: test/cctest/test-api.cc

Issue 989153003: remove phantom naming from the api (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « src/global-handles.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index b9c5ee1e84d61210c498f3e07f9df5685e36c5a4..7016bf7ac2b135bfc444664b92d38af527198f2d 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -6272,7 +6272,7 @@ struct FlagAndPersistent {
};
-static void SetFlag(const v8::PhantomCallbackData<FlagAndPersistent>& data) {
+static void SetFlag(const v8::WeakCallbackInfo<FlagAndPersistent>& data) {
data.GetParameter()->flag = true;
}
@@ -6311,8 +6311,10 @@ static void IndependentWeakHandle(bool global_gc, bool interlinked) {
object_a.flag = false;
object_b.flag = false;
- object_a.handle.SetPhantom(&object_a, &SetFlag);
- object_b.handle.SetPhantom(&object_b, &SetFlag);
+ object_a.handle.SetWeak(&object_a, &SetFlag,
+ v8::WeakCallbackType::kParameter);
+ object_b.handle.SetWeak(&object_b, &SetFlag,
+ v8::WeakCallbackType::kParameter);
CHECK(!object_b.handle.IsIndependent());
object_a.handle.MarkIndependent();
object_b.handle.MarkIndependent();
@@ -6367,7 +6369,7 @@ class Trivial2 {
void CheckInternalFields(
- const v8::PhantomCallbackData<v8::Persistent<v8::Object>>& data) {
+ const v8::WeakCallbackInfo<v8::Persistent<v8::Object>>& data) {
v8::Persistent<v8::Object>* handle = data.GetParameter();
handle->Reset();
Trivial* t1 = reinterpret_cast<Trivial*>(data.GetInternalField1());
@@ -6407,8 +6409,8 @@ void InternalFieldCallback(bool global_gc) {
reinterpret_cast<Trivial2*>(obj->GetAlignedPointerFromInternalField(1));
CHECK_EQ(103, t2->x());
- handle.SetPhantom<v8::Persistent<v8::Object>>(&handle, CheckInternalFields,
- 0, 1);
+ handle.SetWeak<v8::Persistent<v8::Object>>(
+ &handle, CheckInternalFields, v8::WeakCallbackType::kInternalFields);
if (!global_gc) {
handle.MarkIndependent();
}
« no previous file with comments | « src/global-handles.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698