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

Unified Diff: sky/engine/bindings2/dart_master.cc

Issue 860273005: Revert "Dart: 2++ = 3" (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 | « sky/engine/bindings2/dart_master.h ('k') | sky/engine/bindings2/snapshot.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/bindings2/dart_master.cc
diff --git a/sky/engine/bindings2/dart_master.cc b/sky/engine/bindings2/dart_master.cc
deleted file mode 100644
index cc6114a8ca40cd2ae06ee76015f0127b899b8871..0000000000000000000000000000000000000000
--- a/sky/engine/bindings2/dart_master.cc
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "sky/engine/config.h"
-#include "sky/engine/bindings2/dart_master.h"
-
-#include "base/logging.h"
-
-namespace mojo {
-namespace dart {
-
-extern const uint8_t* snapshot_buffer;
-}
-}
-
-namespace blink {
-
-static Dart_Isolate IsolateCreateCallback(const char* script_uri,
- const char* main,
- const char* package_root,
- void* callback_data,
- char** error) {
- // LOG(INFO) << "IsolateCreateCallback";
- return nullptr;
-}
-
-static void UnhandledExceptionCallback(Dart_Handle error) {
- // LOG(INFO) << "UnhandledExceptionCallback";
-}
-
-static void IsolateShutdownCallback(void* callback_data) {
- // LOG(INFO) << "IsolateShutdownCallback";
-}
-
-static Dart_Isolate ServiceIsolateCreateCallback(void* callback_data,
- char** error) {
- // LOG(INFO) << "ServiceIsolateCreateCallback";
- return nullptr;
-}
-
-void DartMaster::InitVM() {
- bool result = Dart_SetVMFlags(0, NULL);
-
- result = Dart_Initialize(IsolateCreateCallback,
- nullptr, // Isolate interrupt callback.
- UnhandledExceptionCallback, IsolateShutdownCallback,
- // File IO callbacks.
- nullptr, nullptr, nullptr, nullptr, nullptr,
- ServiceIsolateCreateCallback);
-
- char* error;
- Dart_Isolate isolate = Dart_CreateIsolate(
- "bogus:uri", "main", mojo::dart::snapshot_buffer, nullptr, &error);
-
- CHECK(isolate);
-
- Dart_EnterScope();
-
- Dart_Handle library = Dart_LoadLibrary(
- Dart_NewStringFromCString("foo:bar"),
- Dart_NewStringFromCString("main() { int foo = 2; foo++; return foo; }"),
- 0, 0);
-
- Dart_FinalizeLoading(true);
-
- if (Dart_IsError(library)) {
- LOG(INFO) << Dart_GetError(library);
- abort();
- }
-
- Dart_Handle invoke_result =
- Dart_Invoke(library, Dart_NewStringFromCString("main"), 0, nullptr);
- if (Dart_IsError(invoke_result)) {
- LOG(INFO) << Dart_GetError(invoke_result);
- abort();
- }
-
- CHECK(Dart_IsInteger(invoke_result));
- Dart_Handle str = Dart_ToString(invoke_result);
- const char* xyz = "invalid";
- Dart_StringToCString(str, &xyz);
- LOG(INFO) << xyz;
-}
-}
« no previous file with comments | « sky/engine/bindings2/dart_master.h ('k') | sky/engine/bindings2/snapshot.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698