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

Unified Diff: runtime/vm/unit_test.h

Issue 1140263005: Revert "Hide Isolate pointer from embedder" (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
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 039559003ec796e104f6df85f077ba5601f1005c..e554b5af2e02ed57c1d34d2df3aa724bbb113e12 100644
--- a/runtime/vm/unit_test.h
+++ b/runtime/vm/unit_test.h
@@ -11,7 +11,6 @@
#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"
@@ -288,11 +287,11 @@ class TestCase : TestCaseBase {
const char* name) {
char* err;
Dart_Isolate isolate = Dart_CreateIsolate(name, NULL, buffer, NULL, &err);
- if (isolate == DART_ILLEGAL_ISOLATE) {
+ if (isolate == NULL) {
OS::Print("Creation of isolate failed '%s'\n", err);
free(err);
}
- EXPECT(isolate != DART_ILLEGAL_ISOLATE);
+ EXPECT(isolate != NULL);
return isolate;
}
@@ -303,19 +302,19 @@ class TestCase : TestCaseBase {
class TestIsolateScope {
public:
TestIsolateScope() {
- isolate_ = TestCase::CreateTestIsolate();
+ isolate_ = reinterpret_cast<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_ == Api::CastIsolate(Isolate::Current()));
+ ASSERT(isolate_ == Isolate::Current());
Dart_ShutdownIsolate();
- isolate_ = DART_ILLEGAL_ISOLATE;
+ isolate_ = NULL;
}
- Isolate* isolate() const { return Api::CastIsolate(isolate_); }
+ Isolate* isolate() const { return isolate_; }
private:
- Dart_Isolate isolate_;
+ 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