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

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

Issue 99193002: Remove all stuff marked as V8_DEPRECATED. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Created 7 years 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 | « test/cctest/test-mark-compact.cc ('k') | test/cctest/test-weaksets.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-weakmaps.cc
diff --git a/test/cctest/test-weakmaps.cc b/test/cctest/test-weakmaps.cc
index 8cb0aabe63d2a37bd592a8094fbc5e80c9894f61..97eca86f1b8da6e59e6725b072a445563239d98a 100644
--- a/test/cctest/test-weakmaps.cc
+++ b/test/cctest/test-weakmaps.cc
@@ -25,6 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#include <utility>
+
#include "v8.h"
#include "global-handles.h"
@@ -64,12 +66,14 @@ static void PutIntoWeakMap(Handle<JSWeakMap> weakmap,
}
static int NumberOfWeakCalls = 0;
-static void WeakPointerCallback(v8::Isolate* isolate,
- v8::Persistent<v8::Value>* handle,
- void* id) {
- ASSERT(id == reinterpret_cast<void*>(1234));
+static void WeakPointerCallback(
+ const v8::WeakCallbackData<v8::Value, void>& data) {
+ std::pair<v8::Persistent<v8::Value>*, int>* p =
+ reinterpret_cast<std::pair<v8::Persistent<v8::Value>*, int>*>(
+ data.GetParameter());
+ ASSERT_EQ(1234, p->second);
NumberOfWeakCalls++;
- handle->Reset();
+ p->first->Reset();
}
@@ -112,9 +116,10 @@ TEST(Weakness) {
// Make the global reference to the key weak.
{
HandleScope scope(isolate);
- global_handles->MakeWeak(key.location(),
- reinterpret_cast<void*>(1234),
- &WeakPointerCallback);
+ std::pair<Handle<Object>*, int> handle_and_id(&key, 1234);
+ GlobalHandles::MakeWeak(key.location(),
+ reinterpret_cast<void*>(&handle_and_id),
+ &WeakPointerCallback);
}
CHECK(global_handles->IsWeak(key.location()));
« no previous file with comments | « test/cctest/test-mark-compact.cc ('k') | test/cctest/test-weaksets.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698