This fixes this Fuchsia build, which uses the latest //lib/ftl.
This commit is contained in:
Adam Barth
2016-10-07 14:07:09 -07:00
committed by GitHub
parent fec82b04a1
commit c0aa11d81e
7 changed files with 17 additions and 12 deletions

2
DEPS
View File

@@ -54,7 +54,7 @@ deps = {
# and not have to specific specific hashes.
'src/lib/ftl':
Var('fuchsia_git') + '/ftl' + '@' + '0bb3a02301c8a88b494e58c6636fa509525adaa8',
Var('fuchsia_git') + '/ftl' + '@' + '4917351099cfb11d7bd9a808fd4fce67928c9e40',
'src/lib/tonic':
Var('fuchsia_git') + '/tonic' + '@' + '5ca4053563027007ef2e7b2892efe63c26d30259',

View File

@@ -37,4 +37,8 @@ void TaskRunnerAdaptor::PostDelayedTask(ftl::Closure task,
base::TimeDelta::FromMicroseconds(delay.ToMicroseconds()));
}
bool TaskRunnerAdaptor::RunsTasksOnCurrentThread() {
return runner_->RunsTasksOnCurrentThread();
}
} // namespace glue

View File

@@ -20,6 +20,7 @@ class TaskRunnerAdaptor : public ftl::TaskRunner {
void PostTask(ftl::Closure task) override;
void PostDelayedTask(ftl::Closure task, ftl::TimeDelta delay) override;
bool RunsTasksOnCurrentThread() override;
protected:
~TaskRunnerAdaptor() override;

View File

@@ -7,7 +7,7 @@
#include <utility>
#include "flutter/common/threads.h"
#include "lib/ftl/functional/wrap_lambda.h"
#include "lib/ftl/functional/make_copyable.h"
#include "lib/tonic/dart_state.h"
#include "lib/tonic/logging/dart_invoke.h"
@@ -23,7 +23,7 @@ PlatformMessage::PlatformMessage(std::string name,
PlatformMessage::~PlatformMessage() {
if (!callback_.is_empty()) {
Threads::UI()->PostTask(
ftl::WrapLambda([callback = std::move(callback_)]() mutable {
ftl::MakeCopyable([callback = std::move(callback_)]() mutable {
callback.Clear();
}));
}
@@ -32,7 +32,7 @@ PlatformMessage::~PlatformMessage() {
void PlatformMessage::InvokeCallback(std::vector<char> data) {
if (callback_.is_empty())
return;
Threads::UI()->PostTask(ftl::WrapLambda(
Threads::UI()->PostTask(ftl::MakeCopyable(
[ callback = std::move(callback_), data = std::move(data) ]() mutable {
tonic::DartState* dart_state = callback.dart_state().get();
if (!dart_state)

View File

@@ -9,7 +9,7 @@
#include "flutter/common/threads.h"
#include "flutter/lib/ui/painting/resource_context.h"
#include "flutter/shell/common/rasterizer.h"
#include "lib/ftl/functional/wrap_lambda.h"
#include "lib/ftl/functional/make_copyable.h"
#include "third_party/skia/include/gpu/gl/GrGLInterface.h"
namespace shell {
@@ -32,7 +32,7 @@ PlatformView::~PlatformView() {
void PlatformView::ConnectToEngine(
mojo::InterfaceRequest<sky::SkyEngine> request) {
blink::Threads::UI()->PostTask(ftl::WrapLambda([
blink::Threads::UI()->PostTask(ftl::MakeCopyable([
view = GetWeakViewPtr(), engine = engine().GetWeakPtr(),
request = std::move(request)
]() mutable {
@@ -50,13 +50,13 @@ void PlatformView::NotifyCreated(std::unique_ptr<Surface> surface,
ftl::Closure caller_continuation) {
ftl::AutoResetWaitableEvent latch;
auto ui_continuation = ftl::WrapLambda([
auto ui_continuation = ftl::MakeCopyable([
this, //
surface = std::move(surface), //
caller_continuation, //
&latch
]() mutable {
auto gpu_continuation = ftl::WrapLambda([
auto gpu_continuation = ftl::MakeCopyable([
this, //
surface = std::move(surface), //
caller_continuation, //

View File

@@ -23,7 +23,7 @@
#include "flutter/shell/common/shell.h"
#include "flutter/shell/gpu/gpu_rasterizer.h"
#include "jni/FlutterView_jni.h"
#include "lib/ftl/functional/wrap_lambda.h"
#include "lib/ftl/functional/make_copyable.h"
#include "third_party/skia/include/core/SkSurface.h"
namespace shell {
@@ -100,7 +100,7 @@ void PlatformViewAndroid::DispatchPointerDataPacket(JNIEnv* env,
jint position) {
char* data = static_cast<char*>(env->GetDirectBufferAddress(buffer));
blink::Threads::UI()->PostTask(ftl::WrapLambda([
blink::Threads::UI()->PostTask(ftl::MakeCopyable([
engine = engine_->GetWeakPtr(),
packet = std::make_unique<PointerDataPacket>(data, position)
] {

View File

@@ -17,7 +17,7 @@
#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h"
#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_touch_mapper.h"
#include "flutter/shell/platform/darwin/ios/platform_view_ios.h"
#include "lib/ftl/functional/wrap_lambda.h"
#include "lib/ftl/functional/make_copyable.h"
#include "lib/ftl/time/time_delta.h"
@interface FlutterViewController ()<UIAlertViewDelegate>
@@ -268,7 +268,7 @@ static inline PointerChangeMapperPhase PointerChangePhaseFromUITouchPhase(
packet->SetPointerData(i++, pointer_data);
}
blink::Threads::UI()->PostTask(ftl::WrapLambda([
blink::Threads::UI()->PostTask(ftl::MakeCopyable([
engine = _platformView->engine().GetWeakPtr(), packet = std::move(packet)
] {
if (engine.get())