This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Migrate PlatformViewIOS to ARC #55672
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,6 @@ | |
|
||
#include "flutter/fml/closure.h" | ||
#include "flutter/fml/macros.h" | ||
#include "flutter/fml/platform/darwin/scoped_nsobject.h" | ||
#include "flutter/fml/platform/darwin/weak_nsobject.h" | ||
#include "flutter/shell/common/platform_view.h" | ||
#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterTexture.h" | ||
#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" | ||
|
@@ -59,14 +57,14 @@ class PlatformViewIOS final : public PlatformView { | |
* Returns the `FlutterViewController` currently attached to the `FlutterEngine` owning | ||
* this PlatformViewIOS. | ||
*/ | ||
fml::WeakNSObject<FlutterViewController> GetOwnerViewController() const; | ||
FlutterViewController* GetOwnerViewController() const __attribute__((cf_audited_transfer)); | ||
|
||
/** | ||
* Updates the `FlutterViewController` currently attached to the `FlutterEngine` owning | ||
* this PlatformViewIOS. This should be updated when the `FlutterEngine` | ||
* is given a new `FlutterViewController`. | ||
*/ | ||
void SetOwnerViewController(const fml::WeakNSObject<FlutterViewController>& owner_controller); | ||
void SetOwnerViewController(__weak FlutterViewController* owner_controller); | ||
|
||
/** | ||
* Called one time per `FlutterViewController` when the `FlutterViewController`'s | ||
|
@@ -133,15 +131,14 @@ class PlatformViewIOS final : public PlatformView { | |
std::function<void(bool)> set_semantics_enabled_; | ||
}; | ||
|
||
fml::WeakNSObject<FlutterViewController> owner_controller_; | ||
__weak FlutterViewController* owner_controller_; | ||
cbracken marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Since the `ios_surface_` is created on the platform thread but | ||
// used on the raster thread we need to protect it with a mutex. | ||
std::mutex ios_surface_mutex_; | ||
std::unique_ptr<IOSSurface> ios_surface_; | ||
std::shared_ptr<IOSContext> ios_context_; | ||
const std::shared_ptr<PlatformViewsController>& platform_views_controller_; | ||
AccessibilityBridgeManager accessibility_bridge_; | ||
fml::scoped_nsprotocol<FlutterTextInputPlugin*> text_input_plugin_; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This... wasn't used anywhere at all. |
||
ScopedObserver dealloc_view_controller_observer_; | ||
std::vector<std::string> platform_resolved_locale_; | ||
std::shared_ptr<PlatformMessageHandlerIos> platform_message_handler_; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm jumping for joy over here!