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

Unified Diff: sky/engine/bindings-dart/dart_master.cpp

Issue 894753002: Rename dart_master.cpp to .cc, consistent with chromium style (Closed) Base URL: https://github.com/eseidel/skydart.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/bindings-dart/dart_master.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/bindings-dart/dart_master.cpp
diff --git a/sky/engine/bindings-dart/dart_master.cpp b/sky/engine/bindings-dart/dart_master.cpp
deleted file mode 100644
index e36332661da5bb410b5b57657ba7612cf2b90754..0000000000000000000000000000000000000000
--- a/sky/engine/bindings-dart/dart_master.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-#include "sky/engine/config.h"
-#include "sky/engine/bindings-dart/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/bindings-dart/dart_master.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698