Skip to content

Commit

Permalink
Update //lib/ftl (flutter#3108)
Browse files Browse the repository at this point in the history
This fixes this Fuchsia build, which uses the latest //lib/ftl.
  • Loading branch information
abarth authored Oct 7, 2016
1 parent 362f11f commit 192bc17
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 4 additions & 0 deletions glue/task_runner_adaptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ void TaskRunnerAdaptor::PostDelayedTask(ftl::Closure task,
base::TimeDelta::FromMicroseconds(delay.ToMicroseconds()));
}

bool TaskRunnerAdaptor::RunsTasksOnCurrentThread() {
return runner_->RunsTasksOnCurrentThread();
}

} // namespace glue
1 change: 1 addition & 0 deletions glue/task_runner_adaptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions lib/ui/window/platform_message.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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();
}));
}
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions shell/common/platform_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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, //
Expand Down
4 changes: 2 additions & 2 deletions shell/platform/android/platform_view_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -268,7 +268,7 @@ - (void)dispatchTouches:(NSSet*)touches phase:(UITouchPhase)phase {
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())
Expand Down

0 comments on commit 192bc17

Please sign in to comment.