diff --git a/sky/engine/bindings/dart_mojo_internal.h b/sky/engine/bindings/dart_mojo_internal.h index 32fe9567edb..208d6d41238 100644 --- a/sky/engine/bindings/dart_mojo_internal.h +++ b/sky/engine/bindings/dart_mojo_internal.h @@ -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 diff --git a/sky/engine/bindings/dart_runtime_hooks.cc b/sky/engine/bindings/dart_runtime_hooks.cc index e36ac01bfb2..b1641990304 100644 --- a/sky/engine/bindings/dart_runtime_hooks.cc +++ b/sky/engine/bindings/dart_runtime_hooks.cc @@ -8,6 +8,10 @@ #include #include +#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"); diff --git a/sky/engine/bindings/dart_runtime_hooks.h b/sky/engine/bindings/dart_runtime_hooks.h index 993565e9316..505c9827905 100644 --- a/sky/engine/bindings/dart_runtime_hooks.h +++ b/sky/engine/bindings/dart_runtime_hooks.h @@ -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 diff --git a/sky/engine/bindings/dart_ui.h b/sky/engine/bindings/dart_ui.h index 9cc9efa0400..3e19fcfc0f4 100644 --- a/sky/engine/bindings/dart_ui.h +++ b/sky/engine/bindings/dart_ui.h @@ -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 diff --git a/sky/engine/bindings/mojo_services.h b/sky/engine/bindings/mojo_services.h index 75a4e829814..05a32167e2a 100644 --- a/sky/engine/bindings/mojo_services.h +++ b/sky/engine/bindings/mojo_services.h @@ -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 diff --git a/sky/engine/core/script/dart_controller.h b/sky/engine/core/script/dart_controller.h index 7c978b3949e..779a35ca5fc 100644 --- a/sky/engine/core/script/dart_controller.h +++ b/sky/engine/core/script/dart_controller.h @@ -8,9 +8,9 @@ #include #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 weak_factory_; - FTL_DISALLOW_COPY_AND_ASSIGN(DartController); + DISALLOW_COPY_AND_ASSIGN(DartController); }; } diff --git a/sky/engine/core/script/dart_service_isolate.cc b/sky/engine/core/script/dart_service_isolate.cc index 795b7aa07ef..6ebd685f3e5 100644 --- a/sky/engine/core/script/dart_service_isolate.cc +++ b/sky/engine/core/script/dart_service_isolate.cc @@ -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; diff --git a/sky/engine/core/script/embedder_resources.cc b/sky/engine/core/script/embedder_resources.cc index f713405aaec..ecbb0d01d03 100644 --- a/sky/engine/core/script/embedder_resources.cc +++ b/sky/engine/core/script/embedder_resources.cc @@ -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]; diff --git a/sky/engine/core/text/TextBox.cpp b/sky/engine/core/text/TextBox.cpp index c8f40be2792..185370df317 100644 --- a/sky/engine/core/text/TextBox.cpp +++ b/sky/engine/core/text/TextBox.cpp @@ -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::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), diff --git a/sky/engine/platform/exported/sky_settings.cc b/sky/engine/platform/exported/sky_settings.cc index 8ad3f0d19bb..fbda26cc64f 100644 --- a/sky/engine/platform/exported/sky_settings.cc +++ b/sky/engine/platform/exported/sky_settings.cc @@ -6,24 +6,23 @@ #include -#include "lib/ftl/logging.h" +#include "base/lazy_instance.h" +#include "base/logging.h" namespace blink { -namespace { -SkySettings* g_settings = nullptr; +static base::LazyInstance 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 diff --git a/sky/engine/platform/fonts/FontFallbackList.cpp b/sky/engine/platform/fonts/FontFallbackList.cpp index 02c8b24e812..bc2ab098a45 100644 --- a/sky/engine/platform/fonts/FontFallbackList.cpp +++ b/sky/engine/platform/fonts/FontFallbackList.cpp @@ -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() diff --git a/sky/engine/platform/fonts/apple/FontCacheIOS.mm b/sky/engine/platform/fonts/apple/FontCacheIOS.mm index 07e73144d1a..8353d0b6644 100644 --- a/sky/engine/platform/fonts/apple/FontCacheIOS.mm +++ b/sky/engine/platform/fonts/apple/FontCacheIOS.mm @@ -33,12 +33,12 @@ #import #import -#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 _prototype; - FTL_DISALLOW_COPY_AND_ASSIGN(FontFallbackSelector); + DISALLOW_COPY_AND_ASSIGN(FontFallbackSelector); }; static base::LazyInstance g_fallback_selector = diff --git a/sky/engine/platform/mojo/data_pipe.cc b/sky/engine/platform/mojo/data_pipe.cc index 60f4f3723dc..0843e261322 100644 --- a/sky/engine/platform/mojo/data_pipe.cc +++ b/sky/engine/platform/mojo/data_pipe.cc @@ -7,7 +7,6 @@ #include #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 buffer_; std::unique_ptr drainer_; - FTL_DISALLOW_COPY_AND_ASSIGN(DrainJob); + DISALLOW_COPY_AND_ASSIGN(DrainJob); }; } // namespace diff --git a/sky/engine/public/sky/sky_view.cc b/sky/engine/public/sky/sky_view.cc index 0ab7cc69fc6..93563ef1c39 100644 --- a/sky/engine/public/sky/sky_view.cc +++ b/sky/engine/public/sky/sky_view.cc @@ -20,7 +20,7 @@ std::unique_ptr SkyView::Create(SkyViewClient* client) { } SkyView::SkyView(SkyViewClient* client) - : client_(client) {} + : client_(client), weak_factory_(this) {} SkyView::~SkyView() {} diff --git a/sky/engine/public/sky/sky_view.h b/sky/engine/public/sky/sky_view.h index ef6346e76c4..87dda54af37 100644 --- a/sky/engine/public/sky/sky_view.h +++ b/sky/engine/public/sky/sky_view.h @@ -7,8 +7,9 @@ #include +#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 dart_controller_; - FTL_DISALLOW_COPY_AND_ASSIGN(SkyView); + base::WeakPtrFactory weak_factory_; + + DISALLOW_COPY_AND_ASSIGN(SkyView); }; } // namespace blink diff --git a/sky/engine/wtf/BUILD.gn b/sky/engine/wtf/BUILD.gn index 3e55b851d80..9b4592c801a 100644 --- a/sky/engine/wtf/BUILD.gn +++ b/sky/engine/wtf/BUILD.gn @@ -187,10 +187,6 @@ component("wtf") { direct_dependent_configs = [ "//sky/engine:features" ] - public_deps = [ - "//lib/ftl", - ] - deps = [ "//base", "//third_party/icu", diff --git a/sky/engine/wtf/dtoa/bignum.h b/sky/engine/wtf/dtoa/bignum.h index ec540f549e4..b6ed62beefe 100644 --- a/sky/engine/wtf/dtoa/bignum.h +++ b/sky/engine/wtf/dtoa/bignum.h @@ -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 diff --git a/sky/engine/wtf/dtoa/double-conversion.h b/sky/engine/wtf/dtoa/double-conversion.h index 0d3b3bf2eb2..dc1a741d5b5 100644 --- a/sky/engine/wtf/dtoa/double-conversion.h +++ b/sky/engine/wtf/dtoa/double-conversion.h @@ -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 diff --git a/sky/engine/wtf/dtoa/utils.h b/sky/engine/wtf/dtoa/utils.h index 7a4e673b723..962fbac2195 100644 --- a/sky/engine/wtf/dtoa/utils.h +++ b/sky/engine/wtf/dtoa/utils.h @@ -29,8 +29,7 @@ #define SKY_ENGINE_WTF_DTOA_UTILS_H_ #include - -#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