Skip to content

Commit

Permalink
Rename Magenta to Zircon, along with associated abbreviations (flutte…
Browse files Browse the repository at this point in the history
  • Loading branch information
George Kulakowski authored Sep 15, 2017
1 parent 0c1e217 commit 550d0c6
Show file tree
Hide file tree
Showing 18 changed files with 96 additions and 98 deletions.
2 changes: 1 addition & 1 deletion content_handler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ template("flutter_content_handler") {
"//garnet/public/lib/fsl",
"//garnet/public/lib/zip",
"//lib/tonic",
"//magenta/system/ulib/trace-provider",
"//zircon/system/ulib/trace-provider",
"//magma:vulkan",
"//third_party/rapidjson",
"//third_party/skia",
Expand Down
6 changes: 3 additions & 3 deletions content_handler/app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ void App::UpdateProcessLabel() {
label = base_label_;
} else {
std::string suffix = " (+" + std::to_string(controllers_.size() - 1) + ")";
if (base_label_.size() + suffix.size() <= MX_MAX_NAME_LEN - 1) {
if (base_label_.size() + suffix.size() <= ZX_MAX_NAME_LEN - 1) {
label = base_label_ + suffix;
} else {
label = base_label_.substr(0, MX_MAX_NAME_LEN - 1 - suffix.size() - 3) +
label = base_label_.substr(0, ZX_MAX_NAME_LEN - 1 - suffix.size() - 3) +
"..." + suffix;
}
}
mx::process::self().set_property(MX_PROP_NAME, label.c_str(), label.size());
zx::process::self().set_property(ZX_PROP_NAME, label.c_str(), label.size());
}

} // namespace flutter_runner
32 changes: 16 additions & 16 deletions content_handler/application_controller_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include <utility>

#include <magenta/status.h>
#include <mxio/namespace.h>
#include <fdio/namespace.h>
#include <zircon/status.h>

#include "flutter/content_handler/app.h"
#include "flutter/content_handler/runtime_holder.h"
Expand Down Expand Up @@ -59,27 +59,27 @@ ApplicationControllerImpl::ApplicationControllerImpl(
auto request = service_provider.NewRequest();
service_provider_bridge_.set_backend(std::move(service_provider));

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

url_ = startup_info->launch_info->url;
runtime_holder_.reset(new RuntimeHolder());
runtime_holder_->Init(
mxio_ns, app::ApplicationContext::CreateFrom(std::move(startup_info)),
fdio_ns, app::ApplicationContext::CreateFrom(std::move(startup_info)),
std::move(request), std::move(bundle));
}

ApplicationControllerImpl::~ApplicationControllerImpl() = default;

constexpr char kServiceRootPath[] = "/svc";

mxio_ns_t* ApplicationControllerImpl::SetupNamespace(
fdio_ns_t* ApplicationControllerImpl::SetupNamespace(
const app::FlatNamespacePtr& flat) {
mxio_ns_t* mxio_namespc;
mx_status_t status = mxio_ns_create(&mxio_namespc);
if (status != MX_OK) {
fdio_ns_t* fdio_namespc;
zx_status_t status = fdio_ns_create(&fdio_namespc);
if (status != ZX_OK) {
FXL_LOG(ERROR) << "Failed to create namespace";
return nullptr;
}
Expand All @@ -88,18 +88,18 @@ mxio_ns_t* ApplicationControllerImpl::SetupNamespace(
// Ownership of /svc goes to the ApplicationContext created above.
continue;
}
mx::channel dir = std::move(flat->directories[i]);
mx_handle_t dir_handle = dir.release();
zx::channel dir = std::move(flat->directories[i]);
zx_handle_t dir_handle = dir.release();
const char* path = flat->paths[i].data();
status = mxio_ns_bind(mxio_namespc, path, dir_handle);
if (status != MX_OK) {
status = fdio_ns_bind(fdio_namespc, path, dir_handle);
if (status != ZX_OK) {
FXL_LOG(ERROR) << "Failed to bind " << flat->paths[i] << " to namespace";
mx_handle_close(dir_handle);
mxio_ns_destroy(mxio_namespc);
zx_handle_close(dir_handle);
fdio_ns_destroy(fdio_namespc);
return nullptr;
}
}
return mxio_namespc;
return fdio_namespc;
}

void ApplicationControllerImpl::Kill() {
Expand Down
4 changes: 2 additions & 2 deletions content_handler/application_controller_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <memory>

#include <mxio/namespace.h>
#include <fdio/namespace.h>

#include "dart/runtime/include/dart_api.h"
#include "lib/app/fidl/application_controller.fidl.h"
Expand Down Expand Up @@ -54,7 +54,7 @@ class ApplicationControllerImpl : public app::ApplicationController,
void StartRuntimeIfReady();
void SendReturnCode(int32_t return_code);

mxio_ns_t* SetupNamespace(const app::FlatNamespacePtr& flat);
fdio_ns_t* SetupNamespace(const app::FlatNamespacePtr& flat);

App* app_;
fidl::Binding<app::ApplicationController> binding_;
Expand Down
4 changes: 2 additions & 2 deletions content_handler/rasterizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "lib/fxl/functional/closure.h"
#include "lib/fxl/macros.h"
#include "lib/ui/scenic/fidl/session.fidl.h"
#include "magenta/system/ulib/mx/include/mx/eventpair.h"
#include "zircon/system/ulib/zx/include/zx/eventpair.h"

namespace flutter_runner {

Expand All @@ -23,7 +23,7 @@ class Rasterizer {

virtual void SetScene(
fidl::InterfaceHandle<scenic::SceneManager> scene_manager,
mx::eventpair import_token,
zx::eventpair import_token,
fxl::Closure metrics_changed_callback) = 0;

virtual void Draw(std::unique_ptr<flow::LayerTree> layer_tree,
Expand Down
14 changes: 7 additions & 7 deletions content_handler/runtime_holder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include "flutter/content_handler/runtime_holder.h"

#include <dlfcn.h>
#include <magenta/dlfcn.h>
#include <mxio/namespace.h>
#include <fdio/namespace.h>
#include <zircon/dlfcn.h>
#include <utility>

#include "dart-pkg/zircon/sdk_ext/handle.h"
Expand Down Expand Up @@ -94,7 +94,7 @@ RuntimeHolder::~RuntimeHolder() {
}

void RuntimeHolder::Init(
mxio_ns_t* namespc,
fdio_ns_t* namespc,
std::unique_ptr<app::ApplicationContext> context,
fidl::InterfaceRequest<app::ServiceProvider> outgoing_services,
std::vector<char> bundle) {
Expand Down Expand Up @@ -126,7 +126,7 @@ void RuntimeHolder::Init(
return;
}

mx::vmo dylib_vmo;
zx::vmo dylib_vmo;
if (!fsl::VmoFromVector(dylib_blob, &dylib_vmo)) {
FXL_LOG(ERROR) << "Failed to load app dylib";
return;
Expand Down Expand Up @@ -184,9 +184,9 @@ void RuntimeHolder::CreateView(
}

// Create the view.
mx::eventpair import_token, export_token;
mx_status_t status = mx::eventpair::create(0u, &import_token, &export_token);
if (status != MX_OK) {
zx::eventpair import_token, export_token;
zx_status_t status = zx::eventpair::create(0u, &import_token, &export_token);
if (status != ZX_OK) {
FXL_LOG(ERROR) << "Could not create an event pair.";
return;
}
Expand Down
8 changes: 4 additions & 4 deletions content_handler/runtime_holder.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#ifndef FLUTTER_CONTENT_HANDLER_RUNTIME_HOLDER_H_
#define FLUTTER_CONTENT_HANDLER_RUNTIME_HOLDER_H_

#include <mx/channel.h>
#include <mxio/namespace.h>
#include <fdio/namespace.h>
#include <zx/channel.h>

#include <unordered_set>

Expand Down Expand Up @@ -41,7 +41,7 @@ class RuntimeHolder : public blink::RuntimeDelegate,
RuntimeHolder();
~RuntimeHolder();

void Init(mxio_ns_t* namespc,
void Init(fdio_ns_t* namespc,
std::unique_ptr<app::ApplicationContext> context,
fidl::InterfaceRequest<app::ServiceProvider> outgoing_services,
std::vector<char> bundle);
Expand Down Expand Up @@ -98,7 +98,7 @@ class RuntimeHolder : public blink::RuntimeDelegate,
void OnRedrawFrame();
void Invalidate();

mxio_ns_t* namespc_;
fdio_ns_t* namespc_;
std::unique_ptr<app::ApplicationContext> context_;
fidl::InterfaceRequest<app::ServiceProvider> outgoing_services_;
std::vector<char> root_bundle_data_;
Expand Down
2 changes: 1 addition & 1 deletion content_handler/session_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace flutter_runner {

SessionConnection::SessionConnection(scenic::SceneManagerPtr scene_manager,
mx::eventpair import_token)
zx::eventpair import_token)
: session_(scene_manager.get()),
root_node_(&session_),
surface_producer_(std::make_unique<VulkanSurfaceProducer>(&session_)),
Expand Down
4 changes: 2 additions & 2 deletions content_handler/session_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
#include "lib/fxl/macros.h"
#include "lib/ui/scenic/client/resources.h"
#include "lib/ui/scenic/client/session.h"
#include "magenta/system/ulib/mx/include/mx/eventpair.h"
#include "zircon/system/ulib/zx/include/zx/eventpair.h"

namespace flutter_runner {

class SessionConnection {
public:
SessionConnection(scenic::SceneManagerPtr scene_manager,
mx::eventpair import_token);
zx::eventpair import_token);

~SessionConnection();

Expand Down
18 changes: 9 additions & 9 deletions content_handler/vulkan_rasterizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#include "flutter/content_handler/vulkan_rasterizer.h"

#include <fcntl.h>
#include <magenta/device/vfs.h>
#include <mxio/watcher.h>
#include <fdio/watcher.h>
#include <unistd.h>
#include <zircon/device/vfs.h>

#include <chrono>
#include <thread>
Expand All @@ -21,14 +21,14 @@ namespace flutter_runner {

constexpr char kDisplayDriverClass[] = "/dev/class/display";

static mx_status_t DriverWatcher(int dirfd,
static zx_status_t DriverWatcher(int dirfd,
int event,
const char* fn,
void* cookie) {
if (event == WATCH_EVENT_ADD_FILE && !strcmp(fn, "000")) {
return MX_ERR_STOP;
return ZX_ERR_STOP;
}
return MX_OK;
return ZX_OK;
}

bool WaitForFirstDisplayDriver() {
Expand All @@ -38,9 +38,9 @@ bool WaitForFirstDisplayDriver() {
return false;
}

mx_status_t status = mxio_watch_directory(
fd.get(), DriverWatcher, mx_deadline_after(MX_SEC(1)), nullptr);
return status == MX_ERR_STOP;
zx_status_t status = fdio_watch_directory(
fd.get(), DriverWatcher, zx_deadline_after(ZX_SEC(1)), nullptr);
return status == ZX_ERR_STOP;
}

VulkanRasterizer::VulkanRasterizer() : compositor_context_(nullptr) {
Expand All @@ -55,7 +55,7 @@ bool VulkanRasterizer::IsValid() const {

void VulkanRasterizer::SetScene(
fidl::InterfaceHandle<scenic::SceneManager> scene_manager,
mx::eventpair import_token,
zx::eventpair import_token,
fxl::Closure metrics_changed_callback) {
ASSERT_IS_GPU_THREAD;
FXL_DCHECK(valid_ && !session_connection_);
Expand Down
2 changes: 1 addition & 1 deletion content_handler/vulkan_rasterizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class VulkanRasterizer : public Rasterizer {
bool IsValid() const;

void SetScene(fidl::InterfaceHandle<scenic::SceneManager> scene_manager,
mx::eventpair import_token,
zx::eventpair import_token,
fxl::Closure metrics_changed_callback) override;

void Draw(std::unique_ptr<flow::LayerTree> layer_tree,
Expand Down
Loading

0 comments on commit 550d0c6

Please sign in to comment.