From fcc642e42bcad5c606837cda8dbab05dc522e27d Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Mon, 1 Aug 2016 16:27:48 -0700 Subject: [PATCH] Finish removing //base dependency from //flow (#2848) This patch introduces a //glue library that isolates our dependency on //base. This will let us clean up our //base dependencies ahead of actually being able to fully remove them. --- .gitignore | 1 + flow/BUILD.gn | 2 +- flow/layers/layer.h | 2 +- flow/layers/layer_tree.cc | 2 +- flow/raster_cache.cc | 2 +- glue/BUILD.gn | 13 +++++++++++++ glue/README.md | 5 +++++ glue/trace_event.h | 11 +++++++++++ 8 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 glue/BUILD.gn create mode 100644 glue/README.md create mode 100644 glue/trace_event.h diff --git a/.gitignore b/.gitignore index 448971caf7a..32b0e4d20cc 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,7 @@ Thumbs.db /third_party/dejavu-fonts-ttf-2.34/ttf/*.ttf /third_party/freetype-android/src /third_party/go/tool/ +/third_party/gtest/ /third_party/icu/ /third_party/jsr-305/src/ /third_party/libc++/trunk/ diff --git a/flow/BUILD.gn b/flow/BUILD.gn index aa701a2c1ee..ed6064ab2c9 100644 --- a/flow/BUILD.gn +++ b/flow/BUILD.gn @@ -46,7 +46,7 @@ source_set("flow") { ] deps = [ - "//base", + "//glue", "//lib/ftl", "//mojo/services/gfx/composition/interfaces", "//mojo/skia", diff --git a/flow/layers/layer.h b/flow/layers/layer.h index c85bc97b8b9..8e549e0c5c9 100644 --- a/flow/layers/layer.h +++ b/flow/layers/layer.h @@ -8,9 +8,9 @@ #include #include -#include "base/trace_event/trace_event.h" #include "flow/instrumentation.h" #include "flow/raster_cache.h" +#include "glue/trace_event.h" #include "lib/ftl/logging.h" #include "lib/ftl/macros.h" #include "skia/ext/refptr.h" diff --git a/flow/layers/layer_tree.cc b/flow/layers/layer_tree.cc index 18fe780fc71..f0781373226 100644 --- a/flow/layers/layer_tree.cc +++ b/flow/layers/layer_tree.cc @@ -4,7 +4,7 @@ #include "flow/layers/layer_tree.h" -#include "base/trace_event/trace_event.h" +#include "glue/trace_event.h" #include "flow/layers/layer.h" namespace flow { diff --git a/flow/raster_cache.cc b/flow/raster_cache.cc index 76484330d3b..a255eb16a97 100644 --- a/flow/raster_cache.cc +++ b/flow/raster_cache.cc @@ -4,7 +4,7 @@ #include "flow/raster_cache.h" -#include "base/trace_event/trace_event.h" +#include "glue/trace_event.h" #include "lib/ftl/logging.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkImage.h" diff --git a/glue/BUILD.gn b/glue/BUILD.gn new file mode 100644 index 00000000000..43caf415686 --- /dev/null +++ b/glue/BUILD.gn @@ -0,0 +1,13 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("glue") { + sources = [ + "trace_event.h" + ] + + deps = [ + "//base", + ] +} diff --git a/glue/README.md b/glue/README.md new file mode 100644 index 00000000000..965351d8740 --- /dev/null +++ b/glue/README.md @@ -0,0 +1,5 @@ +# Glue + +This library provides glue between Flutter and //base, which lets us isolate our +dependency on //base. Eventually, we'll drive the contents of this library to +zero and remove our dependency on //base. diff --git a/glue/trace_event.h b/glue/trace_event.h new file mode 100644 index 00000000000..468d1853495 --- /dev/null +++ b/glue/trace_event.h @@ -0,0 +1,11 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#if defined(__Fuchsia__) +#define TRACE_EVENT0(a, b) +#define TRACE_EVENT1(a, b, c, d) +#define TRACE_EVENT2(a, b, c, d, e, f) +#else +#include "base/trace_event/trace_event.h" +#endif // defined(__Fuchsia__)