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

Unified Diff: sky/engine/bindings-dart/core/dart/DartScheduledAction.cpp

Issue 875013003: Import Dart bindings as of Blink r188698. This merely copies the files over and does not attach any… (Closed) Base URL: https://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
Index: sky/engine/bindings-dart/core/dart/DartScheduledAction.cpp
diff --git a/sky/engine/v8_inspector/InspectorBaseAgent.cpp b/sky/engine/bindings-dart/core/dart/DartScheduledAction.cpp
similarity index 60%
copy from sky/engine/v8_inspector/InspectorBaseAgent.cpp
copy to sky/engine/bindings-dart/core/dart/DartScheduledAction.cpp
index 623aecb4abdf3ba2608d7051788bb3e378070925..4ff9ef5095908b5796ccec6121896cb3a9f2619b 100644
--- a/sky/engine/v8_inspector/InspectorBaseAgent.cpp
+++ b/sky/engine/bindings-dart/core/dart/DartScheduledAction.cpp
@@ -27,31 +27,40 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "config.h"
+#include "bindings/core/dart/DartScheduledAction.h"
-#include "sky/engine/config.h"
-#include "sky/engine/v8_inspector/InspectorBaseAgent.h"
-
-#include "sky/engine/v8_inspector/InspectorState.h"
-#include "sky/engine/wtf/PassOwnPtr.h"
+#include "bindings/core/dart/DartController.h"
+#include "bindings/core/dart/DartUtilities.h"
+#include "core/dom/Document.h"
namespace blink {
-InspectorAgent::InspectorAgent(const String& name)
- : m_name(name)
+DartScheduledAction::DartScheduledAction(Dart_Isolate isolate, Dart_Handle action)
+ : m_isolate(isolate)
{
+ m_action = Dart_NewPersistentHandle(action);
}
-InspectorAgent::~InspectorAgent()
+DartScheduledAction::~DartScheduledAction()
{
+ ASSERT(m_action);
+ DartIsolateScope scope(m_isolate);
+ // FIXME: implement persistent handles tracking a la V8GCController::unregisterGlobalHandle.
+ Dart_DeletePersistentHandle(m_action);
+ m_action = 0;
}
-void InspectorAgent::init(InstrumentingAgents* agents,
- InspectorState* inspectorState)
+void DartScheduledAction::execute(ExecutionContext* context)
{
- m_instrumentingAgents = agents;
- m_state = inspectorState;
- virtualInit();
+ DartController* dartController = DartController::retrieve(context);
+ ASSERT(dartController);
+ ASSERT(m_action);
+ DartIsolateScope scope(m_isolate);
+ DartApiScope apiScope;
+ Dart_Handle result = dartController->callFunction(Dart_HandleFromPersistent(m_action), 0, 0);
+ if (Dart_IsError(result))
+ DartUtilities::reportProblem(context, result);
}
} // namespace blink
-
« no previous file with comments | « sky/engine/bindings-dart/core/dart/DartScheduledAction.h ('k') | sky/engine/bindings-dart/core/dart/DartScriptDebugListener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698