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

Side by Side Diff: src/api.cc

Issue 11959031: Add a new weak handle callback that passes an Isolate to an embedder (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Applied sven's comments Created 7 years, 11 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
« no previous file with comments | « include/v8.h ('k') | src/global-handles.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 void V8::MakeWeak(i::Object** object, void* parameters, 639 void V8::MakeWeak(i::Object** object, void* parameters,
640 WeakReferenceCallback callback) { 640 WeakReferenceCallback callback) {
641 i::Isolate* isolate = i::Isolate::Current(); 641 i::Isolate* isolate = i::Isolate::Current();
642 LOG_API(isolate, "MakeWeak"); 642 LOG_API(isolate, "MakeWeak");
643 isolate->global_handles()->MakeWeak(object, parameters, 643 isolate->global_handles()->MakeWeak(object, parameters,
644 callback); 644 callback);
645 } 645 }
646 646
647 647
648 void V8::MakeWeak(i::Isolate* isolate, i::Object** object, 648 void V8::MakeWeak(i::Isolate* isolate, i::Object** object,
649 void* parameters, WeakReferenceCallback callback) { 649 void* parameters, WeakHandleCallback callback) {
650 ASSERT(isolate == i::Isolate::Current()); 650 ASSERT(isolate == i::Isolate::Current());
651 LOG_API(isolate, "MakeWeak"); 651 LOG_API(isolate, "MakeWeak");
652 isolate->global_handles()->MakeWeak(object, parameters, 652 isolate->global_handles()->MakeWeak(object, parameters,
653 callback); 653 callback);
654 } 654 }
655 655
656 656
657 void V8::ClearWeak(i::Object** obj) { 657 void V8::ClearWeak(i::Object** obj) {
658 i::Isolate* isolate = i::Isolate::Current(); 658 i::Isolate* isolate = i::Isolate::Current();
659 LOG_API(isolate, "ClearWeak"); 659 LOG_API(isolate, "ClearWeak");
(...skipping 6079 matching lines...) Expand 10 before | Expand all | Expand 10 after
6739 6739
6740 v->VisitPointers(blocks_.first(), first_block_limit_); 6740 v->VisitPointers(blocks_.first(), first_block_limit_);
6741 6741
6742 for (int i = 1; i < blocks_.length(); i++) { 6742 for (int i = 1; i < blocks_.length(); i++) {
6743 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); 6743 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]);
6744 } 6744 }
6745 } 6745 }
6746 6746
6747 6747
6748 } } // namespace v8::internal 6748 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/global-handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698