Skip to content

Commit

Permalink
Rename ftl to fxl in Fuchsia specific code (flutter#4090)
Browse files Browse the repository at this point in the history
  • Loading branch information
George Kulakowski authored Sep 11, 2017
1 parent 3b2b2f9 commit 3aa7522
Show file tree
Hide file tree
Showing 326 changed files with 1,507 additions and 1,507 deletions.
10 changes: 5 additions & 5 deletions assets/directory_asset_bundle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

#include <utility>

#include "lib/ftl/files/eintr_wrapper.h"
#include "lib/ftl/files/file.h"
#include "lib/ftl/files/path.h"
#include "lib/ftl/files/unique_fd.h"
#include "lib/fxl/files/eintr_wrapper.h"
#include "lib/fxl/files/file.h"
#include "lib/fxl/files/path.h"
#include "lib/fxl/files/unique_fd.h"

namespace blink {

Expand All @@ -33,7 +33,7 @@ std::string DirectoryAssetBundle::GetPathForAsset(
const std::string& asset_name) {
std::string asset_path = files::SimplifyPath(directory_ + "/" + asset_name);
if (asset_path.find(directory_) != 0u) {
FTL_LOG(ERROR) << "Asset name '" << asset_name
FXL_LOG(ERROR) << "Asset name '" << asset_name
<< "' attempted to traverse outside asset bundle.";
return std::string();
}
Expand Down
4 changes: 2 additions & 2 deletions assets/directory_asset_bundle.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <string>
#include <vector>

#include "lib/ftl/macros.h"
#include "lib/fxl/macros.h"

namespace blink {

Expand All @@ -24,7 +24,7 @@ class DirectoryAssetBundle {

const std::string directory_;

FTL_DISALLOW_COPY_AND_ASSIGN(DirectoryAssetBundle);
FXL_DISALLOW_COPY_AND_ASSIGN(DirectoryAssetBundle);
};

} // namespace blink
Expand Down
4 changes: 2 additions & 2 deletions assets/unzipper_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "flutter/assets/unzipper_provider.h"

#include "lib/ftl/logging.h"
#include "lib/fxl/logging.h"
#include "third_party/zlib/contrib/minizip/unzip.h"

namespace blink {
Expand All @@ -13,7 +13,7 @@ UnzipperProvider GetUnzipperProviderForPath(std::string zip_path) {
return [zip_path]() {
zip::UniqueUnzipper unzipper(unzOpen2(zip_path.c_str(), nullptr));
if (!unzipper.is_valid())
FTL_LOG(ERROR) << "Unable to open zip file: " << zip_path;
FXL_LOG(ERROR) << "Unable to open zip file: " << zip_path;
return unzipper;
};
}
Expand Down
8 changes: 4 additions & 4 deletions assets/zip_asset_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <string>
#include <utility>

#include "lib/ftl/files/eintr_wrapper.h"
#include "lib/ftl/files/unique_fd.h"
#include "lib/fxl/files/eintr_wrapper.h"
#include "lib/fxl/files/unique_fd.h"
#include "flutter/glue/trace_event.h"
#include "lib/zip/unique_unzipper.h"

Expand Down Expand Up @@ -43,13 +43,13 @@ bool ZipAssetStore::GetAsBuffer(const std::string& asset_name,

result = unzGoToFilePos(unzipper.get(), &(found->second.file_pos));
if (result != UNZ_OK) {
FTL_LOG(WARNING) << "unzGetCurrentFileInfo failed, error=" << result;
FXL_LOG(WARNING) << "unzGetCurrentFileInfo failed, error=" << result;
return false;
}

result = unzOpenCurrentFile(unzipper.get());
if (result != UNZ_OK) {
FTL_LOG(WARNING) << "unzOpenCurrentFile failed, error=" << result;
FXL_LOG(WARNING) << "unzOpenCurrentFile failed, error=" << result;
return false;
}

Expand Down
8 changes: 4 additions & 4 deletions assets/zip_asset_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
#include <vector>

#include "flutter/assets/unzipper_provider.h"
#include "lib/ftl/macros.h"
#include "lib/ftl/memory/ref_counted.h"
#include "lib/fxl/macros.h"
#include "lib/fxl/memory/ref_counted.h"
#include "third_party/zlib/contrib/minizip/unzip.h"

namespace blink {

class ZipAssetStore : public ftl::RefCountedThreadSafe<ZipAssetStore> {
class ZipAssetStore : public fxl::RefCountedThreadSafe<ZipAssetStore> {
public:
explicit ZipAssetStore(UnzipperProvider unzipper_provider);
~ZipAssetStore();
Expand All @@ -35,7 +35,7 @@ class ZipAssetStore : public ftl::RefCountedThreadSafe<ZipAssetStore> {

void BuildStatCache();

FTL_DISALLOW_COPY_AND_ASSIGN(ZipAssetStore);
FXL_DISALLOW_COPY_AND_ASSIGN(ZipAssetStore);
};

} // namespace blink
Expand Down
6 changes: 3 additions & 3 deletions common/settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <memory>

#include "lib/ftl/logging.h"
#include "lib/fxl/logging.h"

namespace blink {
namespace {
Expand All @@ -16,12 +16,12 @@ Settings* g_settings = nullptr;
} // namespace

const Settings& Settings::Get() {
FTL_CHECK(g_settings);
FXL_CHECK(g_settings);
return *g_settings;
}

void Settings::Set(const Settings& settings) {
FTL_CHECK(!g_settings);
FXL_CHECK(!g_settings);
g_settings = new Settings();
*g_settings = settings;
}
Expand Down
20 changes: 10 additions & 10 deletions common/threads.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,40 @@ Threads* g_threads = nullptr;

Threads::Threads() {}

Threads::Threads(ftl::RefPtr<ftl::TaskRunner> platform,
ftl::RefPtr<ftl::TaskRunner> gpu,
ftl::RefPtr<ftl::TaskRunner> ui,
ftl::RefPtr<ftl::TaskRunner> io)
Threads::Threads(fxl::RefPtr<fxl::TaskRunner> platform,
fxl::RefPtr<fxl::TaskRunner> gpu,
fxl::RefPtr<fxl::TaskRunner> ui,
fxl::RefPtr<fxl::TaskRunner> io)
: platform_(std::move(platform)),
gpu_(std::move(gpu)),
ui_(std::move(ui)),
io_(std::move(io)) {}

Threads::~Threads() {}

const ftl::RefPtr<ftl::TaskRunner>& Threads::Platform() {
const fxl::RefPtr<fxl::TaskRunner>& Threads::Platform() {
return Get().platform_;
}

const ftl::RefPtr<ftl::TaskRunner>& Threads::Gpu() {
const fxl::RefPtr<fxl::TaskRunner>& Threads::Gpu() {
return Get().gpu_;
}

const ftl::RefPtr<ftl::TaskRunner>& Threads::UI() {
const fxl::RefPtr<fxl::TaskRunner>& Threads::UI() {
return Get().ui_;
}

const ftl::RefPtr<ftl::TaskRunner>& Threads::IO() {
const fxl::RefPtr<fxl::TaskRunner>& Threads::IO() {
return Get().io_;
}

const Threads& Threads::Get() {
FTL_CHECK(g_threads);
FXL_CHECK(g_threads);
return *g_threads;
}

void Threads::Set(const Threads& threads) {
FTL_CHECK(!g_threads);
FXL_CHECK(!g_threads);
g_threads = new Threads();
*g_threads = threads;
}
Expand Down
34 changes: 17 additions & 17 deletions common/threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,42 @@
#ifndef FLUTTER_COMMON_THREADS_H_
#define FLUTTER_COMMON_THREADS_H_

#include "lib/ftl/tasks/task_runner.h"
#include "lib/fxl/tasks/task_runner.h"

#define ASSERT_IS_PLATFORM_THREAD \
FTL_DCHECK(::blink::Threads::Platform()->RunsTasksOnCurrentThread());
FXL_DCHECK(::blink::Threads::Platform()->RunsTasksOnCurrentThread());
#define ASSERT_IS_GPU_THREAD \
FTL_DCHECK(::blink::Threads::Gpu()->RunsTasksOnCurrentThread());
FXL_DCHECK(::blink::Threads::Gpu()->RunsTasksOnCurrentThread());
#define ASSERT_IS_UI_THREAD \
FTL_DCHECK(::blink::Threads::UI()->RunsTasksOnCurrentThread());
FXL_DCHECK(::blink::Threads::UI()->RunsTasksOnCurrentThread());
#define ASSERT_IS_IO_THREAD \
FTL_DCHECK(::blink::Threads::IO()->RunsTasksOnCurrentThread());
FXL_DCHECK(::blink::Threads::IO()->RunsTasksOnCurrentThread());

namespace blink {

class Threads {
public:
Threads();
Threads(ftl::RefPtr<ftl::TaskRunner> platform,
ftl::RefPtr<ftl::TaskRunner> gpu,
ftl::RefPtr<ftl::TaskRunner> ui,
ftl::RefPtr<ftl::TaskRunner> io);
Threads(fxl::RefPtr<fxl::TaskRunner> platform,
fxl::RefPtr<fxl::TaskRunner> gpu,
fxl::RefPtr<fxl::TaskRunner> ui,
fxl::RefPtr<fxl::TaskRunner> io);
~Threads();

static const ftl::RefPtr<ftl::TaskRunner>& Platform();
static const ftl::RefPtr<ftl::TaskRunner>& Gpu();
static const ftl::RefPtr<ftl::TaskRunner>& UI();
static const ftl::RefPtr<ftl::TaskRunner>& IO();
static const fxl::RefPtr<fxl::TaskRunner>& Platform();
static const fxl::RefPtr<fxl::TaskRunner>& Gpu();
static const fxl::RefPtr<fxl::TaskRunner>& UI();
static const fxl::RefPtr<fxl::TaskRunner>& IO();

static void Set(const Threads& settings);

private:
static const Threads& Get();

ftl::RefPtr<ftl::TaskRunner> platform_;
ftl::RefPtr<ftl::TaskRunner> gpu_;
ftl::RefPtr<ftl::TaskRunner> ui_;
ftl::RefPtr<ftl::TaskRunner> io_;
fxl::RefPtr<fxl::TaskRunner> platform_;
fxl::RefPtr<fxl::TaskRunner> gpu_;
fxl::RefPtr<fxl::TaskRunner> ui_;
fxl::RefPtr<fxl::TaskRunner> io_;
};

} // namespace blink
Expand Down
2 changes: 1 addition & 1 deletion content_handler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ template("flutter_content_handler") {
"//flutter/sky/engine/platform",
"//flutter/vulkan",
"//garnet/public/dart-pkg/fuchsia",
"//garnet/public/lib/ftl",
"//garnet/public/lib/fxl",
"//garnet/public/lib/icu_data/cpp",
"//garnet/public/lib/mtl",
"//garnet/public/lib/zip",
Expand Down
16 changes: 8 additions & 8 deletions content_handler/app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include "flutter/common/settings.h"
#include "flutter/common/threads.h"
#include "flutter/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.h"
#include "lib/ftl/macros.h"
#include "lib/ftl/tasks/task_runner.h"
#include "lib/fxl/macros.h"
#include "lib/fxl/tasks/task_runner.h"
#include "lib/icu_data/cpp/icu_data.h"
#include "lib/mtl/tasks/message_loop.h"

Expand Down Expand Up @@ -43,8 +43,8 @@ App::App() {
auto gpu_thread_success = gpu_thread_->Run();
auto io_thread_success = io_thread_->Run();

FTL_CHECK(gpu_thread_success) << "Must be able to create the GPU thread";
FTL_CHECK(io_thread_success) << "Must be able to create the IO thread";
FXL_CHECK(gpu_thread_success) << "Must be able to create the GPU thread";
FXL_CHECK(io_thread_success) << "Must be able to create the IO thread";

auto ui_task_runner = mtl::MessageLoop::GetCurrent()->task_runner();
auto gpu_task_runner = gpu_thread_->TaskRunner();
Expand All @@ -58,7 +58,7 @@ App::App() {
));

if (!icu_data::Initialize(context_.get())) {
FTL_LOG(ERROR) << "Could not initialize ICU data.";
FXL_LOG(ERROR) << "Could not initialize ICU data.";
}

blink::Settings settings;
Expand All @@ -83,13 +83,13 @@ App::~App() {
}

App& App::Shared() {
FTL_DCHECK(g_app);
FXL_DCHECK(g_app);
return *g_app;
}

void App::WaitForPlatformViewIds(
std::vector<PlatformViewInfo>* platform_view_ids) {
ftl::AutoResetWaitableEvent latch;
fxl::AutoResetWaitableEvent latch;

blink::Threads::UI()->PostTask([this, platform_view_ids, &latch]() {
WaitForPlatformViewsIdsUIThread(platform_view_ids, &latch);
Expand All @@ -100,7 +100,7 @@ void App::WaitForPlatformViewIds(

void App::WaitForPlatformViewsIdsUIThread(
std::vector<PlatformViewInfo>* platform_view_ids,
ftl::AutoResetWaitableEvent* latch) {
fxl::AutoResetWaitableEvent* latch) {
for (auto it = controllers_.begin(); it != controllers_.end(); it++) {
ApplicationControllerImpl* controller = it->first;

Expand Down
8 changes: 4 additions & 4 deletions content_handler/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include "lib/app/cpp/application_context.h"
#include "lib/app/fidl/application_runner.fidl.h"
#include "flutter/content_handler/application_controller_impl.h"
#include "lib/ftl/macros.h"
#include "lib/ftl/synchronization/waitable_event.h"
#include "lib/fxl/macros.h"
#include "lib/fxl/synchronization/waitable_event.h"
#include "lib/mtl/threading/thread.h"

namespace flutter_runner {
Expand Down Expand Up @@ -44,7 +44,7 @@ class App : public app::ApplicationRunner {
private:
void WaitForPlatformViewsIdsUIThread(
std::vector<PlatformViewInfo>* platform_view_ids,
ftl::AutoResetWaitableEvent* latch);
fxl::AutoResetWaitableEvent* latch);
void UpdateProcessLabel();

std::unique_ptr<app::ApplicationContext> context_;
Expand All @@ -56,7 +56,7 @@ class App : public app::ApplicationRunner {
controllers_;
std::string base_label_;

FTL_DISALLOW_COPY_AND_ASSIGN(App);
FXL_DISALLOW_COPY_AND_ASSIGN(App);
};

} // namespace flutter_runner
Expand Down
12 changes: 6 additions & 6 deletions content_handler/application_controller_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "lib/app/cpp/connect.h"
#include "flutter/content_handler/app.h"
#include "flutter/content_handler/runtime_holder.h"
#include "lib/ftl/logging.h"
#include "lib/fxl/logging.h"
#include "lib/mtl/vmo/vector.h"

namespace flutter_runner {
Expand All @@ -33,7 +33,7 @@ ApplicationControllerImpl::ApplicationControllerImpl(

std::vector<char> bundle;
if (!mtl::VectorFromVmo(std::move(application->data), &bundle)) {
FTL_LOG(ERROR) << "Failed to receive bundle.";
FXL_LOG(ERROR) << "Failed to receive bundle.";
return;
}

Expand Down Expand Up @@ -61,7 +61,7 @@ ApplicationControllerImpl::ApplicationControllerImpl(

mxio_ns_t* mxio_ns = SetupNamespace(startup_info->flat_namespace);
if (mxio_ns == nullptr) {
FTL_LOG(ERROR) << "Failed to initialize namespace";
FXL_LOG(ERROR) << "Failed to initialize namespace";
}

url_ = startup_info->launch_info->url;
Expand All @@ -81,7 +81,7 @@ mxio_ns_t* ApplicationControllerImpl::SetupNamespace(
mxio_ns_t* mxio_namespc;
mx_status_t status = mxio_ns_create(&mxio_namespc);
if (status != MX_OK) {
FTL_LOG(ERROR) << "Failed to create namespace";
FXL_LOG(ERROR) << "Failed to create namespace";
return nullptr;
}
for (size_t i = 0; i < flat->paths.size(); ++i) {
Expand All @@ -94,7 +94,7 @@ mxio_ns_t* ApplicationControllerImpl::SetupNamespace(
const char* path = flat->paths[i].data();
status = mxio_ns_bind(mxio_namespc, path, dir_handle);
if (status != MX_OK) {
FTL_LOG(ERROR) << "Failed to bind " << flat->paths[i] << " to namespace";
FXL_LOG(ERROR) << "Failed to bind " << flat->paths[i] << " to namespace";
mx_handle_close(dir_handle);
mxio_ns_destroy(mxio_namespc);
return nullptr;
Expand All @@ -111,7 +111,7 @@ void ApplicationControllerImpl::Kill() {
}

void ApplicationControllerImpl::Detach() {
binding_.set_connection_error_handler(ftl::Closure());
binding_.set_connection_error_handler(fxl::Closure());
}

void ApplicationControllerImpl::Wait(const WaitCallback& callback) {
Expand Down
Loading

0 comments on commit 3aa7522

Please sign in to comment.