flutter_flutter/glue/thread.cc
2016-08-09 13:52:15 -07:00

30 lines
712 B
C++

// Copyright 2016 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.
#include "flutter/glue/thread.h"
#include <utility>
#include "base/threading/thread.h"
#include "flutter/glue/task_runner_adaptor.h"
namespace glue {
class Thread::ThreadImpl : public base::Thread {
public:
ThreadImpl(std::string name) : base::Thread(std::move(name)) {}
};
Thread::Thread(std::string name) : impl_(new ThreadImpl(name)) {}
Thread::~Thread() {}
bool Thread::Start() {
bool result = impl_->Start();
task_runner_ = ftl::MakeRefCounted<TaskRunnerAdaptor>(impl_->task_runner());
return result;
}
} // namespace glue