| 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
|
| -
|
|
|