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

Unified Diff: sky/engine/core/script/dart_controller.h

Issue 921903002: Add DartController and friends (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: More comment Created 5 years, 10 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 | sky/engine/core/script/dart_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/script/dart_controller.h
diff --git a/sky/engine/core/script/dart_controller.h b/sky/engine/core/script/dart_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..0da2a3dd2a4ee3a6430f659f584503f023be3f86
--- /dev/null
+++ b/sky/engine/core/script/dart_controller.h
@@ -0,0 +1,49 @@
+// 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.
+
+#ifndef SKY_ENGINE_CORE_SCRIPT_DART_CONTROLLER_H_
+#define SKY_ENGINE_CORE_SCRIPT_DART_CONTROLLER_H_
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "dart/runtime/include/dart_api.h"
+#include "sky/engine/wtf/OwnPtr.h"
+#include "sky/engine/wtf/text/AtomicString.h"
+#include "sky/engine/wtf/text/TextPosition.h"
+
+namespace blink {
+class AbstractModule;
+class BuiltinSky;
+class DOMDartState;
+class Document;
+
+class DartController {
+ public:
+ DartController();
+ ~DartController();
+
+ static void InitVM();
+
+ void LoadModule(RefPtr<AbstractModule> module,
+ const String& source,
+ const TextPosition& textPosition);
+ void ClearForClose();
+ void CreateIsolateFor(Document*);
+
+ DOMDartState* dart_state() const { return dom_dart_state_.get(); }
+
+ private:
+ void ExecuteModule(RefPtr<AbstractModule> module);
+
+ OwnPtr<DOMDartState> dom_dart_state_;
+ OwnPtr<BuiltinSky> builtin_sky_;
+
+ base::WeakPtrFactory<DartController> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(DartController);
+};
+
+}
+
+#endif // SKY_ENGINE_CORE_SCRIPT_DART_CONTROLLER_H_
« no previous file with comments | « no previous file | sky/engine/core/script/dart_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698