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

Unified Diff: runtime/vm/unit_test.h

Issue 1130753006: Hide Isolate pointer from embedder (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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 | « runtime/vm/service_isolate.cc ('k') | samples/sample_extension/sample_extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/unit_test.h
diff --git a/runtime/vm/unit_test.h b/runtime/vm/unit_test.h
index e554b5af2e02ed57c1d34d2df3aa724bbb113e12..039559003ec796e104f6df85f077ba5601f1005c 100644
--- a/runtime/vm/unit_test.h
+++ b/runtime/vm/unit_test.h
@@ -11,6 +11,7 @@
#include "vm/ast.h"
#include "vm/dart.h"
+#include "vm/dart_api_impl.h"
#include "vm/globals.h"
#include "vm/heap.h"
#include "vm/isolate.h"
@@ -287,11 +288,11 @@ class TestCase : TestCaseBase {
const char* name) {
char* err;
Dart_Isolate isolate = Dart_CreateIsolate(name, NULL, buffer, NULL, &err);
- if (isolate == NULL) {
+ if (isolate == DART_ILLEGAL_ISOLATE) {
OS::Print("Creation of isolate failed '%s'\n", err);
free(err);
}
- EXPECT(isolate != NULL);
+ EXPECT(isolate != DART_ILLEGAL_ISOLATE);
return isolate;
}
@@ -302,19 +303,19 @@ class TestCase : TestCaseBase {
class TestIsolateScope {
public:
TestIsolateScope() {
- isolate_ = reinterpret_cast<Isolate*>(TestCase::CreateTestIsolate());
+ isolate_ = TestCase::CreateTestIsolate();
Dart_EnterScope(); // Create a Dart API scope for unit tests.
}
~TestIsolateScope() {
Dart_ExitScope(); // Exit the Dart API scope created for unit tests.
- ASSERT(isolate_ == Isolate::Current());
+ ASSERT(isolate_ == Api::CastIsolate(Isolate::Current()));
Dart_ShutdownIsolate();
- isolate_ = NULL;
+ isolate_ = DART_ILLEGAL_ISOLATE;
}
- Isolate* isolate() const { return isolate_; }
+ Isolate* isolate() const { return Api::CastIsolate(isolate_); }
private:
- Isolate* isolate_;
+ Dart_Isolate isolate_;
DISALLOW_COPY_AND_ASSIGN(TestIsolateScope);
};
« no previous file with comments | « runtime/vm/service_isolate.cc ('k') | samples/sample_extension/sample_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698