Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Embedding Refactor #6447

Merged
merged 41 commits into from
Oct 26, 2018
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
b9f4692
Initial implementation for embedding refactor
dnfield Oct 2, 2018
2e86930
Merge remote-tracking branch 'upstream/master' into ios_embedder_engine
dnfield Oct 2, 2018
cb0dd1e
license update
dnfield Oct 2, 2018
bde9e9f
cleanup
dnfield Oct 3, 2018
85f6214
bug fixes
dnfield Oct 3, 2018
c799399
retain threads, rework engine/vc for platformplugin
dnfield Oct 4, 2018
6dd1f3e
cleanup
dnfield Oct 4, 2018
2a5ef8f
Doc updates; WeakPtr update; Create Surface on GPU Thread
dnfield Oct 5, 2018
e2333d5
merge
dnfield Oct 5, 2018
3a3cdde
remove file from licenses
dnfield Oct 5, 2018
aeaa6aa
Finish missing doc on FlutterEngine
dnfield Oct 5, 2018
10d1dbc
remove unused code, merge-o
dnfield Oct 5, 2018
1fe3af8
format
dnfield Oct 5, 2018
270bd0f
fix license on flutterengine
dnfield Oct 5, 2018
a03a78c
Fix casing in license
dnfield Oct 5, 2018
021dac6
reset, not release
dnfield Oct 5, 2018
4d95721
return if no vc for setSemanticsEnabled; create surface on GPU thread
dnfield Oct 5, 2018
f06e46b
Documentation updates
dnfield Oct 5, 2018
4ef18f9
doc
dnfield Oct 5, 2018
d48984d
Revert unnecessary GPU schedule; mark lambda mutable
dnfield Oct 6, 2018
7d9750b
Fix race!
dnfield Oct 6, 2018
d3c5b30
Unbreak legacy support for FlutterHeadlessDartRunner
dnfield Oct 6, 2018
434184f
make sure to use config properly
dnfield Oct 6, 2018
c8cdbb3
Doc updates
dnfield Oct 8, 2018
c6eab90
Merge remote-tracking branch 'upstream/master' into ios_embedder_engine
dnfield Oct 9, 2018
9793d24
clarify entrypoint doc
dnfield Oct 9, 2018
4b3183f
Merge branch 'master' into ios_embedder_engine
dnfield Oct 11, 2018
708a3db
Merge branch 'master' into ios_embedder_engine
dnfield Oct 12, 2018
e85afe8
merge with mDNS code
dnfield Oct 16, 2018
5a53454
mergeo
dnfield Oct 16, 2018
066910a
merge
dnfield Oct 24, 2018
2be9874
fix setter for viewOpaque
dnfield Oct 24, 2018
aafa69f
merge
dnfield Oct 24, 2018
1fffe1c
Merge branch 'master' into ios_embedder_engine
dnfield Oct 24, 2018
bd5ee23
format
dnfield Oct 24, 2018
62e74f8
property/name refactoring
dnfield Oct 25, 2018
974c77d
format
dnfield Oct 25, 2018
f5b1b67
avoid deadlock
dnfield Oct 25, 2018
5c0ee25
merge
dnfield Oct 26, 2018
b995078
fix bad property access
dnfield Oct 26, 2018
01bb8b2
remove latch; fix objcdoc parameter names
dnfield Oct 26, 2018
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: 3 additions & 4 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,11 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterBinary
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterChannels.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterCodecs.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterHeadlessDartRunner.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterNavigationController.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterTexture.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterChannels.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterCodecs.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterNavigationController.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterStandardCodec.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterStandardCodec_Internal.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterUmbrellaImport.m
Expand Down Expand Up @@ -203,7 +201,6 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/JSONUtil.
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Flutter.podspec
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Info.plist
FILE: ../../../flutter/shell/platform/darwin/ios/framework/module.modulemap
FILE: ../../../flutter/shell/platform/darwin/ios/headless_platform_view_ios.mm
FILE: ../../../flutter/shell/platform/embedder/assets/EmbedderInfo.plist
FILE: ../../../flutter/shell/platform/embedder/assets/embedder.modulemap
FILE: ../../../flutter/shell/platform/embedder/fixtures/simple_main.dart
Expand Down Expand Up @@ -513,7 +510,10 @@ FILE: ../../../flutter/shell/platform/android/android_shell_holder.cc
FILE: ../../../flutter/shell/platform/android/android_shell_holder.h
FILE: ../../../flutter/shell/platform/android/platform_message_response_android.cc
FILE: ../../../flutter/shell/platform/android/platform_message_response_android.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterEngine.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate_Internal.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine_Internal.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm
FILE: ../../../flutter/shell/platform/embedder/embedder_surface.cc
Expand Down Expand Up @@ -585,7 +585,6 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterCallbac
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm
FILE: ../../../flutter/shell/platform/darwin/ios/headless_platform_view_ios.h
----------------------------------------------------------------------------------------------------
Copyright 2018 The Chromium Authors. All rights reserved.

Expand Down
7 changes: 3 additions & 4 deletions shell/platform/darwin/ios/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ _flutter_framework_headers = [
"framework/Headers/FlutterChannels.h",
"framework/Headers/FlutterCodecs.h",
"framework/Headers/FlutterDartProject.h",
"framework/Headers/FlutterEngine.h",
"framework/Headers/FlutterHeadlessDartRunner.h",
"framework/Headers/FlutterMacros.h",
"framework/Headers/FlutterNavigationController.h",
"framework/Headers/FlutterPlugin.h",
"framework/Headers/FlutterPluginAppLifeCycleDelegate.h",
"framework/Headers/FlutterTexture.h",
Expand All @@ -51,8 +51,9 @@ shared_library("create_flutter_framework_dylib") {
"framework/Source/FlutterCodecs.mm",
"framework/Source/FlutterDartProject.mm",
"framework/Source/FlutterDartProject_Internal.h",
"framework/Source/FlutterEngine.mm",
"framework/Source/FlutterEngine_Internal.h",
"framework/Source/FlutterHeadlessDartRunner.mm",
"framework/Source/FlutterNavigationController.mm",
"framework/Source/FlutterPlatformPlugin.h",
"framework/Source/FlutterPlatformPlugin.mm",
"framework/Source/FlutterPluginAppLifeCycleDelegate.mm",
Expand All @@ -75,8 +76,6 @@ shared_library("create_flutter_framework_dylib") {
"framework/Source/platform_message_router.mm",
"framework/Source/vsync_waiter_ios.h",
"framework/Source/vsync_waiter_ios.mm",
"headless_platform_view_ios.h",
"headless_platform_view_ios.mm",
"ios_external_texture_gl.h",
"ios_external_texture_gl.mm",
"ios_gl_context.h",
Expand Down
9 changes: 8 additions & 1 deletion shell/platform/darwin/ios/framework/Headers/Flutter.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
/**
BREAKING CHANGES:

October 5, 2018:
- Removed FlutterNavigationController.h/.mm
- Changed return signature of `FlutterDartHeadlessCodeRunner.run*` from void
to bool
- Removed HeadlessPlatformViewIOS
- Marked FlutterDartHeadlessCodeRunner deprecated

August 31, 2018: Marked -[FlutterDartProject
initFromDefaultSourceForConfiguration] and FlutterStandardBigInteger as
unavailable.
Expand Down Expand Up @@ -47,9 +54,9 @@
#include "FlutterChannels.h"
#include "FlutterCodecs.h"
#include "FlutterDartProject.h"
#include "FlutterEngine.h"
#include "FlutterHeadlessDartRunner.h"
#include "FlutterMacros.h"
#include "FlutterNavigationController.h"
#include "FlutterPlugin.h"
#include "FlutterPluginAppLifeCycleDelegate.h"
#include "FlutterTexture.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
#include "FlutterPlugin.h"

/**
* UIApplicationDelegate subclass for simple apps that want default behavior.
* `UIApplicationDelegate` subclass for simple apps that want default behavior.
*
* This class provides the following behaviors:
* This class implements the following behaviors:
* * Status bar touches are forwarded to the key window's root view
* FlutterViewController, in order to trigger scroll to top.
* `FlutterViewController`, in order to trigger scroll to top.
* * Keeps the Flutter connection open in debug mode when the phone screen
* locks.
*
Expand All @@ -24,7 +24,8 @@
* code as necessary from FlutterAppDelegate.mm.
*/
FLUTTER_EXPORT
@interface FlutterAppDelegate : UIResponder<UIApplicationDelegate, FlutterPluginRegistry, FlutterAppLifeCycleProvider>
@interface FlutterAppDelegate
: UIResponder <UIApplicationDelegate, FlutterPluginRegistry, FlutterAppLifeCycleProvider>

@property(strong, nonatomic) UIWindow* window;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,72 +11,67 @@

NS_ASSUME_NONNULL_BEGIN
/**
A message reply callback.

Used for submitting a binary reply back to a Flutter message sender. Also used
in the dual capacity for handling a binary message reply received from Flutter.

- Parameters:
- reply: The reply.
* A message reply callback.
dnfield marked this conversation as resolved.
Show resolved Hide resolved
*
* Used for submitting a binary reply back to a Flutter message sender. Also used
* in for handling a binary message reply received from Flutter.
*
* @param reply The reply.
*/
typedef void (^FlutterBinaryReply)(NSData* _Nullable reply);

/**
A strategy for handling incoming binary messages from Flutter and to send
asynchronous replies back to Flutter.

- Parameters:
- message: The message.
- reply: A callback for submitting a reply to the sender.
* A strategy for handling incoming binary messages from Flutter and to send
* asynchronous replies back to Flutter.
*
* @param message The message.
* @param reply A callback for submitting an asynchronous reply to the sender.
*/
typedef void (^FlutterBinaryMessageHandler)(NSData* _Nullable message, FlutterBinaryReply reply);

/**
A facility for communicating with the Flutter side using asynchronous message
passing with binary messages.

- SeeAlso:
- `FlutterBasicMessageChannel`, which supports communication using structured
messages.
- `FlutterMethodChannel`, which supports communication using asynchronous
method calls.
- `FlutterEventChannel`, which supports commuication using event streams.
* A facility for communicating with the Flutter side using asynchronous message
* passing with binary messages.
*
* Implementated by:
* - `FlutterBasicMessageChannel`, which supports communication using structured
* messages.
* - `FlutterMethodChannel`, which supports communication using asynchronous
* method calls.
* - `FlutterEventChannel`, which supports commuication using event streams.
*/
FLUTTER_EXPORT
@protocol FlutterBinaryMessenger<NSObject>
@protocol FlutterBinaryMessenger <NSObject>
/**
Sends a binary message to the Flutter side on the specified channel, expecting
no reply.

- Parameters:
- channel: The channel name.
- message: The message.
* Sends a binary message to the Flutter side on the specified channel, expecting
* no reply.
*
* @param channel The channel name.
* @param message The message.
*/
- (void)sendOnChannel:(NSString*)channel message:(NSData* _Nullable)message;

/**
Sends a binary message to the Flutter side on the specified channel, expecting
an asynchronous reply.

- Parameters:
- channel: The channel name.
- message: The message.
- callback: A callback for receiving a reply.
* Sends a binary message to the Flutter side on the specified channel, expecting
* an asynchronous reply.
*
* @param channel The channel name.
* @param message The message.
* @param callback A callback for receiving a reply.
*/
- (void)sendOnChannel:(NSString*)channel
message:(NSData* _Nullable)message
binaryReply:(FlutterBinaryReply _Nullable)callback;

/**
Registers a message handler for incoming binary messages from the Flutter side
on the specified channel.

Replaces any existing handler. Use a `nil` handler for unregistering the
existing handler.

- Parameters:
- channel: The channel name.
- handler: The message handler.
* Registers a message handler for incoming binary messages from the Flutter side
* on the specified channel.
*
* Replaces any existing handler. Use a `nil` handler for unregistering the
* existing handler.
*
* @param channel The channel name.
* @param handler The message handler.
*/
- (void)setMessageHandlerOnChannel:(NSString*)channel
binaryMessageHandler:(FlutterBinaryMessageHandler _Nullable)handler;
Expand Down
37 changes: 27 additions & 10 deletions shell/platform/darwin/ios/framework/Headers/FlutterCallbackCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,43 @@

#include "FlutterMacros.h"

/**
* An object containing the result of `FlutterCallbackCache`'s `lookupCallbackInformation`
* method.
*/
FLUTTER_EXPORT
@interface FlutterCallbackInformation : NSObject
/**
* The name of the callback.
*/
@property(retain) NSString* callbackName;
/**
* The class name of the callback.
*/
@property(retain) NSString* callbackClassName;
/**
* The library path of the callback.
*/
@property(retain) NSString* callbackLibraryPath;
@end

/**
* The cache containing callback information for spawning a
* `FlutterHeadlessDartRunner`.
*/
FLUTTER_EXPORT
@interface FlutterCallbackCache : NSObject
/**
Returns the callback information for the given callback handle.
This callback information can be used when spawning a
FlutterHeadlessDartRunner.

- Parameter handle: The handle for a callback, provided by the
Dart method `PluginUtilities.getCallbackHandle`.
- Returns: A FlutterCallbackInformation object which contains the name of the
callback, the name of the class in which the callback is defined, and the
path of the library which contains the callback. If the provided handle is
invalid, nil is returned.
* Returns the callback information for the given callback handle.
* This callback information can be used when spawning a
* `FlutterHeadlessDartRunner`.
*
* @param handle The handle for a callback, provided by the
* Dart method `PluginUtilities.getCallbackHandle`.
* @return A `FlutterCallbackInformation` object which contains the name of the
* callback, the name of the class in which the callback is defined, and the
* path of the library which contains the callback. If the provided handle is
* invalid, nil is returned.
*/
+ (FlutterCallbackInformation*)lookupCallbackInformation:(int64_t)handle;

Expand Down
Loading