blob: 16d6c10a0a79e00ffd489bb8b2eeab92afb49c03 [file] [log] [blame]
// 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