diff --git a/engine/src/flutter/fml/BUILD.gn b/engine/src/flutter/fml/BUILD.gn index 0e561b87cb..0551319ea2 100644 --- a/engine/src/flutter/fml/BUILD.gn +++ b/engine/src/flutter/fml/BUILD.gn @@ -77,8 +77,6 @@ source_set("fml") { "platform/darwin/paths_darwin.mm", "platform/darwin/platform_version.h", "platform/darwin/platform_version.mm", - "platform/darwin/resource_mapping_darwin.h", - "platform/darwin/resource_mapping_darwin.mm", "platform/darwin/scoped_block.h", "platform/darwin/scoped_block.mm", "platform/darwin/scoped_nsobject.h", diff --git a/engine/src/flutter/fml/icu_util.cc b/engine/src/flutter/fml/icu_util.cc index 98da2880ab..03082886e1 100644 --- a/engine/src/flutter/fml/icu_util.cc +++ b/engine/src/flutter/fml/icu_util.cc @@ -38,15 +38,6 @@ class ICUContext { return true; } - // Check to see if the mapping is in the resources bundle. - if (PlatformHasResourcesBundle()) { - auto resource = GetResourceMapping(icu_data_path); - if (resource != nullptr && resource->GetSize() != 0) { - mapping_ = std::move(resource); - return true; - } - } - // Check if the mapping can by directly accessed via a file path. In this // case, the data file needs to be next to the executable. auto directory = fml::paths::GetExecutableDirectoryPath(); diff --git a/engine/src/flutter/fml/mapping.h b/engine/src/flutter/fml/mapping.h index 465a66239a..e3d840dc8c 100644 --- a/engine/src/flutter/fml/mapping.h +++ b/engine/src/flutter/fml/mapping.h @@ -29,10 +29,6 @@ class Mapping { FML_DISALLOW_COPY_AND_ASSIGN(Mapping); }; -bool PlatformHasResourcesBundle(); - -std::unique_ptr GetResourceMapping(const std::string& resource_name); - class FileMapping : public Mapping { public: FileMapping(const std::string& path, bool executable = false); diff --git a/engine/src/flutter/fml/platform/darwin/resource_mapping_darwin.h b/engine/src/flutter/fml/platform/darwin/resource_mapping_darwin.h deleted file mode 100644 index 4cbc158b90..0000000000 --- a/engine/src/flutter/fml/platform/darwin/resource_mapping_darwin.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2017 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. - -#ifndef FLUTTER_FML_PLATFORM_DARWIN_RESOURCE_MAPPING_DARWIN_H_ -#define FLUTTER_FML_PLATFORM_DARWIN_RESOURCE_MAPPING_DARWIN_H_ - -#include "flutter/fml/macros.h" -#include "flutter/fml/mapping.h" - -namespace fml { - -class ResourceMappingDarwin : public Mapping { - public: - ResourceMappingDarwin(const std::string& resource); - - ~ResourceMappingDarwin() override; - - size_t GetSize() const override; - - const uint8_t* GetMapping() const override; - - private: - FileMapping actual_; - - FML_DISALLOW_COPY_AND_ASSIGN(ResourceMappingDarwin); -}; - -} // namespace fml - -#endif // FLUTTER_FML_PLATFORM_DARWIN_RESOURCE_MAPPING_DARWIN_H_ diff --git a/engine/src/flutter/fml/platform/darwin/resource_mapping_darwin.mm b/engine/src/flutter/fml/platform/darwin/resource_mapping_darwin.mm deleted file mode 100644 index 3ee100121a..0000000000 --- a/engine/src/flutter/fml/platform/darwin/resource_mapping_darwin.mm +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2017 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. - -#include "flutter/fml/platform/darwin/resource_mapping_darwin.h" - -#include - -namespace fml { - -ResourceMappingDarwin::ResourceMappingDarwin(const std::string& resource) - : actual_([[[NSBundle mainBundle] pathForResource:@(resource.c_str()) ofType:nil] UTF8String], - false) {} - -ResourceMappingDarwin::~ResourceMappingDarwin() = default; - -size_t ResourceMappingDarwin::GetSize() const { - return actual_.GetSize(); -} - -const uint8_t* ResourceMappingDarwin::GetMapping() const { - return actual_.GetMapping(); -} - -} // namespace fml diff --git a/engine/src/flutter/fml/platform/posix/mapping_posix.cc b/engine/src/flutter/fml/platform/posix/mapping_posix.cc index b9f8fe5de9..e1dbdedbb5 100644 --- a/engine/src/flutter/fml/platform/posix/mapping_posix.cc +++ b/engine/src/flutter/fml/platform/posix/mapping_posix.cc @@ -15,31 +15,12 @@ #include "flutter/fml/eintr_wrapper.h" #include "flutter/fml/unique_fd.h" -#if OS_MACOSX - -#include "flutter/fml/platform/darwin/resource_mapping_darwin.h" -using PlatformResourceMapping = fml::ResourceMappingDarwin; - -#else - -using PlatformResourceMapping = fml::FileMapping; - -#endif - namespace fml { Mapping::Mapping() = default; Mapping::~Mapping() = default; -bool PlatformHasResourcesBundle() { - return !std::is_same::value; -} - -std::unique_ptr GetResourceMapping(const std::string& resource_name) { - return std::make_unique(resource_name); -} - FileMapping::FileMapping(const std::string& path, bool executable) : FileMapping( fml::UniqueFD{FML_HANDLE_EINTR(::open(path.c_str(), O_RDONLY))}, diff --git a/engine/src/flutter/fml/platform/win/mapping_win.cc b/engine/src/flutter/fml/platform/win/mapping_win.cc index 9dd5dcf6f2..0961735878 100644 --- a/engine/src/flutter/fml/platform/win/mapping_win.cc +++ b/engine/src/flutter/fml/platform/win/mapping_win.cc @@ -13,22 +13,12 @@ #include "flutter/fml/file.h" #include "flutter/fml/platform/win/wstring_conversion.h" -using PlatformResourceMapping = fml::FileMapping; - namespace fml { Mapping::Mapping() = default; Mapping::~Mapping() = default; -bool PlatformHasResourcesBundle() { - return !std::is_same::value; -} - -std::unique_ptr GetResourceMapping(const std::string& resource_name) { - return std::make_unique(resource_name); -} - FileMapping::FileMapping(const std::string& path, bool executable) : FileMapping(OpenFile(path.c_str(), executable ? OpenPermission::kExecute