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

Side by Side Diff: src/isolate.cc

Issue 1689863002: Introduce BeforeCallEnteredCallback. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project 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 "src/isolate.h" 5 #include "src/isolate.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <fstream> // NOLINT(readability/streams) 9 #include <fstream> // NOLINT(readability/streams)
10 #include <sstream> 10 #include <sstream>
(...skipping 2591 matching lines...) Expand 10 before | Expand all | Expand 10 after
2602 2602
2603 SetUpSubregistry(registry, map, "for"); 2603 SetUpSubregistry(registry, map, "for");
2604 SetUpSubregistry(registry, map, "for_api"); 2604 SetUpSubregistry(registry, map, "for_api");
2605 SetUpSubregistry(registry, map, "keyFor"); 2605 SetUpSubregistry(registry, map, "keyFor");
2606 SetUpSubregistry(registry, map, "private_api"); 2606 SetUpSubregistry(registry, map, "private_api");
2607 } 2607 }
2608 return Handle<JSObject>::cast(factory()->symbol_registry()); 2608 return Handle<JSObject>::cast(factory()->symbol_registry());
2609 } 2609 }
2610 2610
2611 2611
2612 void Isolate::AddBeforeCallEnteredCallback(BeforeCallEnteredCallback callback) {
2613 for (int i = 0; i < before_call_entered_callbacks_.length(); i++) {
2614 if (callback == before_call_entered_callbacks_.at(i)) return;
2615 }
2616 before_call_entered_callbacks_.Add(callback);
2617 }
2618
2619
2620 void Isolate::RemoveBeforeCallEnteredCallback(
2621 BeforeCallEnteredCallback callback) {
2622 for (int i = 0; i < before_call_entered_callbacks_.length(); i++) {
2623 if (callback == before_call_entered_callbacks_.at(i)) {
2624 before_call_entered_callbacks_.Remove(i);
2625 }
2626 }
2627 }
2628
2629
2630 void Isolate::FireBeforeCallEnteredCallback() {
2631 for (int i = 0; i < before_call_entered_callbacks_.length(); i++) {
2632 before_call_entered_callbacks_.at(i)(reinterpret_cast<v8::Isolate*>(this));
2633 }
2634 }
2635
2636
2612 void Isolate::AddCallCompletedCallback(CallCompletedCallback callback) { 2637 void Isolate::AddCallCompletedCallback(CallCompletedCallback callback) {
2613 for (int i = 0; i < call_completed_callbacks_.length(); i++) { 2638 for (int i = 0; i < call_completed_callbacks_.length(); i++) {
2614 if (callback == call_completed_callbacks_.at(i)) return; 2639 if (callback == call_completed_callbacks_.at(i)) return;
2615 } 2640 }
2616 call_completed_callbacks_.Add(callback); 2641 call_completed_callbacks_.Add(callback);
2617 } 2642 }
2618 2643
2619 2644
2620 void Isolate::RemoveCallCompletedCallback(CallCompletedCallback callback) { 2645 void Isolate::RemoveCallCompletedCallback(CallCompletedCallback callback) {
2621 for (int i = 0; i < call_completed_callbacks_.length(); i++) { 2646 for (int i = 0; i < call_completed_callbacks_.length(); i++) {
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
2858 // Then check whether this scope intercepts. 2883 // Then check whether this scope intercepts.
2859 if ((flag & intercept_mask_)) { 2884 if ((flag & intercept_mask_)) {
2860 intercepted_flags_ |= flag; 2885 intercepted_flags_ |= flag;
2861 return true; 2886 return true;
2862 } 2887 }
2863 return false; 2888 return false;
2864 } 2889 }
2865 2890
2866 } // namespace internal 2891 } // namespace internal
2867 } // namespace v8 2892 } // namespace v8
OLDNEW
« src/api.cc ('K') | « src/isolate.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698