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

Unified Diff: src/api.cc

Issue 198253004: Introduce per-isolate assert scopes and API to guard JS execution. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: add missing file Created 6 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
« include/v8.h ('K') | « include/v8.h ('k') | src/assert-scope.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 0418506773314fb4fc81116963bd52e50f0edd5e..16eebf06d89434dfdeaae5cfc5801453f3e4aeda 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -6514,6 +6514,32 @@ void Isolate::Exit() {
}
+Isolate::DisallowJavascriptExecutionScope::DisallowJavascriptExecutionScope(
+ Isolate* isolate) {
+ i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
+ internal_ = reinterpret_cast<void*>(
+ new i::DisallowJavascriptExecution(i_isolate));
+}
+
+
+Isolate::DisallowJavascriptExecutionScope::~DisallowJavascriptExecutionScope() {
+ delete reinterpret_cast<i::DisallowJavascriptExecution*>(internal_);
+}
+
+
+Isolate::AllowJavascriptExecutionScope::AllowJavascriptExecutionScope(
+ Isolate* isolate) {
+ i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
+ internal_ = reinterpret_cast<void*>(
+ new i::AllowJavascriptExecution(i_isolate));
+}
+
+
+Isolate::AllowJavascriptExecutionScope::~AllowJavascriptExecutionScope() {
+ delete reinterpret_cast<i::AllowJavascriptExecution*>(internal_);
+}
+
+
void Isolate::GetHeapStatistics(HeapStatistics* heap_statistics) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
if (!isolate->IsInitialized()) {
« include/v8.h ('K') | « include/v8.h ('k') | src/assert-scope.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698