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

Unified Diff: src/isolate.h

Issue 23694011: Make implicit HandleScope of AssertNoContextChange explicit. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: One spot missed. Created 7 years, 4 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
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.h
diff --git a/src/isolate.h b/src/isolate.h
index 2f0928558a3845ab8e8fc65b30bb7ad41797023f..8eace1268481c1011607548a610c37f1a31625f6 100644
--- a/src/isolate.h
+++ b/src/isolate.h
@@ -1414,12 +1414,30 @@ class SaveContext BASE_EMBEDDED {
class AssertNoContextChange BASE_EMBEDDED {
#ifdef DEBUG
public:
- AssertNoContextChange() :
+ AssertNoContextChange() : context_(Isolate::Current()->context()) { }
+ ~AssertNoContextChange() {
+ ASSERT(Isolate::Current()->context() == *context_);
+ }
+
+ private:
+ Handle<Context> context_;
+#else
+ public:
+ AssertNoContextChange() { }
+#endif
+};
+
+
+// TODO(mstarzinger): Depracate as soon as everything is handlified.
+class AssertNoContextChangeWithHandleScope BASE_EMBEDDED {
+#ifdef DEBUG
+ public:
+ AssertNoContextChangeWithHandleScope() :
scope_(Isolate::Current()),
context_(Isolate::Current()->context(), Isolate::Current()) {
}
- ~AssertNoContextChange() {
+ ~AssertNoContextChangeWithHandleScope() {
ASSERT(Isolate::Current()->context() == *context_);
}
@@ -1428,7 +1446,7 @@ class AssertNoContextChange BASE_EMBEDDED {
Handle<Context> context_;
#else
public:
- AssertNoContextChange() { }
+ AssertNoContextChangeWithHandleScope() { }
#endif
};
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698