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

Unified Diff: src/v8.cc

Issue 249313002: Remove static CallCompletedCallback handlers (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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
« src/isolate.cc ('K') | « src/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8.cc
diff --git a/src/v8.cc b/src/v8.cc
index afe8e4b0551bafe9e2338150109aa3836ee6737e..70a498363052896423330cdd58fd62d38fe1729c 100644
--- a/src/v8.cc
+++ b/src/v8.cc
@@ -53,7 +53,6 @@ namespace internal {
V8_DECLARE_ONCE(init_once);
-List<CallCompletedCallback>* V8::call_completed_callbacks_ = NULL;
v8::ArrayBuffer::Allocator* V8::array_buffer_allocator_ = NULL;
v8::Platform* V8::platform_ = NULL;
@@ -94,9 +93,6 @@ void V8::TearDown() {
RegisteredExtension::UnregisterAll();
Isolate::GlobalTearDown();
- delete call_completed_callbacks_;
- call_completed_callbacks_ = NULL;
-
Sampler::TearDown();
Serializer::TearDown();
@@ -114,48 +110,6 @@ void V8::SetReturnAddressLocationResolver(
}
-void V8::AddCallCompletedCallback(CallCompletedCallback callback) {
- if (call_completed_callbacks_ == NULL) { // Lazy init.
- call_completed_callbacks_ = new List<CallCompletedCallback>();
- }
- for (int i = 0; i < call_completed_callbacks_->length(); i++) {
- if (callback == call_completed_callbacks_->at(i)) return;
- }
- call_completed_callbacks_->Add(callback);
-}
-
-
-void V8::RemoveCallCompletedCallback(CallCompletedCallback callback) {
- if (call_completed_callbacks_ == NULL) return;
- for (int i = 0; i < call_completed_callbacks_->length(); i++) {
- if (callback == call_completed_callbacks_->at(i)) {
- call_completed_callbacks_->Remove(i);
- }
- }
-}
-
-
-void V8::FireCallCompletedCallback(Isolate* isolate) {
- bool has_call_completed_callbacks = call_completed_callbacks_ != NULL;
- bool run_microtasks = isolate->autorun_microtasks() &&
- isolate->microtask_pending();
- if (!has_call_completed_callbacks && !run_microtasks) return;
-
- HandleScopeImplementer* handle_scope_implementer =
- isolate->handle_scope_implementer();
- if (!handle_scope_implementer->CallDepthIsZero()) return;
- // Fire callbacks. Increase call depth to prevent recursive callbacks.
- handle_scope_implementer->IncrementCallDepth();
- if (run_microtasks) Execution::RunMicrotasks(isolate);
- if (has_call_completed_callbacks) {
- for (int i = 0; i < call_completed_callbacks_->length(); i++) {
- call_completed_callbacks_->at(i)();
- }
- }
- handle_scope_implementer->DecrementCallDepth();
-}
-
-
void V8::RunMicrotasks(Isolate* isolate) {
if (!isolate->microtask_pending())
return;
« src/isolate.cc ('K') | « src/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698