Fix remaining ftl->fxl conversions (flutter/engine#4091)

* Fix remaining ftl->fxl conversions

The previous scripting pass at this did not account for objective c file endings

* Update tonic DEPS reference to the post-fxl version
This commit is contained in:
George Kulakowski
2017-09-11 16:31:18 -07:00
committed by GitHub
parent fa539e618e
commit b2b9a646ca
34 changed files with 79 additions and 79 deletions

2
DEPS
View File

@@ -125,7 +125,7 @@ deps = {
Var('fuchsia_git') + '/garnet' + '@' + '954225c071a8e44e83e9b0da4d3972771a5ed03a',
'src/lib/tonic':
Var('fuchsia_git') + '/tonic' + '@' + 'fca532244483192e961cb826d9d0c05947cf288c',
Var('fuchsia_git') + '/tonic' + '@' + 'ce1c9992ddefb940f549e6a9f94252ef2963dd2e',
'src/third_party/benchmark':
Var('fuchsia_git') + '/third_party/benchmark' + '@' + '296537bc48d380adf21567c5d736ab79f5363d22',

View File

@@ -45,7 +45,7 @@ group("flutter") {
"//flutter/synchronization:synchronization_unittests",
"//flutter/third_party/txt:txt_benchmarks",
"//flutter/third_party/txt:txt_unittests",
"//garnet/public/lib/ftl:ftl_unittests",
"//garnet/public/lib/fxl:fxl_unittests",
]
}
}

View File

@@ -14,7 +14,7 @@ source_set("assets") {
deps = [
"//flutter/glue",
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
"//garnet/public/lib/zip",
]

View File

@@ -17,7 +17,7 @@ source_set("common") {
]
deps = [
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
]
public_configs = [ ":flutter_config" ]

View File

@@ -25,7 +25,7 @@ source_set("fml") {
deps = [
"//dart/runtime:dart_api",
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
# These need to be in sync with the Fuchsia buildroot.
"//third_party/icu",
@@ -113,6 +113,6 @@ executable("fml_unittests") {
"//dart/runtime:libdart_jit",
"//flutter/fml",
"//flutter/testing",
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
]
}

View File

@@ -13,7 +13,7 @@ static constexpr CFTimeInterval kDistantFuture = 1.0e10;
MessageLoopDarwin::MessageLoopDarwin()
: running_(false), loop_((CFRunLoopRef)CFRetain(CFRunLoopGetCurrent())) {
FTL_DCHECK(loop_ != nullptr);
FXL_DCHECK(loop_ != nullptr);
// Setup the delayed wake source.
CFRunLoopTimerContext timer_context = {
@@ -25,7 +25,7 @@ MessageLoopDarwin::MessageLoopDarwin()
reinterpret_cast<CFRunLoopTimerCallBack>(&MessageLoopDarwin::OnTimerFire)
/* callout */,
&timer_context /* context */));
FTL_DCHECK(delayed_wake_timer_ != nullptr);
FXL_DCHECK(delayed_wake_timer_ != nullptr);
CFRunLoopAddTimer(loop_, delayed_wake_timer_, kCFRunLoopCommonModes);
}
@@ -35,7 +35,7 @@ MessageLoopDarwin::~MessageLoopDarwin() {
}
void MessageLoopDarwin::Run() {
FTL_DCHECK(loop_ == CFRunLoopGetCurrent());
FXL_DCHECK(loop_ == CFRunLoopGetCurrent());
running_ = true;
@@ -59,12 +59,12 @@ void MessageLoopDarwin::Terminate() {
CFRunLoopStop(loop_);
}
void MessageLoopDarwin::WakeUp(ftl::TimePoint time_point) {
// Rearm the timer. The time bases used by CoreFoundation and FTL are
void MessageLoopDarwin::WakeUp(fxl::TimePoint time_point) {
// Rearm the timer. The time bases used by CoreFoundation and FXL are
// different and must be accounted for.
CFRunLoopTimerSetNextFireDate(
delayed_wake_timer_,
CFAbsoluteTimeGetCurrent() + (time_point - ftl::TimePoint::Now()).ToSecondsF());
CFAbsoluteTimeGetCurrent() + (time_point - fxl::TimePoint::Now()).ToSecondsF());
}
void MessageLoopDarwin::OnTimerFire(CFRunLoopTimerRef timer, MessageLoopDarwin* loop) {

View File

@@ -6,7 +6,7 @@
#include <Foundation/Foundation.h>
#include "lib/ftl/files/path.h"
#include "lib/fxl/files/path.h"
namespace fml {
namespace paths {

View File

@@ -9,7 +9,7 @@ source_set("glue") {
]
deps = [
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
]
if (is_fuchsia) {

View File

@@ -11,7 +11,7 @@ source_set("io") {
deps = [
"//dart/runtime:dart_api",
"//dart/runtime/bin:embedded_dart_io",
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
"//lib/tonic/converter",
]
}

View File

@@ -79,7 +79,7 @@ source_set("runtime") {
"//flutter/lib/io",
"//flutter/lib/ui",
"//flutter/sky/engine/platform",
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
"//lib/tonic",
"//third_party/rapidjson",
"//third_party/skia",

View File

@@ -113,7 +113,7 @@ source_set("common") {
"//flutter/sky/engine/wtf",
"//flutter/synchronization",
"//flutter/third_party/txt",
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
"//lib/tonic",
"//third_party/rapidjson",
"//third_party/skia",

View File

@@ -27,7 +27,7 @@ source_set("gpu") {
"//flutter/glue",
"//flutter/shell/common",
"//flutter/synchronization",
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
"//third_party/skia",
"//third_party/skia:gpu",
]

View File

@@ -44,7 +44,7 @@ shared_library("flutter_shell_native") {
"//flutter/runtime",
"//flutter/shell/common",
"//flutter/shell/gpu",
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
"//third_party/skia",
]
if (flutter_runtime_mode == "debug") {

View File

@@ -47,7 +47,7 @@ source_set("flutter_channels") {
"//flutter/shell/gpu",
"//flutter/shell/testing",
"//flutter/sky/engine/wtf",
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
"//third_party/skia",
]
}

View File

@@ -26,7 +26,7 @@ source_set("common") {
"//flutter/shell/gpu",
"//flutter/shell/testing",
"//flutter/sky/engine/wtf",
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
"//third_party/skia",
]
}

View File

@@ -14,19 +14,19 @@
#include "flutter/shell/common/switches.h"
#include "flutter/shell/common/tracing_controller.h"
#include "flutter/sky/engine/wtf/MakeUnique.h"
#include "lib/ftl/command_line.h"
#include "lib/ftl/strings/string_view.h"
#include "lib/fxl/command_line.h"
#include "lib/fxl/strings/string_view.h"
namespace shell {
static ftl::CommandLine InitializedCommandLine() {
static fxl::CommandLine InitializedCommandLine() {
std::vector<std::string> args_vector;
for (NSString* arg in [NSProcessInfo processInfo].arguments) {
args_vector.emplace_back(arg.UTF8String);
}
return ftl::CommandLineFromIterators(args_vector.begin(), args_vector.end());
return fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end());
}
class EmbedderState {
@@ -37,7 +37,7 @@ class EmbedderState {
// See https://github.com/flutter/flutter/issues/4006
blink::engine_main_enter_ts = Dart_TimelineGetMicros();
#endif
FTL_DCHECK([NSThread isMainThread])
FXL_DCHECK([NSThread isMainThread])
<< "Embedder initialization must occur on the main platform thread";
auto command_line = InitializedCommandLine();
@@ -52,7 +52,7 @@ class EmbedderState {
~EmbedderState() {}
private:
FTL_DISALLOW_COPY_AND_ASSIGN(EmbedderState);
FXL_DISALLOW_COPY_AND_ASSIGN(EmbedderState);
};
void PlatformMacMain(std::string icu_data_path, std::string application_library_path) {
@@ -92,7 +92,7 @@ static bool FlagsValidForCommandLineLaunch(const std::string& bundle_path,
return true;
}
static std::string ResolveCommandLineLaunchFlag(const ftl::StringView name) {
static std::string ResolveCommandLineLaunchFlag(const fxl::StringView name) {
const auto& command_line = shell::Shell::Shared().GetCommandLine();
std::string command_line_option;

View File

@@ -30,7 +30,7 @@ source_set("mac_desktop_platform") {
"//flutter/shell/platform/darwin/common",
"//flutter/shell/testing",
"//flutter/synchronization",
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
"//third_party/skia",
]
}

View File

@@ -14,8 +14,8 @@
#include "flutter/shell/platform/darwin/common/platform_mac.h"
#include "flutter/shell/platform/darwin/common/process_info_mac.h"
#include "flutter/shell/platform/darwin/desktop/vsync_waiter_mac.h"
#include "lib/ftl/command_line.h"
#include "lib/ftl/synchronization/waitable_event.h"
#include "lib/fxl/command_line.h"
#include "lib/fxl/synchronization/waitable_event.h"
namespace shell {
@@ -146,7 +146,7 @@ bool PlatformViewMac::IsValid() const {
void PlatformViewMac::RunFromSource(const std::string& assets_directory,
const std::string& main,
const std::string& packages) {
auto latch = new ftl::ManualResetWaitableEvent();
auto latch = new fxl::ManualResetWaitableEvent();
dispatch_async(dispatch_get_main_queue(), ^{
SetupAndLoadFromSource(assets_directory, main, packages);

View File

@@ -75,7 +75,7 @@ shared_library("flutter_framework_dylib") {
"//flutter/shell/platform/darwin/common",
"//flutter/sky/engine/platform",
"//flutter/sky/engine/wtf",
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
"//third_party/skia",
]
if (flutter_runtime_mode == "debug") {

View File

@@ -4,7 +4,7 @@
#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h"
#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h"
#include "lib/ftl/logging.h"
#include "lib/fxl/logging.h"
@interface FlutterAppDelegate ()
@property(readonly, nonatomic) NSMutableArray* pluginDelegates;
@@ -74,7 +74,7 @@
_debugBackgroundTask = [application
beginBackgroundTaskWithName:@"Flutter debug task"
expirationHandler:^{
FTL_LOG(WARNING)
FXL_LOG(WARNING)
<< "\nThe OS has terminated the Flutter debug connection for being "
"inactive in the background for too long.\n\n"
"There are no errors with your Flutter application.\n\n"

View File

@@ -10,9 +10,9 @@
#include "flutter/shell/common/switches.h"
#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h"
#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h"
#include "lib/ftl/strings/string_view.h"
#include "lib/fxl/strings/string_view.h"
static NSURL* URLForSwitch(const ftl::StringView name) {
static NSURL* URLForSwitch(const fxl::StringView name) {
const auto& cmd = shell::Shell::Shared().GetCommandLine();
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];

View File

@@ -9,7 +9,7 @@
#include "flutter/flow/layers/layer_tree.h"
#include "flutter/shell/common/rasterizer.h"
#include "flutter/shell/common/shell.h"
#include "lib/ftl/synchronization/waitable_event.h"
#include "lib/fxl/synchronization/waitable_event.h"
#include "third_party/skia/include/utils/mac/SkCGUtils.h"
@interface FlutterView ()<UIInputViewAudioFeedback>
@@ -43,7 +43,7 @@
return YES;
}
void SnapshotRasterizer(ftl::WeakPtr<shell::Rasterizer> rasterizer,
void SnapshotRasterizer(fxl::WeakPtr<shell::Rasterizer> rasterizer,
CGContextRef context,
bool is_opaque) {
if (!rasterizer) {
@@ -94,7 +94,7 @@ void SnapshotContents(CGContextRef context, bool is_opaque) {
// platform view. So use that. Once we support multiple platform views, the
// shell will need to provide a way to get the rasterizer for a specific
// platform view.
std::vector<ftl::WeakPtr<shell::Rasterizer>> registered_rasterizers;
std::vector<fxl::WeakPtr<shell::Rasterizer>> registered_rasterizers;
shell::Shell::Shared().GetRasterizers(&registered_rasterizers);
for (auto& rasterizer : registered_rasterizers) {
SnapshotRasterizer(rasterizer, context, is_opaque);
@@ -108,7 +108,7 @@ void SnapshotContentsSync(CGContextRef context, UIView* view) {
return;
}
ftl::AutoResetWaitableEvent latch;
fxl::AutoResetWaitableEvent latch;
gpu_thread->PostTask([&latch, context, view]() {
SnapshotContents(context, [view isOpaque]);
latch.Signal();

View File

@@ -20,8 +20,8 @@
#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.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/make_copyable.h"
#include "lib/ftl/time/time_delta.h"
#include "lib/fxl/functional/make_copyable.h"
#include "lib/fxl/time/time_delta.h"
namespace {
@@ -32,17 +32,17 @@ class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse {
public:
void Complete(std::vector<uint8_t> data) override {
ftl::RefPtr<PlatformMessageResponseDarwin> self(this);
fxl::RefPtr<PlatformMessageResponseDarwin> self(this);
blink::Threads::Platform()->PostTask(
ftl::MakeCopyable([ self, data = std::move(data) ]() mutable {
fxl::MakeCopyable([ self, data = std::move(data) ]() mutable {
self->callback_.get()(shell::GetNSDataFromVector(data));
}));
}
void CompleteEmpty() override {
ftl::RefPtr<PlatformMessageResponseDarwin> self(this);
fxl::RefPtr<PlatformMessageResponseDarwin> self(this);
blink::Threads::Platform()->PostTask(
ftl::MakeCopyable([self]() mutable { self->callback_.get()(nil); }));
fxl::MakeCopyable([self]() mutable { self->callback_.get()(nil); }));
}
private:
@@ -311,7 +311,7 @@ class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse {
#pragma mark - Surface creation and teardown updates
- (void)surfaceUpdated:(BOOL)appeared {
FTL_CHECK(_platformView != nullptr);
FXL_CHECK(_platformView != nullptr);
// NotifyCreated/NotifyDestroyed are synchronous and require hops between the UI and GPU thread.
if (appeared) {
@@ -459,7 +459,7 @@ static inline blink::PointerData::DeviceKind DeviceKindFromTouchType(UITouch* to
break;
}
FTL_DCHECK(device_id != 0);
FXL_DCHECK(device_id != 0);
CGPoint windowCoordinates = [touch locationInView:nil];
blink::PointerData pointer_data;
@@ -533,7 +533,7 @@ static inline blink::PointerData::DeviceKind DeviceKindFromTouchType(UITouch* to
packet->SetPointerData(i++, pointer_data);
}
blink::Threads::UI()->PostTask(ftl::MakeCopyable(
blink::Threads::UI()->PostTask(fxl::MakeCopyable(
[ engine = _platformView->engine().GetWeakPtr(), packet = std::move(packet) ] {
if (engine.get())
engine->DispatchPointerDataPacket(*packet);
@@ -752,14 +752,14 @@ constexpr CGFloat kStandardStatusBarHeight = 20.0;
message:(NSData*)message
binaryReply:(FlutterBinaryReply)callback {
NSAssert(channel, @"The channel must not be null");
ftl::RefPtr<PlatformMessageResponseDarwin> response =
fxl::RefPtr<PlatformMessageResponseDarwin> response =
(callback == nil) ? nullptr
: ftl::MakeRefCounted<PlatformMessageResponseDarwin>(^(NSData* reply) {
: fxl::MakeRefCounted<PlatformMessageResponseDarwin>(^(NSData* reply) {
callback(reply);
});
ftl::RefPtr<blink::PlatformMessage> platformMessage =
(message == nil) ? ftl::MakeRefCounted<blink::PlatformMessage>(channel.UTF8String, response)
: ftl::MakeRefCounted<blink::PlatformMessage>(
fxl::RefPtr<blink::PlatformMessage> platformMessage =
(message == nil) ? fxl::MakeRefCounted<blink::PlatformMessage>(channel.UTF8String, response)
: fxl::MakeRefCounted<blink::PlatformMessage>(
channel.UTF8String, shell::GetVectorFromNSData(message), response);
_platformView->DispatchPlatformMessage(platformMessage);
}

View File

@@ -10,7 +10,7 @@
#import <UIKit/UIKit.h>
#include "flutter/shell/platform/darwin/ios/platform_view_ios.h"
#include "lib/ftl/logging.h"
#include "lib/fxl/logging.h"
namespace {
@@ -35,7 +35,7 @@ blink::SemanticsAction GetSemanticsActionForScrollDirection(
case UIAccessibilityScrollDirectionDown:
return blink::SemanticsAction::kScrollUp;
}
FTL_DCHECK(false); // Unreachable
FXL_DCHECK(false); // Unreachable
return blink::SemanticsAction::kScrollUp;
}
@@ -69,8 +69,8 @@ bool GeometryComparator(SemanticsObject* a, SemanticsObject* b) {
#pragma mark - Designated initializers
- (instancetype)initWithBridge:(shell::AccessibilityBridge*)bridge uid:(int32_t)uid {
FTL_DCHECK(bridge != nil) << "bridge must be set";
FTL_DCHECK(uid >= kRootNodeId);
FXL_DCHECK(bridge != nil) << "bridge must be set";
FXL_DCHECK(uid >= kRootNodeId);
self = [super init];
if (self) {

View File

@@ -14,8 +14,8 @@ PlatformMessageRouter::PlatformMessageRouter() = default;
PlatformMessageRouter::~PlatformMessageRouter() = default;
void PlatformMessageRouter::HandlePlatformMessage(ftl::RefPtr<blink::PlatformMessage> message) {
ftl::RefPtr<blink::PlatformMessageResponse> completer = message->response();
void PlatformMessageRouter::HandlePlatformMessage(fxl::RefPtr<blink::PlatformMessage> message) {
fxl::RefPtr<blink::PlatformMessageResponse> completer = message->response();
auto it = message_handlers_.find(message->channel());
if (it != message_handlers_.end()) {
FlutterBinaryMessageHandler handler = it->second;

View File

@@ -12,7 +12,7 @@
#include "flutter/common/threads.h"
#include "flutter/glue/trace_event.h"
#include "lib/ftl/logging.h"
#include "lib/fxl/logging.h"
@interface VSyncClient : NSObject
@@ -41,16 +41,16 @@
}
- (void)await:(shell::VsyncWaiter::Callback)callback {
FTL_DCHECK(!_pendingCallback);
FXL_DCHECK(!_pendingCallback);
_pendingCallback = std::move(callback);
_displayLink.paused = NO;
}
- (void)onDisplayLink:(CADisplayLink*)link {
// ftl::TimePoint and CATimeInterval both use mach_absolute_time.
ftl::TimePoint frame_start_time = ftl::TimePoint::Now();
ftl::TimePoint frame_target_time =
ftl::TimePoint::FromEpochDelta(ftl::TimeDelta::FromSecondsF(link.targetTimestamp));
// fxl::TimePoint and CATimeInterval both use mach_absolute_time.
fxl::TimePoint frame_start_time = fxl::TimePoint::Now();
fxl::TimePoint frame_target_time =
fxl::TimePoint::FromEpochDelta(fxl::TimeDelta::FromSecondsF(link.targetTimestamp));
_displayLink.paused = YES;

View File

@@ -10,7 +10,7 @@
#include "flutter/fml/platform/darwin/cf_utils.h"
#include "flutter/fml/trace_event.h"
#include "lib/ftl/logging.h"
#include "lib/fxl/logging.h"
#include "third_party/skia/include/utils/mac/SkCGUtils.h"
namespace shell {

View File

@@ -13,7 +13,7 @@
#include "flutter/shell/gpu/gpu_rasterizer.h"
#include "flutter/shell/platform/darwin/common/process_info_mac.h"
#include "flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h"
#include "lib/ftl/synchronization/waitable_event.h"
#include "lib/fxl/synchronization/waitable_event.h"
namespace shell {
@@ -29,7 +29,7 @@ void PlatformViewIOS::Attach() {
Attach(NULL);
}
void PlatformViewIOS::Attach(ftl::Closure firstFrameCallback) {
void PlatformViewIOS::Attach(fxl::Closure firstFrameCallback) {
CreateEngine();
PostAddToShellTask();
if (firstFrameCallback) {
@@ -68,7 +68,7 @@ void PlatformViewIOS::SetupAndLoadFromSource(const std::string& assets_directory
});
}
ftl::WeakPtr<PlatformViewIOS> PlatformViewIOS::GetWeakPtr() {
fxl::WeakPtr<PlatformViewIOS> PlatformViewIOS::GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
@@ -96,14 +96,14 @@ void PlatformViewIOS::UpdateSemantics(std::vector<blink::SemanticsNode> update)
accessibility_bridge_->UpdateSemantics(std::move(update));
}
void PlatformViewIOS::HandlePlatformMessage(ftl::RefPtr<blink::PlatformMessage> message) {
void PlatformViewIOS::HandlePlatformMessage(fxl::RefPtr<blink::PlatformMessage> message) {
platform_message_router_.HandlePlatformMessage(std::move(message));
}
void PlatformViewIOS::RunFromSource(const std::string& assets_directory,
const std::string& main,
const std::string& packages) {
auto latch = new ftl::ManualResetWaitableEvent();
auto latch = new fxl::ManualResetWaitableEvent();
dispatch_async(dispatch_get_main_queue(), ^{
SetupAndLoadFromSource(assets_directory, main, packages);

View File

@@ -18,7 +18,7 @@ source_set("embedder") {
"//flutter/fml",
"//flutter/shell/common",
"//flutter/shell/gpu",
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
"//lib/tonic",
"//third_party/skia",
]

View File

@@ -16,7 +16,7 @@ executable("linux") {
"//flutter/fml",
"//flutter/shell/common",
"//flutter/shell/testing",
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
"//lib/tonic",
"//third_party/skia",
]

View File

@@ -15,7 +15,7 @@ source_set("testing") {
deps = [
"//flutter/common",
"//flutter/shell/common",
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
"//third_party/skia",
]
}

View File

@@ -13,7 +13,7 @@ source_set("synchronization") {
public_deps = [
"//flutter/glue",
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
]
}

View File

@@ -114,7 +114,7 @@ source_set("txt") {
public_configs = [ ":txt_config" ]
public_deps = [
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
"//third_party/harfbuzz",
"//third_party/icu",
"//third_party/skia",

View File

@@ -58,7 +58,7 @@ source_set("vulkan") {
}
deps = [
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
"//third_party/skia",
"//third_party/skia:gpu",
]