Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions shell/platform/darwin/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import("//flutter/testing/testing.gni")
import("framework_common.gni")

source_set("common") {
cflags_objc = flutter_cflags_objc
cflags_objcc = flutter_cflags_objcc
cflags_objc = flutter_cflags_objc_arc
cflags_objcc = flutter_cflags_objcc_arc

sources = [
"buffer_conversions.h",
Expand Down Expand Up @@ -40,9 +40,6 @@ source_set("common") {
# See: Upstream clang change: https://reviews.llvm.org/D150397
# See: https://github.com/flutter/flutter/issues/133777
source_set("availability_version_check") {
cflags_objc = flutter_cflags_objc
cflags_objcc = flutter_cflags_objcc

sources = [ "availability_version_check.cc" ]

deps = [ "//flutter/fml" ]
Expand Down
12 changes: 6 additions & 6 deletions shell/platform/darwin/common/buffer_conversions.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
#include "flutter/fml/macros.h"
#include "flutter/fml/platform/darwin/scoped_nsobject.h"

static_assert(__has_feature(objc_arc), "ARC must be enabled.");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this isn't part of the framework and doesn't have dependencies on it, we do things manually.


namespace flutter {
namespace {
class NSDataMapping : public fml::Mapping {
public:
explicit NSDataMapping(NSData* data) : data_([data retain]) {}
explicit NSDataMapping(NSData* data) : data_(data) {}

size_t GetSize() const override { return [data_.get() length]; }
size_t GetSize() const override { return data_.length; }

const uint8_t* GetMapping() const override {
return static_cast<const uint8_t*>([data_.get() bytes]);
}
const uint8_t* GetMapping() const override { return static_cast<const uint8_t*>(data_.bytes); }

bool IsDontNeedSafe() const override { return false; }

private:
fml::scoped_nsobject<NSData> data_;
NSData* data_;
FML_DISALLOW_COPY_AND_ASSIGN(NSDataMapping);
};
} // namespace
Expand Down
2 changes: 2 additions & 0 deletions shell/platform/darwin/common/command_line.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#import <Foundation/Foundation.h>

static_assert(__has_feature(objc_arc), "ARC must be enabled.");

namespace flutter {

fml::CommandLine CommandLineFromNSProcessInfo(NSProcessInfo* processInfoOrNil) {
Expand Down