Skip to content

Commit

Permalink
Got rid of the DelayedTask as it is no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Toon Schoenmakers committed Apr 15, 2016
1 parent 62918c2 commit 81cf121
Showing 1 changed file with 0 additions and 48 deletions.
48 changes: 0 additions & 48 deletions platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,54 +35,6 @@ static std::mutex mutex;
*/
static std::atomic<Platform*> platform;

/**
* Execute a v8::Task with a bit of delay, like we want in the CallDelayedOnForegroundThread
* method.
*/
class DelayedTask : public v8::Task
{
private:
/**
* The underlying task we want to execute
* @var v8::Task
*/
v8::Task *_task;

/**
* The amount of delay that we want before executing the task
* @var double
*/
double _delay;

public:
/**
* Constructor
* @param task
* @param delay
*/
DelayedTask(v8::Task *task, double delay) : _task(task), _delay(delay) {}

/**
* Destructor, we delete the underlying task from here
*/
virtual ~DelayedTask()
{
delete _task;
}

/**
* The abstract Run method of the v8::Task interface
*/
void Run() override
{
// so first we sleep for '_delay' seconds
std::this_thread::sleep_for(std::chrono::duration<double, std::deci>(_delay));

// and then we run the actual task
_task->Run();
}
};

/**
* Include the dumps of the natives and snapshot blobs
*/
Expand Down

0 comments on commit 81cf121

Please sign in to comment.