Skip to content

Commit

Permalink
Finish removing //base dependency from //flow (flutter#2848)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
abarth authored Aug 1, 2016
1 parent ace8307 commit fcc642e
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion flow/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ source_set("flow") {
]

deps = [
"//base",
"//glue",
"//lib/ftl",
"//mojo/services/gfx/composition/interfaces",
"//mojo/skia",
Expand Down
2 changes: 1 addition & 1 deletion flow/layers/layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include <memory>
#include <vector>

#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"
Expand Down
2 changes: 1 addition & 1 deletion flow/layers/layer_tree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion flow/raster_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 13 additions & 0 deletions glue/BUILD.gn
Original file line number Diff line number Diff line change
@@ -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",
]
}
5 changes: 5 additions & 0 deletions glue/README.md
Original file line number Diff line number Diff line change
@@ -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.
11 changes: 11 additions & 0 deletions glue/trace_event.h
Original file line number Diff line number Diff line change
@@ -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__)

0 comments on commit fcc642e

Please sign in to comment.