Skip to content

Commit

Permalink
Fix sundry Fuchsia build issues after the tonic/fxl migration. (flutt…
Browse files Browse the repository at this point in the history
  • Loading branch information
chinmaygarde authored Aug 1, 2018
1 parent 03a4e53 commit 33b4123
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 deletions.
2 changes: 2 additions & 0 deletions flow/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ source_set("flow") {

public_configs = [ "$flutter_root:config" ]

public_deps = []

deps = [
"$flutter_root/common",
"$flutter_root/fml",
Expand Down
1 change: 1 addition & 0 deletions flow/scene_update_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "flutter/flow/compositor_context.h"
#include "flutter/fml/build_config.h"
#include "flutter/fml/compiler_specific.h"
#include "flutter/fml/logging.h"
#include "flutter/fml/macros.h"
#include "lib/ui/scenic/cpp/resources.h"
Expand Down
4 changes: 4 additions & 0 deletions fml/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ source_set("fml") {
"unique_object.h",
]

public_deps = []

deps = [
"//third_party/dart/runtime:dart_api",

Expand Down Expand Up @@ -129,6 +131,8 @@ source_set("fml") {

if (is_fuchsia) {
sources += [ "platform/fuchsia/paths_fuchsia.cc" ]

public_deps += [ "//zircon/public/lib/trace-provider" ]
}

if (is_win) {
Expand Down
12 changes: 8 additions & 4 deletions fml/trace_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#ifndef FLUTTER_FML_TRACE_EVENT_H_
#define FLUTTER_FML_TRACE_EVENT_H_

#if defined(__Fuchsia__)
#include "flutter/fml/build_config.h"

#if defined(OS_FUCHSIA)

// Forward to the system tracing mechanism on Fuchsia.

Expand All @@ -19,14 +21,16 @@
#define TRACE_EVENT_ASYNC_BEGIN1(a, b, c, d, e) TRACE_ASYNC_BEGIN(a, b, c, d, e)
#define TRACE_EVENT_ASYNC_END1(a, b, c, d, e) TRACE_ASYNC_END(a, b, c, d, e)

#else // defined(__Fuchsia__)
#endif // defined(OS_FUCHSIA)

#include <cstddef>
#include <cstdint>
#include <string>

#include "flutter/fml/macros.h"

#if !defined(OS_FUCHSIA)

#ifndef TRACE_EVENT_HIDE_MACROS

#define TRACE_EVENT0(category_group, name) \
Expand Down Expand Up @@ -72,6 +76,8 @@

#endif // TRACE_EVENT_HIDE_MACROS

#endif // !defined(OS_FUCHSIA)

namespace fml {
namespace tracing {

Expand Down Expand Up @@ -137,6 +143,4 @@ class ScopedInstantEnd {
} // namespace tracing
} // namespace fml

#endif // defined(__Fuchsia__)

#endif // FLUTTER_FML_TRACE_EVENT_H_
1 change: 1 addition & 0 deletions lib/ui/compositing/scene_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <stdint.h>

#include "flutter/fml/build_config.h"
#include "flutter/lib/ui/dart_wrapper.h"

#if defined(OS_FUCHSIA)
Expand Down
10 changes: 5 additions & 5 deletions runtime/dart_vm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "flutter/fml/compiler_specific.h"
#include "flutter/fml/file.h"
#include "flutter/fml/logging.h"
#include "flutter/fml/mapping.h"
#include "flutter/fml/time/time_delta.h"
#include "flutter/fml/trace_event.h"
#include "flutter/lib/io/dart_io.h"
Expand Down Expand Up @@ -155,14 +156,13 @@ Dart_Handle GetVMServiceAssetsArchiveCallback() {
(FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE)
return nullptr;
#elif OS_FUCHSIA
std::vector<uint8_t> observatory_assets_archive;
if (!files::ReadFileToVector("pkg/data/observatory.tar",
&observatory_assets_archive)) {
fml::FileMapping mapping("pkg/data/observatory.tar", false /* executable */);
if (mapping.GetSize() == 0 || mapping.GetMapping() == nullptr) {
FML_LOG(ERROR) << "Fail to load Observatory archive";
return nullptr;
}
return tonic::DartConverter<tonic::Uint8List>::ToDart(
observatory_assets_archive.data(), observatory_assets_archive.size());
return tonic::DartConverter<tonic::Uint8List>::ToDart(mapping.GetMapping(),
mapping.GetSize());
#else
return tonic::DartConverter<tonic::Uint8List>::ToDart(
::dart::observatory::observatory_assets_archive,
Expand Down

0 comments on commit 33b4123

Please sign in to comment.