Remove //base from //flutter/tonic
This commit is contained in:
@@ -11,6 +11,8 @@ source_set("glue") {
|
||||
"stack_trace.h",
|
||||
"task_runner_adaptor.cc",
|
||||
"task_runner_adaptor.h",
|
||||
"thread.cc",
|
||||
"thread.h",
|
||||
"trace_event.h",
|
||||
]
|
||||
|
||||
|
||||
29
engine/src/flutter/glue/thread.cc
Normal file
29
engine/src/flutter/glue/thread.cc
Normal file
@@ -0,0 +1,29 @@
|
||||
// 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 "glue/thread.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "base/threading/thread.h"
|
||||
#include "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)) {
|
||||
task_runner_ = ftl::MakeRefCounted<TaskRunnerAdaptor>(impl_->task_runner());
|
||||
}
|
||||
|
||||
Thread::~Thread() {}
|
||||
|
||||
bool Thread::Start() {
|
||||
return impl_->Start();
|
||||
}
|
||||
|
||||
} // namespace glue
|
||||
32
engine/src/flutter/glue/thread.h
Normal file
32
engine/src/flutter/glue/thread.h
Normal file
@@ -0,0 +1,32 @@
|
||||
// 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.
|
||||
|
||||
#ifndef GLUE_THREAD_H_
|
||||
#define GLUE_THREAD_H_
|
||||
|
||||
#include "lib/ftl/tasks/task_runner.h"
|
||||
|
||||
namespace glue {
|
||||
|
||||
class Thread {
|
||||
public:
|
||||
Thread(std::string name);
|
||||
~Thread();
|
||||
|
||||
bool Start();
|
||||
|
||||
const ftl::RefPtr<ftl::TaskRunner>& task_runner() { return task_runner_; }
|
||||
|
||||
private:
|
||||
class ThreadImpl;
|
||||
|
||||
std::unique_ptr<ThreadImpl> impl_;
|
||||
ftl::RefPtr<ftl::TaskRunner> task_runner_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(Thread);
|
||||
};
|
||||
|
||||
} // namespace glue
|
||||
|
||||
#endif // GLUE_THREAD_H_
|
||||
@@ -8,6 +8,8 @@
|
||||
#define TRACE_EVENT2(a, b, c, d, e, f)
|
||||
#define TRACE_EVENT_ASYNC_BEGIN0(a, b, c)
|
||||
#define TRACE_EVENT_ASYNC_END0(a, b, c)
|
||||
#define TRACE_EVENT_ASYNC_BEGIN1(a, b, c, d, e)
|
||||
#define TRACE_EVENT_ASYNC_END1(a, b, c, d, e)
|
||||
#else
|
||||
#include "base/trace_event/trace_event.h"
|
||||
#endif // defined(__Fuchsia__)
|
||||
|
||||
Reference in New Issue
Block a user