Revert "Remove more //base dependencies" (#2857)

This commit is contained in:
Ian Hickson 2016-08-03 11:29:20 -07:00 committed by GitHub
parent bce0d690a4
commit abb9c78d57
19 changed files with 62 additions and 62 deletions

View File

@ -5,7 +5,7 @@
#ifndef SKY_ENGINE_BINDINGS_DART_MOJO_INTERNAL_H_
#define SKY_ENGINE_BINDINGS_DART_MOJO_INTERNAL_H_
#include "lib/ftl/macros.h"
#include "base/macros.h"
#include "mojo/public/cpp/system/handle.h"
namespace blink {
@ -17,7 +17,7 @@ class DartMojoInternal {
static void SetHandleWatcherProducerHandle(MojoHandle handle);
private:
FTL_DISALLOW_IMPLICIT_CONSTRUCTORS(DartMojoInternal);
DISALLOW_IMPLICIT_CONSTRUCTORS(DartMojoInternal);
};
} // namespace blink

View File

@ -8,6 +8,10 @@
#include <stdlib.h>
#include <string.h>
#include "base/bind.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/time/time.h"
#include "dart/runtime/bin/embedded_dart_io.h"
#include "dart/runtime/include/dart_api.h"
#include "dart/runtime/include/dart_tools_api.h"
@ -19,7 +23,6 @@
#include "flutter/tonic/dart_library_natives.h"
#include "flutter/tonic/dart_microtask_queue.h"
#include "flutter/tonic/dart_state.h"
#include "lib/ftl/logging.h"
#include "sky/engine/core/script/ui_dart_state.h"
#include "sky/engine/wtf/text/WTFString.h"
@ -83,7 +86,7 @@ static void InitDartInternal(Dart_Handle builtin_library,
DART_CHECK_VALID(isolate_lib);
DART_CHECK_VALID(Dart_Invoke(isolate_lib, method_name, 0, NULL));
} else {
FTL_CHECK(isolate_type == DartRuntimeHooks::SecondaryIsolate);
CHECK(isolate_type == DartRuntimeHooks::SecondaryIsolate);
Dart_Handle io_lib = Dart_LookupLibrary(ToDart("dart:io"));
DART_CHECK_VALID(io_lib);
Dart_Handle setup_hooks = Dart_NewStringFromCString("_setupHooks");
@ -108,7 +111,7 @@ static void InitDartAsync(Dart_Handle builtin_library,
schedule_microtask =
GetClosure(builtin_library, "_getScheduleMicrotaskClosure");
} else {
FTL_CHECK(isolate_type == DartRuntimeHooks::SecondaryIsolate);
CHECK(isolate_type == DartRuntimeHooks::SecondaryIsolate);
Dart_Handle isolate_lib = Dart_LookupLibrary(ToDart("dart:isolate"));
Dart_Handle method_name =
Dart_NewStringFromCString("_getIsolateScheduleImmediateClosure");

View File

@ -5,9 +5,9 @@
#ifndef SKY_ENGINE_BINDINGS_DART_RUNTIME_HOOKS_H_
#define SKY_ENGINE_BINDINGS_DART_RUNTIME_HOOKS_H_
#include "base/macros.h"
#include "dart/runtime/include/dart_api.h"
#include "flutter/tonic/dart_library_natives.h"
#include "lib/ftl/macros.h"
namespace blink {
@ -22,7 +22,7 @@ class DartRuntimeHooks {
static void RegisterNatives(DartLibraryNatives* natives);
private:
FTL_DISALLOW_IMPLICIT_CONSTRUCTORS(DartRuntimeHooks);
DISALLOW_IMPLICIT_CONSTRUCTORS(DartRuntimeHooks);
};
} // namespace blink

View File

@ -5,7 +5,7 @@
#ifndef SKY_ENGINE_BINDINGS_DART_UI_H_
#define SKY_ENGINE_BINDINGS_DART_UI_H_
#include "lib/ftl/macros.h"
#include "base/macros.h"
namespace blink {
@ -15,7 +15,7 @@ class DartUI {
static void InitForIsolate();
private:
FTL_DISALLOW_IMPLICIT_CONSTRUCTORS(DartUI);
DISALLOW_IMPLICIT_CONSTRUCTORS(DartUI);
};
} // namespace blink

View File

@ -6,7 +6,6 @@
#define SKY_ENGINE_BINDINGS_MOJO_SERVICES_H_
#include "dart/runtime/include/dart_api.h"
#include "lib/ftl/macros.h"
#include "mojo/public/cpp/application/service_provider_impl.h"
#include "mojo/public/interfaces/application/service_provider.mojom.h"
#include "mojo/services/asset_bundle/interfaces/asset_bundle.mojom.h"
@ -52,7 +51,7 @@ class MojoServices {
// https://github.com/domokit/mojo/issues/536
mojo::ServiceProviderPtr services_from_dart_;
FTL_DISALLOW_COPY_AND_ASSIGN(MojoServices);
MOJO_DISALLOW_COPY_AND_ASSIGN(MojoServices);
};
} // namespace blink

View File

@ -8,9 +8,9 @@
#include <memory>
#include "base/callback_forward.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "dart/runtime/include/dart_api.h"
#include "lib/ftl/macros.h"
#include "mojo/public/cpp/system/data_pipe.h"
#include "sky/engine/wtf/OwnPtr.h"
#include "sky/engine/wtf/text/AtomicString.h"
@ -55,7 +55,7 @@ class DartController {
base::WeakPtrFactory<DartController> weak_factory_;
FTL_DISALLOW_COPY_AND_ASSIGN(DartController);
DISALLOW_COPY_AND_ASSIGN(DartController);
};
}

View File

@ -4,11 +4,11 @@
#include "dart_service_isolate.h"
#include "base/logging.h"
#include "dart/runtime/include/dart_api.h"
#include "flutter/tonic/dart_converter.h"
#include "flutter/tonic/dart_error.h"
#include "flutter/tonic/dart_library_natives.h"
#include "lib/ftl/logging.h"
#include "sky/engine/core/script/embedder_resources.h"
#define RETURN_ERROR_HANDLE(handle) \
@ -44,12 +44,12 @@ static int observatory_port_;
Dart_NativeFunction GetNativeFunction(Dart_Handle name,
int argument_count,
bool* auto_setup_scope) {
FTL_CHECK(g_natives);
CHECK(g_natives);
return g_natives->GetNativeFunction(name, argument_count, auto_setup_scope);
}
const uint8_t* GetSymbol(Dart_NativeFunction native_function) {
FTL_CHECK(g_natives);
CHECK(g_natives);
return g_natives->GetSymbol(native_function);
}
@ -57,9 +57,9 @@ const uint8_t* GetSymbol(Dart_NativeFunction native_function) {
void DartServiceIsolate::TriggerResourceLoad(Dart_NativeArguments args) {
Dart_Handle library = Dart_RootLibrary();
FTL_DCHECK(!Dart_IsError(library));
DCHECK(!Dart_IsError(library));
Dart_Handle result = LoadResources(library);
FTL_DCHECK(!Dart_IsError(result));
DCHECK(!Dart_IsError(result));
}
void DartServiceIsolate::NotifyServerState(Dart_NativeArguments args) {
@ -85,11 +85,11 @@ bool DartServiceIsolate::Startup(std::string server_ip,
bool disable_origin_check,
char** error) {
Dart_Isolate isolate = Dart_CurrentIsolate();
FTL_CHECK(isolate);
CHECK(isolate);
// Remember the embedder's library tag handler.
g_embedder_tag_handler = embedder_tag_handler;
FTL_CHECK(g_embedder_tag_handler);
CHECK(g_embedder_tag_handler);
// Setup native entries.
if (!g_natives) {
@ -120,7 +120,7 @@ bool DartServiceIsolate::Startup(std::string server_ip,
Dart_SetLibraryTagHandler(DartServiceIsolate::LibraryTagHandler);
// Load main script.
Dart_Handle library = LoadScript(kServiceIsolateScript);
FTL_DCHECK(library != Dart_Null());
DCHECK(library != Dart_Null());
SHUTDOWN_ON_ERROR(library);
// Setup native entry resolution.
result = Dart_SetNativeResolver(library, GetNativeFunction, GetSymbol);
@ -205,7 +205,7 @@ Dart_Handle DartServiceIsolate::LoadResource(Dart_Handle library,
const char* data_buffer = NULL;
int data_buffer_length = g_resources->ResourceLookup(resource_name,
&data_buffer);
FTL_DCHECK(data_buffer_length != EmbedderResources::kNoSuchInstance);
DCHECK(data_buffer_length != EmbedderResources::kNoSuchInstance);
Dart_Handle data_list = Dart_NewTypedData(Dart_TypedData_kUint8,
data_buffer_length);
RETURN_ERROR_HANDLE(data_list);
@ -216,9 +216,9 @@ Dart_Handle DartServiceIsolate::LoadResource(Dart_Handle library,
&data_list_buffer,
&data_list_buffer_length);
RETURN_ERROR_HANDLE(result);
FTL_DCHECK(data_buffer_length == data_list_buffer_length);
FTL_DCHECK(data_list_buffer != NULL);
FTL_DCHECK(type = Dart_TypedData_kUint8);
DCHECK(data_buffer_length == data_list_buffer_length);
DCHECK(data_list_buffer != NULL);
DCHECK(type = Dart_TypedData_kUint8);
memmove(data_list_buffer, &data_buffer[0], data_buffer_length);
result = Dart_TypedDataReleaseData(data_list);
RETURN_ERROR_HANDLE(result);
@ -272,7 +272,7 @@ Dart_Handle DartServiceIsolate::LibraryTagHandler(Dart_LibraryTag tag,
// Embedder handles all requests for external libraries.
return g_embedder_tag_handler(tag, library, url);
}
FTL_DCHECK((tag == Dart_kSourceTag) || (tag == Dart_kCanonicalizeUrl));
DCHECK((tag == Dart_kSourceTag) || (tag == Dart_kCanonicalizeUrl));
if (tag == Dart_kCanonicalizeUrl) {
// url is already canonicalized.
return url;

View File

@ -4,7 +4,7 @@
#include "sky/engine/core/script/embedder_resources.h"
#include "lib/ftl/logging.h"
#include "base/logging.h"
namespace blink {
@ -20,7 +20,7 @@ int EmbedderResources::ResourceLookup(const char* path, const char** resource) {
const ResourcesEntry& entry = resources_table_[i];
if (strcmp(path, entry.path_) == 0) {
*resource = entry.resource_;
FTL_DCHECK(entry.length_ > 0);
DCHECK(entry.length_ > 0);
return entry.length_;
}
}
@ -28,17 +28,17 @@ int EmbedderResources::ResourceLookup(const char* path, const char** resource) {
}
const char* EmbedderResources::Path(int idx) {
FTL_DCHECK(idx >= 0);
DCHECK(idx >= 0);
ResourcesEntry* entry = At(idx);
if (entry == nullptr) {
return nullptr;
}
FTL_DCHECK(entry->path_ != nullptr);
DCHECK(entry->path_ != nullptr);
return entry->path_;
}
ResourcesEntry* EmbedderResources::At(int idx) {
FTL_DCHECK(idx >= 0);
DCHECK(idx >= 0);
for (int i = 0; resources_table_[i].path_ != nullptr; i++) {
if (idx == i) {
return &resources_table_[i];

View File

@ -4,9 +4,9 @@
#include "sky/engine/core/text/TextBox.h"
#include "base/logging.h"
#include "flutter/tonic/dart_class_library.h"
#include "flutter/tonic/dart_error.h"
#include "lib/ftl/logging.h"
#include "sky/engine/core/script/ui_dart_state.h"
namespace blink {
@ -17,7 +17,7 @@ Dart_Handle DartConverter<TextBox>::ToDart(const TextBox& val) {
DartClassLibrary& class_library = DartState::Current()->class_library();
Dart_Handle type = Dart_HandleFromPersistent(
class_library.GetClass("ui", "TextBox"));
FTL_DCHECK(!LogIfError(type));
DCHECK(!LogIfError(type));
const int argc = 5;
Dart_Handle argv[argc] = {
blink::ToDart(val.sk_rect.fLeft),

View File

@ -6,24 +6,23 @@
#include <memory>
#include "lib/ftl/logging.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
namespace blink {
namespace {
SkySettings* g_settings = nullptr;
static base::LazyInstance<SkySettings> s_settings = LAZY_INSTANCE_INITIALIZER;
} // namespace
static bool s_have_settings = false;
const SkySettings& SkySettings::Get() {
FTL_CHECK(g_settings);
return *g_settings;
return s_settings.Get();
}
void SkySettings::Set(const SkySettings& settings) {
FTL_CHECK(!g_settings);
g_settings = new SkySettings();
*g_settings = settings;
CHECK(!s_have_settings);
s_settings.Get() = settings;
s_have_settings = true;
}
} // namespace blink

View File

@ -34,6 +34,8 @@
#include "sky/engine/platform/fonts/SegmentedFontData.h"
#include "sky/engine/wtf/unicode/CharacterNames.h"
#include "base/logging.h"
namespace blink {
FontFallbackList::FontFallbackList()

View File

@ -33,12 +33,12 @@
#import <CoreText/CoreText.h>
#import <UIKit/UIKit.h>
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "sky/engine/platform/fonts/FontCache.h"
#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/mac/scoped_nsobject.h"
#include "lib/ftl/macros.h"
#include "sky/engine/platform/fonts/FontCache.h"
#include "base/lazy_instance.h"
#include "base/macros.h"
#include "base/logging.h"
namespace blink {
@ -129,7 +129,7 @@ class FontFallbackSelector {
private:
CFRef<CTFontRef> _prototype;
FTL_DISALLOW_COPY_AND_ASSIGN(FontFallbackSelector);
DISALLOW_COPY_AND_ASSIGN(FontFallbackSelector);
};
static base::LazyInstance<FontFallbackSelector> g_fallback_selector =

View File

@ -7,7 +7,6 @@
#include <memory>
#include "base/bind.h"
#include "lib/ftl/macros.h"
#include "mojo/data_pipe_utils/data_pipe_drainer.h"
#include "sky/engine/platform/mojo/data_pipe.h"
#include "sky/engine/public/platform/Platform.h"
@ -42,7 +41,7 @@ class DrainJob : public mojo::common::DataPipeDrainer::Client {
RefPtr<SharedBuffer> buffer_;
std::unique_ptr<mojo::common::DataPipeDrainer> drainer_;
FTL_DISALLOW_COPY_AND_ASSIGN(DrainJob);
DISALLOW_COPY_AND_ASSIGN(DrainJob);
};
} // namespace

View File

@ -20,7 +20,7 @@ std::unique_ptr<SkyView> SkyView::Create(SkyViewClient* client) {
}
SkyView::SkyView(SkyViewClient* client)
: client_(client) {}
: client_(client), weak_factory_(this) {}
SkyView::~SkyView() {}

View File

@ -7,8 +7,9 @@
#include <memory>
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "flow/layers/layer_tree.h"
#include "lib/ftl/macros.h"
#include "mojo/public/cpp/system/data_pipe.h"
#include "mojo/services/network/interfaces/url_loader.mojom.h"
#include "sky/engine/bindings/flutter_dart_state.h"
@ -70,7 +71,9 @@ class SkyView : public WindowClient, public IsolateClient {
std::string country_code_;
std::unique_ptr<DartController> dart_controller_;
FTL_DISALLOW_COPY_AND_ASSIGN(SkyView);
base::WeakPtrFactory<SkyView> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(SkyView);
};
} // namespace blink

View File

@ -187,10 +187,6 @@ component("wtf") {
direct_dependent_configs = [ "//sky/engine:features" ]
public_deps = [
"//lib/ftl",
]
deps = [
"//base",
"//third_party/icu",

View File

@ -135,7 +135,7 @@ namespace double_conversion {
// The Bignum's value equals value(bigits_) * 2^(exponent_ * kBigitSize).
int exponent_;
FTL_DISALLOW_COPY_AND_ASSIGN(Bignum);
DISALLOW_COPY_AND_ASSIGN(Bignum);
};
} // namespace double_conversion

View File

@ -355,7 +355,7 @@ namespace double_conversion {
const int max_leading_padding_zeroes_in_precision_mode_;
const int max_trailing_padding_zeroes_in_precision_mode_;
FTL_DISALLOW_IMPLICIT_CONSTRUCTORS(DoubleToStringConverter);
DISALLOW_IMPLICIT_CONSTRUCTORS(DoubleToStringConverter);
};
@ -367,7 +367,7 @@ namespace double_conversion {
static double StringToDouble(const char* buffer, size_t length, size_t* processed_characters_count);
private:
FTL_DISALLOW_IMPLICIT_CONSTRUCTORS(StringToDoubleConverter);
DISALLOW_IMPLICIT_CONSTRUCTORS(StringToDoubleConverter);
};
} // namespace double_conversion

View File

@ -29,8 +29,7 @@
#define SKY_ENGINE_WTF_DTOA_UTILS_H_
#include <string.h>
#include "lib/ftl/macros.h"
#include "base/macros.h"
#include "sky/engine/wtf/Assertions.h"
#define UNIMPLEMENTED ASSERT_NOT_REACHED
@ -221,7 +220,7 @@ namespace double_conversion {
bool is_finalized() const { return position_ < 0; }
FTL_DISALLOW_IMPLICIT_CONSTRUCTORS(StringBuilder);
DISALLOW_IMPLICIT_CONSTRUCTORS(StringBuilder);
};
// The type-based aliasing rule allows the compiler to assume that pointers of