Unreviewed, rolling out r199554.
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Apr 2016 21:54:13 +0000 (21:54 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Apr 2016 21:54:13 +0000 (21:54 +0000)
The change breaks Yosemite Release/Debug build

Reverted changeset:

"[Mac] Add API for open panel handling to WKWebView"
https://bugs.webkit.org/show_bug.cgi?id=137759
http://trac.webkit.org/changeset/199554

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199557 268f45cc-cd09-0410-ab3c-d52691b4dbfc

32 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/API/Cocoa/WebKit.h
Source/WebKit2/Shared/Cocoa/APIObject.mm
Source/WebKit2/Shared/WebOpenPanelParameters.cpp [moved from Source/WebKit2/UIProcess/API/APIOpenPanelParameters.cpp with 77% similarity]
Source/WebKit2/Shared/WebOpenPanelParameters.h [moved from Source/WebKit2/UIProcess/API/APIOpenPanelParameters.h with 78% similarity]
Source/WebKit2/UIProcess/API/APIUIClient.h
Source/WebKit2/UIProcess/API/C/WKAPICast.h
Source/WebKit2/UIProcess/API/C/WKOpenPanelParametersRef.cpp
Source/WebKit2/UIProcess/API/C/WKOpenPanelResultListener.cpp
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/API/Cocoa/WKOpenPanelParameters.h [deleted file]
Source/WebKit2/UIProcess/API/Cocoa/WKOpenPanelParameters.mm [deleted file]
Source/WebKit2/UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h [deleted file]
Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegate.h
Source/WebKit2/UIProcess/Cocoa/UIDelegate.h
Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebOpenPanelResultListenerProxy.cpp
Source/WebKit2/UIProcess/WebOpenPanelResultListenerProxy.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/ios/PageClientImplIOS.h
Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.h
Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Tools/ChangeLog
Tools/MiniBrowser/mac/WK2BrowserWindowController.m

index 7321c23..7d3d4e8 100644 (file)
@@ -1,3 +1,15 @@
+2016-04-14  Jiewen Tan  <jiewen_tan@apple.com>
+
+        Unreviewed, rolling out r199554.
+
+        The change breaks Yosemite Release/Debug build
+
+        Reverted changeset:
+
+        "[Mac] Add API for open panel handling to WKWebView"
+        https://bugs.webkit.org/show_bug.cgi?id=137759
+        http://trac.webkit.org/changeset/199554
+
 2016-04-14  Anders Carlsson  <andersca@apple.com>
 
         [Mac] Add API for open panel handling to WKWebView
index e63ff93..db38a30 100644 (file)
@@ -33,7 +33,6 @@
 #import <WebKit/WKNavigationAction.h>
 #import <WebKit/WKNavigationDelegate.h>
 #import <WebKit/WKNavigationResponse.h>
-#import <WebKit/WKOpenPanelParameters.h>
 #import <WebKit/WKPreferences.h>
 #import <WebKit/WKPreviewActionItem.h>
 #import <WebKit/WKPreviewActionItemIdentifiers.h>
index 157189e..b2f6a64 100644 (file)
@@ -46,7 +46,6 @@
 #import "WKNavigationDataInternal.h"
 #import "WKNavigationInternal.h"
 #import "WKNavigationResponseInternal.h"
-#import "WKOpenPanelParametersInternal.h"
 #import "WKPreferencesInternal.h"
 #import "WKProcessPoolInternal.h"
 #import "WKSecurityOriginInternal.h"
@@ -182,10 +181,6 @@ void* Object::newObject(size_t size, Type type)
         wrapper = [WKNavigationResponse alloc];
         break;
 
-    case Type::OpenPanelParameters:
-        wrapper = [WKOpenPanelParameters alloc];
-        break;
-
     case Type::PageGroup:
         wrapper = [WKBrowsingContextGroup alloc];
         break;
@@ -25,7 +25,7 @@
  */
 
 #include "config.h"
-#include "APIOpenPanelParameters.h"
+#include "WebOpenPanelParameters.h"
 
 #include "APIArray.h"
 #include "APIString.h"
 
 using namespace WebCore;
 
-namespace API {
+namespace WebKit {
 
-Ref<OpenPanelParameters> OpenPanelParameters::create(const FileChooserSettings& settings)
+PassRefPtr<WebOpenPanelParameters> WebOpenPanelParameters::create(const FileChooserSettings& settings)
 {
-    return adoptRef(*new OpenPanelParameters(settings));
+    return adoptRef(new WebOpenPanelParameters(settings));
 }
 
-OpenPanelParameters::OpenPanelParameters(const FileChooserSettings& settings)
+WebOpenPanelParameters::WebOpenPanelParameters(const FileChooserSettings& settings)
     : m_settings(settings)
 {
 }
 
-OpenPanelParameters::~OpenPanelParameters()
+WebOpenPanelParameters::~WebOpenPanelParameters()
 {
 }
 
-Ref<API::Array> OpenPanelParameters::acceptMIMETypes() const
+Ref<API::Array> WebOpenPanelParameters::acceptMIMETypes() const
 {
     return API::Array::createStringArray(m_settings.acceptMIMETypes);
 }
 
 #if ENABLE(MEDIA_CAPTURE)
-bool OpenPanelParameters::capture() const
+bool WebOpenPanelParameters::capture() const
 {
     return m_settings.capture;
 }
 #endif
 
-Ref<API::Array> OpenPanelParameters::selectedFileNames() const
+Ref<API::Array> WebOpenPanelParameters::selectedFileNames() const
 {
     return API::Array::createStringArray(m_settings.selectedFiles);
 }
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#pragma once
+#ifndef WebOpenPanelParameters_h
+#define WebOpenPanelParameters_h
 
 #include "APIObject.h"
 #include <WebCore/FileChooser.h>
+#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
 
 namespace API {
-
 class Array;
+}
+
+namespace WebKit {
 
-class OpenPanelParameters : public API::ObjectImpl<API::Object::Type::OpenPanelParameters> {
+class WebOpenPanelParameters : public API::ObjectImpl<API::Object::Type::OpenPanelParameters> {
 public:
-    static Ref<OpenPanelParameters> create(const WebCore::FileChooserSettings&);
-    ~OpenPanelParameters();
+    static PassRefPtr<WebOpenPanelParameters> create(const WebCore::FileChooserSettings&);
+    ~WebOpenPanelParameters();
 
     bool allowMultipleFiles() const { return m_settings.allowsMultipleFiles; }
     Ref<API::Array> acceptMIMETypes() const;
@@ -46,9 +51,11 @@ public:
 #endif
 
 private:
-    explicit OpenPanelParameters(const WebCore::FileChooserSettings&);
+    explicit WebOpenPanelParameters(const WebCore::FileChooserSettings&);
 
     WebCore::FileChooserSettings m_settings;
 };
 
-} // namespace API
+} // namespace WebKit
+
+#endif // WebOpenPanelParameters_h
index 6a8facd..0a9699a 100644 (file)
@@ -55,6 +55,7 @@ class UserMediaPermissionCheckProxy;
 class UserMediaPermissionRequestProxy;
 class WebColorPickerResultListenerProxy;
 class WebFrameProxy;
+class WebOpenPanelParameters;
 class WebOpenPanelResultListenerProxy;
 class WebPageProxy;
 struct NavigationActionData;
@@ -69,7 +70,6 @@ namespace API {
 class Data;
 class Dictionary;
 class Object;
-class OpenPanelParameters;
 class SecurityOrigin;
 
 class UIClient {
@@ -130,7 +130,7 @@ public:
         completionHandler(currentQuota);
     }
 
-    virtual bool runOpenPanel(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, const WebCore::SecurityOriginData&, OpenPanelParameters*, WebKit::WebOpenPanelResultListenerProxy*) { return false; }
+    virtual bool runOpenPanel(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, WebKit::WebOpenPanelParameters*, WebKit::WebOpenPanelResultListenerProxy*) { return false; }
     virtual bool decidePolicyForGeolocationPermissionRequest(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, SecurityOrigin*, WebKit::GeolocationPermissionRequestProxy*) { return false; }
     virtual bool decidePolicyForUserMediaPermissionRequest(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, SecurityOrigin&, SecurityOrigin&, WebKit::UserMediaPermissionRequestProxy&) { return false; }
     virtual bool checkUserMediaPermissionForOrigin(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, SecurityOrigin&, SecurityOrigin&, WebKit::UserMediaPermissionCheckProxy&) { return false; }
index 787e992..ad58d69 100644 (file)
@@ -58,7 +58,6 @@ class Navigation;
 class NavigationAction;
 class NavigationData;
 class NavigationResponse;
-class OpenPanelParameters;
 class PageConfiguration;
 class ProcessPoolConfiguration;
 class SessionState;
@@ -98,6 +97,7 @@ class WebMediaSessionMetadata;
 class WebNotification;
 class WebNotificationManagerProxy;
 class WebNotificationProvider;
+class WebOpenPanelParameters;
 class WebOpenPanelResultListenerProxy;
 class WebPageGroup;
 class WebPageProxy;
@@ -146,7 +146,7 @@ WK_ADD_API_MAPPING(WKNotificationManagerRef, WebNotificationManagerProxy)
 WK_ADD_API_MAPPING(WKNotificationPermissionRequestRef, NotificationPermissionRequest)
 WK_ADD_API_MAPPING(WKNotificationProviderRef, WebNotificationProvider)
 WK_ADD_API_MAPPING(WKNotificationRef, WebNotification)
-WK_ADD_API_MAPPING(WKOpenPanelParametersRef, API::OpenPanelParameters)
+WK_ADD_API_MAPPING(WKOpenPanelParametersRef, WebOpenPanelParameters)
 WK_ADD_API_MAPPING(WKOpenPanelResultListenerRef, WebOpenPanelResultListenerProxy)
 WK_ADD_API_MAPPING(WKPageGroupRef, WebPageGroup)
 WK_ADD_API_MAPPING(WKPageConfigurationRef, API::PageConfiguration)
index 9ea3f60..f7ba08b 100644 (file)
 #include "WKOpenPanelParametersRef.h"
 
 #include "APIArray.h"
-#include "APIOpenPanelParameters.h"
 #include "WKAPICast.h"
+#include "WebOpenPanelParameters.h"
 
 using namespace WebKit;
 
 WKTypeID WKOpenPanelParametersGetTypeID()
 {
-    return toAPI(API::OpenPanelParameters::APIType);
+    return toAPI(WebOpenPanelParameters::APIType);
 }
 
 bool WKOpenPanelParametersGetAllowsMultipleFiles(WKOpenPanelParametersRef parametersRef)
index b5c48af..8c79318 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "WKAPICast.h"
 #include "WebOpenPanelResultListenerProxy.h"
-#include <WebCore/URL.h>
 
 using namespace WebKit;
 
@@ -37,25 +36,9 @@ WKTypeID WKOpenPanelResultListenerGetTypeID()
     return toAPI(WebOpenPanelResultListenerProxy::APIType);
 }
 
-static Vector<String> filePathsFromFileURLs(const API::Array& fileURLs)
-{
-    Vector<String> filePaths;
-
-    size_t size = fileURLs.size();
-    filePaths.reserveInitialCapacity(size);
-
-    for (size_t i = 0; i < size; ++i) {
-        API::URL* apiURL = fileURLs.at<API::URL>(i);
-        if (apiURL)
-            filePaths.uncheckedAppend(WebCore::URL(WebCore::URL(), apiURL->string()).fileSystemPath());
-    }
-
-    return filePaths;
-}
-
 void WKOpenPanelResultListenerChooseFiles(WKOpenPanelResultListenerRef listenerRef, WKArrayRef fileURLsRef)
 {
-    toImpl(listenerRef)->chooseFiles(filePathsFromFileURLs(*toImpl(fileURLsRef)));
+    toImpl(listenerRef)->chooseFiles(toImpl(fileURLsRef));
 }
 
 void WKOpenPanelResultListenerCancel(WKOpenPanelResultListenerRef listenerRef)
index 8e3033e..a2aafb3 100644 (file)
@@ -40,7 +40,6 @@
 #include "APINavigationAction.h"
 #include "APINavigationClient.h"
 #include "APINavigationResponse.h"
-#include "APIOpenPanelParameters.h"
 #include "APIPageConfiguration.h"
 #include "APIPolicyClient.h"
 #include "APISessionState.h"
@@ -62,6 +61,7 @@
 #include "WebFormClient.h"
 #include "WebImage.h"
 #include "WebInspectorProxy.h"
+#include "WebOpenPanelParameters.h"
 #include "WebOpenPanelResultListenerProxy.h"
 #include "WebPageGroup.h"
 #include "WebPageMessages.h"
@@ -2053,7 +2053,7 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient
             completionHandler(m_client.exceededDatabaseQuota(toAPI(page), toAPI(frame), toAPI(origin), toAPI(databaseName.impl()), toAPI(databaseDisplayName.impl()), currentQuota, currentOriginUsage, currentDatabaseUsage, expectedUsage, m_client.base.clientInfo));
         }
 
-        bool runOpenPanel(WebPageProxy* page, WebFrameProxy* frame, const WebCore::SecurityOriginData&, API::OpenPanelParameters* parameters, WebOpenPanelResultListenerProxy* listener) override
+        bool runOpenPanel(WebPageProxy* page, WebFrameProxy* frame, WebOpenPanelParameters* parameters, WebOpenPanelResultListenerProxy* listener) override
         {
             if (!m_client.runOpenPanel)
                 return false;
diff --git a/Source/WebKit2/UIProcess/API/Cocoa/WKOpenPanelParameters.h b/Source/WebKit2/UIProcess/API/Cocoa/WKOpenPanelParameters.h
deleted file mode 100644 (file)
index 75faedc..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <WebKit/WKFoundation.h>
-
-#if WK_API_ENABLED
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! WKOpenPanelParameters contains parameters that a file upload control has specified.
- */
-WK_CLASS_AVAILABLE(WK_MAC_TBA, NA)
-@interface WKOpenPanelParameters : NSObject
-
-/*! @abstract Whether the file upload control supports multiple files.
- */
-@property (nonatomic, readonly) BOOL allowsMultipleSelection;
-
-@end
-
-NS_ASSUME_NONNULL_END
-
-#endif
diff --git a/Source/WebKit2/UIProcess/API/Cocoa/WKOpenPanelParameters.mm b/Source/WebKit2/UIProcess/API/Cocoa/WKOpenPanelParameters.mm
deleted file mode 100644 (file)
index f77cc6e..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "WKOpenPanelParametersInternal.h"
-
-#if WK_API_ENABLED
-
-@implementation WKOpenPanelParameters
-
-- (BOOL)allowsMultipleSelection
-{
-    return _openPanelParameters->allowMultipleFiles();
-}
-
-#pragma mark WKObject protocol implementation
-
-- (API::Object&)_apiObject
-{
-    return *_openPanelParameters;
-}
-
-@end
-
-#endif
diff --git a/Source/WebKit2/UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h b/Source/WebKit2/UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h
deleted file mode 100644 (file)
index 0292eeb..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "WKOpenPanelParameters.h"
-
-#if WK_API_ENABLED
-
-#import "APIOpenPanelParameters.h"
-#import "WKObject.h"
-
-namespace API {
-
-inline WKOpenPanelParameters *wrapper(OpenPanelParameters& openPanelParameters)
-{
-    ASSERT([openPanelParameters.wrapper() isKindOfClass:[WKOpenPanelParameters class]]);
-
-    return (WKOpenPanelParameters *)openPanelParameters.wrapper();
-}
-
-}
-
-@interface WKOpenPanelParameters () <WKObject> {
-@package
-    API::ObjectStorage<API::OpenPanelParameters> _openPanelParameters;
-}
-@end
-
-#endif
index 2a12bf0..d9d8621 100644 (file)
@@ -34,7 +34,6 @@ NS_ASSUME_NONNULL_BEGIN
 
 @class WKFrameInfo;
 @class WKNavigationAction;
-@class WKOpenPanelParameters;
 @class WKPreviewElementInfo;
 @class WKWebViewConfiguration;
 @class WKWindowFeatures;
@@ -144,7 +143,7 @@ NS_ASSUME_NONNULL_BEGIN
  Returning nil will result in WebKit's default preview behavior. webView:commitPreviewingViewController: will only be invoked
  if a non-nil view controller was returned.
  */
-- (nullable UIViewController *)webView:(WKWebView *)webView previewingViewControllerForElement:(WKPreviewElementInfo *)elementInfo defaultActions:(NSArray<id <WKPreviewActionItem>> *)previewActions WK_AVAILABLE(NA, WK_IOS_TBA);
+- (nullable UIViewController *)webView:(WKWebView *)webView previewingViewControllerForElement:(WKPreviewElementInfo *)elementInfo defaultActions:(NSArray <id <WKPreviewActionItem>> *)previewActions WK_AVAILABLE(NA, WK_IOS_TBA);
 
 /*! @abstract Allows your app to pop to the view controller it created.
  @param webView The web view invoking the delegate method.
@@ -154,20 +153,6 @@ NS_ASSUME_NONNULL_BEGIN
 
 #endif // TARGET_OS_IPHONE
 
-#if !TARGET_OS_IPHONE
-
-/*! @abstract Displays a file upload panel.
- @param webView The web view invoking the delegate method.
- @param parameters Parameters describing the file upload control.
- @param frame Information about the frame whose file upload control initiated this call.
- @param completionHandler The completion handler to call after open panel has been dismissed. Pass the selected URLs if the user chose OK, otherwise nil.
-
- If you do not implement this method, the web view will behave as if the user selected the Cancel button.
- */
-- (void)webView:(WKWebView *)webView runOpenPanelWithParameters:(WKOpenPanelParameters *)parameters initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(NSArray<NSURL *> * WK_NULLABLE_SPECIFIER URLs))completionHandler WK_AVAILABLE(WK_MAC_TBA, NA);
-
-#endif
-
 @end
 
 NS_ASSUME_NONNULL_END
index 083c1f9..20df12b 100644 (file)
@@ -86,9 +86,6 @@ private:
         void runJavaScriptPrompt(WebKit::WebPageProxy*, const WTF::String&, const WTF::String&, WebKit::WebFrameProxy*, const WebCore::SecurityOriginData&, std::function<void (const WTF::String&)> completionHandler) override;
         void exceededDatabaseQuota(WebPageProxy*, WebFrameProxy*, API::SecurityOrigin*, const WTF::String& databaseName, const WTF::String& displayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentUsage, unsigned long long expectedUsage, std::function<void (unsigned long long)>) override;
         void reachedApplicationCacheOriginQuota(WebPageProxy*, const WebCore::SecurityOrigin&, uint64_t currentQuota, uint64_t totalBytesNeeded, std::function<void (unsigned long long)> completionHandler) override;
-#if PLATFORM(MAC)
-        bool runOpenPanel(WebPageProxy*, WebFrameProxy*, const WebCore::SecurityOriginData&, API::OpenPanelParameters*, WebOpenPanelResultListenerProxy*) override;
-#endif
         void printFrame(WebKit::WebPageProxy*, WebKit::WebFrameProxy*) override;
 #if PLATFORM(IOS)
 #if HAVE(APP_LINKS)
@@ -111,9 +108,6 @@ private:
         bool webViewRunJavaScriptAlertPanelWithMessageInitiatedByFrameCompletionHandler : 1;
         bool webViewRunJavaScriptConfirmPanelWithMessageInitiatedByFrameCompletionHandler : 1;
         bool webViewRunJavaScriptTextInputPanelWithPromptDefaultTextInitiatedByFrameCompletionHandler : 1;
-#if PLATFORM(MAC)
-        bool webViewRunOpenPanelWithParametersInitiatedByFrameCompletionHandler : 1;
-#endif
         bool webViewDecideDatabaseQuotaForSecurityOriginCurrentQuotaCurrentOriginUsageCurrentDatabaseUsageExpectedUsageDecisionHandler : 1;
         bool webViewDecideWebApplicationCacheQuotaForSecurityOriginCurrentQuotaTotalBytesNeeded : 1;
         bool webViewPrintFrame : 1;
index 9c6b6bc..3ff5031 100644 (file)
 #import "NavigationActionData.h"
 #import "WKFrameInfoInternal.h"
 #import "WKNavigationActionInternal.h"
-#import "WKOpenPanelParametersInternal.h"
 #import "WKSecurityOriginInternal.h"
 #import "WKWebViewConfigurationInternal.h"
 #import "WKWebViewInternal.h"
 #import "WKWindowFeaturesInternal.h"
 #import "WKUIDelegatePrivate.h"
-#import "WebOpenPanelResultListenerProxy.h"
 #import "_WKContextMenuElementInfo.h"
 #import "_WKFrameHandleInternal.h"
 #import <WebCore/SecurityOriginData.h>
@@ -80,11 +78,6 @@ void UIDelegate::setDelegate(id <WKUIDelegate> delegate)
     m_delegateMethods.webViewRunJavaScriptAlertPanelWithMessageInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:)];
     m_delegateMethods.webViewRunJavaScriptConfirmPanelWithMessageInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:completionHandler:)];
     m_delegateMethods.webViewRunJavaScriptTextInputPanelWithPromptDefaultTextInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:completionHandler:)];
-
-#if PLATFORM(MAC)
-    m_delegateMethods.webViewRunOpenPanelWithParametersInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:)];
-#endif
-
     m_delegateMethods.webViewDecideDatabaseQuotaForSecurityOriginCurrentQuotaCurrentOriginUsageCurrentDatabaseUsageExpectedUsageDecisionHandler = [delegate respondsToSelector:@selector(_webView:decideDatabaseQuotaForSecurityOrigin:currentQuota:currentOriginUsage:currentDatabaseUsage:expectedUsage:decisionHandler:)];
     m_delegateMethods.webViewDecideWebApplicationCacheQuotaForSecurityOriginCurrentQuotaTotalBytesNeeded = [delegate respondsToSelector:@selector(_webView:decideWebApplicationCacheQuotaForSecurityOrigin:currentQuota:totalBytesNeeded:decisionHandler:)];
     m_delegateMethods.webViewPrintFrame = [delegate respondsToSelector:@selector(_webView:printFrame:)];
@@ -257,40 +250,6 @@ void UIDelegate::UIClient::exceededDatabaseQuota(WebPageProxy*, WebFrameProxy*,
     }];
 }
 
-#if PLATFORM(MAC)
-bool UIDelegate::UIClient::runOpenPanel(WebPageProxy*, WebFrameProxy* webFrameProxy, const WebCore::SecurityOriginData& securityOriginData, API::OpenPanelParameters* openPanelParameters, WebOpenPanelResultListenerProxy* listener)
-{
-    if (!m_uiDelegate.m_delegateMethods.webViewRunOpenPanelWithParametersInitiatedByFrameCompletionHandler)
-        return false;
-
-    auto delegate = m_uiDelegate.m_delegate.get();
-    if (!delegate)
-        return false;
-
-    auto frame = API::FrameInfo::create(*webFrameProxy, securityOriginData.securityOrigin());
-    RefPtr<WebOpenPanelResultListenerProxy> resultListener = listener;
-
-    RefPtr<CompletionHandlerCallChecker> checker = CompletionHandlerCallChecker::create(delegate.get(), @selector(webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:));
-
-    [delegate webView:m_uiDelegate.m_webView runOpenPanelWithParameters:wrapper(*openPanelParameters) initiatedByFrame:wrapper(frame) completionHandler:[checker, resultListener](NSArray<NSURL *> *URLs) {
-        checker->didCallCompletionHandler();
-
-        if (!URLs) {
-            resultListener->cancel();
-            return;
-        }
-
-        Vector<String> filenames;
-        for (NSURL *url in URLs)
-            filenames.append(url.fileSystemRepresentation);
-
-        resultListener->chooseFiles(filenames);
-    }];
-
-    return true;
-}
-#endif
-
 void UIDelegate::UIClient::reachedApplicationCacheOriginQuota(WebPageProxy*, const WebCore::SecurityOrigin& securityOrigin, uint64_t currentQuota, uint64_t totalBytesNeeded, std::function<void (unsigned long long)> completionHandler)
 {
     if (!m_uiDelegate.m_delegateMethods.webViewDecideWebApplicationCacheQuotaForSecurityOriginCurrentQuotaTotalBytesNeeded) {
index 8b21d7f..21239db 100644 (file)
@@ -151,7 +151,7 @@ public:
 
     virtual void handleDownloadRequest(DownloadProxy*) = 0;
 
-    virtual bool handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, API::OpenPanelParameters*, WebOpenPanelResultListenerProxy*) { return false; }
+    virtual bool handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, WebOpenPanelParameters*, WebOpenPanelResultListenerProxy*) { return false; }
 
     virtual void didChangeContentSize(const WebCore::IntSize&) = 0;
 
index d503e6a..a377e4a 100644 (file)
@@ -45,22 +45,38 @@ WebOpenPanelResultListenerProxy::~WebOpenPanelResultListenerProxy()
 {
 }
 
+static Vector<String> filePathsFromFileURLs(const API::Array& fileURLs)
+{
+    Vector<String> filePaths;
+
+    size_t size = fileURLs.size();
+    filePaths.reserveInitialCapacity(size);
+
+    for (size_t i = 0; i < size; ++i) {
+        API::URL* apiURL = fileURLs.at<API::URL>(i);
+        if (apiURL)
+            filePaths.uncheckedAppend(URL(URL(), apiURL->string()).fileSystemPath());
+    }
+
+    return filePaths;
+}
+
 #if PLATFORM(IOS)
-void WebOpenPanelResultListenerProxy::chooseFiles(const Vector<WTF::String>& filenames, const String& displayString, const API::Data* iconImageData)
+void WebOpenPanelResultListenerProxy::chooseFiles(API::Array* fileURLsArray, API::String* displayString, const API::Data* iconImageData)
 {
     if (!m_page)
         return;
 
-    m_page->didChooseFilesForOpenPanelWithDisplayStringAndIcon(filenames, displayString, iconImageData);
+    m_page->didChooseFilesForOpenPanelWithDisplayStringAndIcon(filePathsFromFileURLs(*fileURLsArray), displayString ? displayString->string() : String(), iconImageData);
 }
 #endif
 
-void WebOpenPanelResultListenerProxy::chooseFiles(const Vector<String>& filenames)
+void WebOpenPanelResultListenerProxy::chooseFiles(API::Array* fileURLsArray)
 {
     if (!m_page)
         return;
 
-    m_page->didChooseFilesForOpenPanel(filenames);
+    m_page->didChooseFilesForOpenPanel(filePathsFromFileURLs(*fileURLsArray));
 }
 
 void WebOpenPanelResultListenerProxy::cancel()
index ef50023..ae6eaf7 100644 (file)
 #define WebOpenPanelResultListenerProxy_h
 
 #include "APIObject.h"
-#include <wtf/Forward.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
-#include <wtf/Vector.h>
 
 namespace API {
 class Array;
@@ -52,9 +50,9 @@ public:
     virtual ~WebOpenPanelResultListenerProxy();
 
 #if PLATFORM(IOS)
-    void chooseFiles(const Vector<String>& filenames, const String& displayString, const API::Data* iconImageData);
+    void chooseFiles(API::Array*, API::String* displayString, const API::Data* iconImageData);
 #endif
-    void chooseFiles(const Vector<String>& filenames);
+    void chooseFiles(API::Array*);
     void cancel();
 
     void invalidate();
index ec01593..b9a1ccd 100644 (file)
@@ -42,7 +42,6 @@
 #include "APINavigationAction.h"
 #include "APINavigationClient.h"
 #include "APINavigationResponse.h"
-#include "APIOpenPanelParameters.h"
 #include "APIPageConfiguration.h"
 #include "APIPolicyClient.h"
 #include "APISecurityOrigin.h"
@@ -91,6 +90,7 @@
 #include "WebInspectorProxyMessages.h"
 #include "WebNavigationState.h"
 #include "WebNotificationManagerProxy.h"
+#include "WebOpenPanelParameters.h"
 #include "WebOpenPanelResultListenerProxy.h"
 #include "WebPageCreationParameters.h"
 #include "WebPageGroup.h"
@@ -3853,7 +3853,7 @@ void WebPageProxy::pageDidScroll()
     m_uiClient->pageDidScroll(this);
 }
 
-void WebPageProxy::runOpenPanel(uint64_t frameID, const SecurityOriginData& frameSecurityOrigin, const FileChooserSettings& settings)
+void WebPageProxy::runOpenPanel(uint64_t frameID, const FileChooserSettings& settings)
 {
     if (m_openPanelResultListener) {
         m_openPanelResultListener->invalidate();
@@ -3863,15 +3863,14 @@ void WebPageProxy::runOpenPanel(uint64_t frameID, const SecurityOriginData& fram
     WebFrameProxy* frame = m_process->webFrame(frameID);
     MESSAGE_CHECK(frame);
 
-    Ref<API::OpenPanelParameters> parameters = API::OpenPanelParameters::create(settings);
+    RefPtr<WebOpenPanelParameters> parameters = WebOpenPanelParameters::create(settings);
     m_openPanelResultListener = WebOpenPanelResultListenerProxy::create(this);
 
     // Since runOpenPanel() can spin a nested run loop we need to turn off the responsiveness timer.
     m_process->responsivenessTimer().stop();
 
-
-    if (!m_uiClient->runOpenPanel(this, frame, frameSecurityOrigin, parameters.ptr(), m_openPanelResultListener.get())) {
-        if (!m_pageClient.handleRunOpenPanel(this, frame, parameters.ptr(), m_openPanelResultListener.get()))
+    if (!m_uiClient->runOpenPanel(this, frame, parameters.get(), m_openPanelResultListener.get())) {
+        if (!m_pageClient.handleRunOpenPanel(this, frame, parameters.get(), m_openPanelResultListener.get()))
             didCancelForOpenPanel();
     }
 }
index 3c9ba37..5ba9892 100644 (file)
@@ -1210,7 +1210,7 @@ private:
     void runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, RefPtr<Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::DelayedReply>);
     void didChangeViewportProperties(const WebCore::ViewportAttributes&);
     void pageDidScroll();
-    void runOpenPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const WebCore::FileChooserSettings&);
+    void runOpenPanel(uint64_t frameID, const WebCore::FileChooserSettings&);
     void printFrame(uint64_t frameID);
     void exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, PassRefPtr<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply>);
     void reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, PassRefPtr<Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply>);
index ca88d60..dc51259 100644 (file)
@@ -71,7 +71,7 @@ messages -> WebPageProxy {
 
     RunBeforeUnloadConfirmPanel(String message, uint64_t frameID) -> (bool shouldClose) Delayed
     PageDidScroll()
-    RunOpenPanel(uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, struct WebCore::FileChooserSettings parameters)
+    RunOpenPanel(uint64_t frameID, struct WebCore::FileChooserSettings parameters)
     PrintFrame(uint64_t frameID) -> ()
     RunModal()
     NotifyScrollerThumbIsVisibleInRect(WebCore::IntRect scrollerThumb)
index 907b17d..2de8f1e 100644 (file)
@@ -132,7 +132,7 @@ private:
     void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold) override;
     void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect) override;
 
-    bool handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, API::OpenPanelParameters*, WebOpenPanelResultListenerProxy*) override;
+    bool handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, WebOpenPanelParameters*, WebOpenPanelResultListenerProxy*) override;
     void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID) override;
     double minimumZoomScale() const override;
     WebCore::FloatRect documentRect() const override;
index 6cf7f11..a0f227f 100644 (file)
@@ -560,7 +560,7 @@ void PageClientImpl::showPlaybackTargetPicker(bool hasVideo, const IntRect& elem
     [m_contentView _showPlaybackTargetPicker:hasVideo fromRect:elementRect];
 }
 
-bool PageClientImpl::handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, API::OpenPanelParameters* parameters, WebOpenPanelResultListenerProxy* listener)
+bool PageClientImpl::handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, WebOpenPanelParameters* parameters, WebOpenPanelResultListenerProxy* listener)
 {
     [m_contentView _showRunOpenPanel:parameters resultListener:listener];
     return true;
index be0121c..74a6a1a 100644 (file)
 #import <wtf/Vector.h>
 #import <wtf/text/WTFString.h>
 
-namespace API {
-class OpenPanelParameters;
-}
-
 namespace WebCore {
 class Color;
 class FloatQuad;
@@ -57,6 +53,7 @@ class IntSize;
 namespace WebKit {
 class NativeWebTouchEvent;
 class SmartMagnificationController;
+class WebOpenPanelParameters;
 class WebOpenPanelResultListenerProxy;
 class WebPageProxy;
 }
@@ -212,7 +209,7 @@ struct WKAutoCorrectionData {
 - (void)_overflowScrollingDidEnd;
 - (void)_didUpdateBlockSelectionWithTouch:(WebKit::SelectionTouch)touch withFlags:(WebKit::SelectionFlags)flags growThreshold:(CGFloat)growThreshold shrinkThreshold:(CGFloat)shrinkThreshold;
 - (void)_showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(const WebCore::IntRect&)elementRect;
-- (void)_showRunOpenPanel:(API::OpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener;
+- (void)_showRunOpenPanel:(WebKit::WebOpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener;
 - (void)accessoryDone;
 - (void)_didHandleKeyEvent:(WebIOSEvent *)event eventWasHandled:(BOOL)eventWasHandled;
 - (Vector<WebKit::OptionItem>&) assistedNodeSelectOptions;
index d3d1f9d..6f42620 100644 (file)
@@ -3661,7 +3661,7 @@ static bool isAssistableInputType(InputType type)
     [_airPlayRoutePicker show:hasVideo fromRect:elementRect];
 }
 
-- (void)_showRunOpenPanel:(API::OpenPanelParameters*)parameters resultListener:(WebOpenPanelResultListenerProxy*)listener
+- (void)_showRunOpenPanel:(WebOpenPanelParameters*)parameters resultListener:(WebOpenPanelResultListenerProxy*)listener
 {
     ASSERT(!_fileUploadPanel);
     if (_fileUploadPanel)
index 77ac20a..69d7497 100644 (file)
 @class WKContentView;
 @protocol WKFileUploadPanelDelegate;
 
-namespace API {
-class OpenPanelParameters;
-}
-
 namespace WebKit {
+class WebOpenPanelParameters;
 class WebOpenPanelResultListenerProxy;
 }
 
 @interface WKFileUploadPanel : UIViewController
 @property (nonatomic, assign) id <WKFileUploadPanelDelegate> delegate;
 - (instancetype)initWithView:(WKContentView *)view;
-- (void)presentWithParameters:(API::OpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener;
+- (void)presentWithParameters:(WebKit::WebOpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener;
 - (void)dismiss;
 @end
 
index c1524d5..72d2b98 100644 (file)
 
 #import "APIArray.h"
 #import "APIData.h"
-#import "APIOpenPanelParameters.h"
 #import "APIString.h"
 #import "UIKitSPI.h"
 #import "WKContentViewInteraction.h"
 #import "WKData.h"
 #import "WKStringCF.h"
 #import "WKURLCF.h"
+#import "WebOpenPanelParameters.h"
 #import "WebOpenPanelResultListenerProxy.h"
 #import "WebPageProxy.h"
 #import <AVFoundation/AVFoundation.h>
@@ -333,21 +333,24 @@ static UIImage* iconForFile(NSURL *file)
         return;
     }
 
-    Vector<String> filenames;
-    filenames.reserveInitialCapacity(count);
+    Vector<RefPtr<API::Object>> urls;
+    urls.reserveInitialCapacity(count);
     for (NSURL *fileURL in fileURLs)
-        filenames.uncheckedAppend(fileURL.fileSystemRepresentation);
+        urls.uncheckedAppend(adoptRef(toImpl(WKURLCreateWithCFURL((CFURLRef)fileURL))));
+    Ref<API::Array> fileURLsRef = API::Array::create(WTFMove(urls));
 
     NSData *jpeg = UIImageJPEGRepresentation(iconImage, 1.0);
     RefPtr<API::Data> iconImageDataRef = adoptRef(toImpl(WKDataCreate(reinterpret_cast<const unsigned char*>([jpeg bytes]), [jpeg length])));
 
-    _listener->chooseFiles(filenames, displayString, iconImageDataRef.get());
+    RefPtr<API::String> displayStringRef = adoptRef(toImpl(WKStringCreateWithCFString((CFStringRef)displayString)));
+
+    _listener->chooseFiles(fileURLsRef.ptr(), displayStringRef.get(), iconImageDataRef.get());
     [self _dispatchDidDismiss];
 }
 
 #pragma mark - Present / Dismiss API
 
-- (void)presentWithParameters:(API::OpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener
+- (void)presentWithParameters:(WebKit::WebOpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener
 {
     ASSERT(!_listener);
 
index b652bbc..a20d509 100644 (file)
                1A6563E41B7A8C50009CF787 /* APIWindowFeatures.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6563E21B7A8C50009CF787 /* APIWindowFeatures.cpp */; };
                1A6563E51B7A8C50009CF787 /* APIWindowFeatures.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6563E31B7A8C50009CF787 /* APIWindowFeatures.h */; };
                1A66BF8F18A052ED002071B4 /* WKWebViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A66BF8E18A052ED002071B4 /* WKWebViewInternal.h */; };
-               1A67CD2E1CBC513F00BFE3EA /* WKOpenPanelParametersInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A67CD2D1CBC513F00BFE3EA /* WKOpenPanelParametersInternal.h */; };
                1A6F9F9011E13EFC00DB1371 /* CommandLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */; };
                1A6F9FB711E1408500DB1371 /* CommandLinePOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6F9FB611E1408500DB1371 /* CommandLinePOSIX.cpp */; };
                1A6FA21E1BD0435B00AAA650 /* WKFrameInfoPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6FA21D1BD0435B00AAA650 /* WKFrameInfoPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                1AC75380183BE50F0072CB15 /* DataReference.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC7537E183BE50F0072CB15 /* DataReference.h */; };
                1AC75A1B1B3368270056745B /* HangDetectionDisabler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC75A1A1B3368270056745B /* HangDetectionDisabler.h */; };
                1AC75A1E1B33695E0056745B /* HangDetectionDisablerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AC75A1C1B33695E0056745B /* HangDetectionDisablerMac.mm */; };
-               1ACC50F11CBC381D003C7D03 /* WKOpenPanelParameters.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1ACC50EF1CBC381D003C7D03 /* WKOpenPanelParameters.mm */; };
-               1ACC50F21CBC381D003C7D03 /* WKOpenPanelParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACC50F01CBC381D003C7D03 /* WKOpenPanelParameters.h */; settings = {ATTRIBUTES = (Public, ); }; };
                1ACC87BA1981C341003D1AF4 /* WKNavigationPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACC87B91981C341003D1AF4 /* WKNavigationPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                1ACECD2417162DB1001FC9EF /* StorageAreaMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ACECD2217162DB1001FC9EF /* StorageAreaMap.cpp */; };
                1ACECD2517162DB1001FC9EF /* StorageAreaMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACECD2317162DB1001FC9EF /* StorageAreaMap.h */; };
                BC857F7E12B82CEE00EDEB2E /* WebOpenPanelResultListenerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC1DFEA312B31F87005DF730 /* WebOpenPanelResultListenerProxy.cpp */; };
                BC857F8512B82D0B00EDEB2E /* WebOpenPanelResultListener.h in Headers */ = {isa = PBXBuildFile; fileRef = BC857F8312B82D0B00EDEB2E /* WebOpenPanelResultListener.h */; };
                BC857F8612B82D0B00EDEB2E /* WebOpenPanelResultListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC857F8412B82D0B00EDEB2E /* WebOpenPanelResultListener.cpp */; };
-               BC857FB512B830E600EDEB2E /* APIOpenPanelParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = BC857FB312B830E600EDEB2E /* APIOpenPanelParameters.h */; };
-               BC857FB612B830E600EDEB2E /* APIOpenPanelParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC857FB412B830E600EDEB2E /* APIOpenPanelParameters.cpp */; };
+               BC857FB512B830E600EDEB2E /* WebOpenPanelParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = BC857FB312B830E600EDEB2E /* WebOpenPanelParameters.h */; };
+               BC857FB612B830E600EDEB2E /* WebOpenPanelParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC857FB412B830E600EDEB2E /* WebOpenPanelParameters.cpp */; };
                BC857FE612B843D800EDEB2E /* WKOpenPanelParametersRef.h in Headers */ = {isa = PBXBuildFile; fileRef = BC857FE412B843D800EDEB2E /* WKOpenPanelParametersRef.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC85806212B8505700EDEB2E /* WKOpenPanelResultListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC1DFE8E12B31CA8005DF730 /* WKOpenPanelResultListener.cpp */; };
                BC85806312B8505700EDEB2E /* WKOpenPanelParametersRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC857FE512B843D800EDEB2E /* WKOpenPanelParametersRef.cpp */; };
                1A6563E21B7A8C50009CF787 /* APIWindowFeatures.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIWindowFeatures.cpp; sourceTree = "<group>"; };
                1A6563E31B7A8C50009CF787 /* APIWindowFeatures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIWindowFeatures.h; sourceTree = "<group>"; };
                1A66BF8E18A052ED002071B4 /* WKWebViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewInternal.h; sourceTree = "<group>"; };
-               1A67CD2D1CBC513F00BFE3EA /* WKOpenPanelParametersInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKOpenPanelParametersInternal.h; sourceTree = "<group>"; };
                1A6D141F1B0167D500785FF0 /* Info-OSX-10.9-10.10.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-OSX-10.9-10.10.plist"; sourceTree = "<group>"; };
                1A6D14211B01681600785FF0 /* PluginService.32-64-10.9-10.10.Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "PluginService.32-64-10.9-10.10.Info.plist"; path = "PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist"; sourceTree = SOURCE_ROOT; };
                1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommandLine.h; sourceTree = "<group>"; };
                1AC7537E183BE50F0072CB15 /* DataReference.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataReference.h; sourceTree = "<group>"; };
                1AC75A1A1B3368270056745B /* HangDetectionDisabler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HangDetectionDisabler.h; sourceTree = "<group>"; };
                1AC75A1C1B33695E0056745B /* HangDetectionDisablerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HangDetectionDisablerMac.mm; sourceTree = "<group>"; };
-               1ACC50EF1CBC381D003C7D03 /* WKOpenPanelParameters.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKOpenPanelParameters.mm; sourceTree = "<group>"; };
-               1ACC50F01CBC381D003C7D03 /* WKOpenPanelParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKOpenPanelParameters.h; sourceTree = "<group>"; };
                1ACC87B91981C341003D1AF4 /* WKNavigationPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNavigationPrivate.h; sourceTree = "<group>"; };
                1ACECD2217162DB1001FC9EF /* StorageAreaMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageAreaMap.cpp; sourceTree = "<group>"; };
                1ACECD2317162DB1001FC9EF /* StorageAreaMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageAreaMap.h; sourceTree = "<group>"; };
                BC857E8512B71EBB00EDEB2E /* WebPageProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPageProxyMac.mm; sourceTree = "<group>"; };
                BC857F8312B82D0B00EDEB2E /* WebOpenPanelResultListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebOpenPanelResultListener.h; sourceTree = "<group>"; };
                BC857F8412B82D0B00EDEB2E /* WebOpenPanelResultListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebOpenPanelResultListener.cpp; sourceTree = "<group>"; };
-               BC857FB312B830E600EDEB2E /* APIOpenPanelParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIOpenPanelParameters.h; sourceTree = "<group>"; };
-               BC857FB412B830E600EDEB2E /* APIOpenPanelParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIOpenPanelParameters.cpp; sourceTree = "<group>"; };
+               BC857FB312B830E600EDEB2E /* WebOpenPanelParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebOpenPanelParameters.h; sourceTree = "<group>"; };
+               BC857FB412B830E600EDEB2E /* WebOpenPanelParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebOpenPanelParameters.cpp; sourceTree = "<group>"; };
                BC857FE412B843D800EDEB2E /* WKOpenPanelParametersRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKOpenPanelParametersRef.h; sourceTree = "<group>"; };
                BC857FE512B843D800EDEB2E /* WKOpenPanelParametersRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKOpenPanelParametersRef.cpp; sourceTree = "<group>"; };
                BC8699B2116AADAA002A925B /* WKView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKView.h; sourceTree = "<group>"; };
                                905620E912BC248B000799B6 /* WebMemorySampler.h */,
                                C0337DAF127A28D0008FF4F4 /* WebMouseEvent.cpp */,
                                BCF69F981176CED600471A52 /* WebNavigationDataStore.h */,
+                               BC857FB412B830E600EDEB2E /* WebOpenPanelParameters.cpp */,
+                               BC857FB312B830E600EDEB2E /* WebOpenPanelParameters.h */,
                                C06C6093124C14430001682F /* WebPageCreationParameters.cpp */,
                                C06C6094124C14430001682F /* WebPageCreationParameters.h */,
                                BC7B625112A43C9600D174A4 /* WebPageGroupData.cpp */,
                                1AD60F5C18E20F4C0020C034 /* WKWindowFeatures.h */,
                                1AD60F5B18E20F4C0020C034 /* WKWindowFeatures.mm */,
                                1AD60F5F18E20F740020C034 /* WKWindowFeaturesInternal.h */,
-                               1ACC50EF1CBC381D003C7D03 /* WKOpenPanelParameters.mm */,
-                               1ACC50F01CBC381D003C7D03 /* WKOpenPanelParameters.h */,
-                               1A67CD2D1CBC513F00BFE3EA /* WKOpenPanelParametersInternal.h */,
                        );
                        path = Cocoa;
                        sourceTree = "<group>";
                                BC111B47112F616900337BAB /* mac */,
                                99C81D5B1C20E817005C4C82 /* APIAutomationClient.h */,
                                990D28B31C6526D400986977 /* APIAutomationSessionClient.h */,
-                               BC857FB412B830E600EDEB2E /* APIOpenPanelParameters.cpp */,
-                               BC857FB312B830E600EDEB2E /* APIOpenPanelParameters.h */,
                                076E884D1A13CADF005E90FC /* APIContextMenuClient.h */,
                                83891B621A68B3420030F386 /* APIDiagnosticLoggingClient.h */,
                                1F7D36C018DA513F00D9D659 /* APIDownloadClient.h */,
                                83891B6C1A68C30B0030F386 /* DiagnosticLoggingClient.h in Headers */,
                                A1DF631318E0B7C8003A3E2A /* DownloadClient.h in Headers */,
                                1AB7D4CA1288AAA700CFD08C /* DownloadProxy.h in Headers */,
-                               1ACC50F21CBC381D003C7D03 /* WKOpenPanelParameters.h in Headers */,
                                1AD25E96167AB08100EA9BCD /* DownloadProxyMap.h in Headers */,
                                1AB7D61A1288B9D900CFD08C /* DownloadProxyMessages.h in Headers */,
                                C517388112DF8F4F00EE3F47 /* DragControllerAction.h in Headers */,
                                31BA924E148831260062EDB5 /* WebNotificationManagerMessages.h in Headers */,
                                31A2EC4B148997C200810D71 /* WebNotificationManagerProxy.h in Headers */,
                                31A2EC4E148997C200810D71 /* WebNotificationProvider.h in Headers */,
-                               BC857FB512B830E600EDEB2E /* APIOpenPanelParameters.h in Headers */,
+                               BC857FB512B830E600EDEB2E /* WebOpenPanelParameters.h in Headers */,
                                BC857F8512B82D0B00EDEB2E /* WebOpenPanelResultListener.h in Headers */,
                                BC1DFEA412B31F87005DF730 /* WebOpenPanelResultListenerProxy.h in Headers */,
                                BC032D8F10F437A00058C15A /* WebPage.h in Headers */,
                                BC7043CC12F75EE0006472B9 /* WKBundleNavigationAction.h in Headers */,
                                51A728DE1B1BAD3800102EEE /* WKBundleNavigationActionPrivate.h in Headers */,
                                BC4BEFE1120A1A4C00FBA0C7 /* WKBundleNodeHandle.h in Headers */,
-                               1A67CD2E1CBC513F00BFE3EA /* WKOpenPanelParametersInternal.h in Headers */,
                                BC57450C1263B155006F0F12 /* WKBundleNodeHandlePrivate.h in Headers */,
                                BC20528111C94284008F3375 /* WKBundlePage.h in Headers */,
                                7CF47FF717275B71008ACB91 /* WKBundlePageBanner.h in Headers */,
                                753E3E0D1887398500188496 /* SessionTracker.cpp in Sources */,
                                1A6420E412DCE2FF00CAAE2C /* ShareableBitmap.cpp in Sources */,
                                C01A260112662F2100C9ED55 /* ShareableBitmapCG.cpp in Sources */,
-                               1ACC50F11CBC381D003C7D03 /* WKOpenPanelParameters.mm in Sources */,
                                51217460164C20E30037A5C1 /* ShareableResource.cpp in Sources */,
                                1A24BF3A120896A600FBB059 /* SharedMemoryMac.cpp in Sources */,
                                2DAF06D718BD1A470081CEB1 /* SmartMagnificationController.mm in Sources */,
                                31BA924D148831260062EDB5 /* WebNotificationManagerMessageReceiver.cpp in Sources */,
                                31A2EC4A148997C200810D71 /* WebNotificationManagerProxy.cpp in Sources */,
                                31A2EC4D148997C200810D71 /* WebNotificationProvider.cpp in Sources */,
-                               BC857FB612B830E600EDEB2E /* APIOpenPanelParameters.cpp in Sources */,
+                               BC857FB612B830E600EDEB2E /* WebOpenPanelParameters.cpp in Sources */,
                                BC857F8612B82D0B00EDEB2E /* WebOpenPanelResultListener.cpp in Sources */,
                                BC857F7E12B82CEE00EDEB2E /* WebOpenPanelResultListenerProxy.cpp in Sources */,
                                9955A6F61C7986E300EB6A93 /* AutomationProtocolObjects.cpp in Sources */,
index f4183af..27d0928 100644 (file)
@@ -43,6 +43,7 @@
 #include "WebFullScreenManager.h"
 #include "WebHitTestResultData.h"
 #include "WebImage.h"
+#include "WebOpenPanelParameters.h"
 #include "WebOpenPanelResultListener.h"
 #include "WebPage.h"
 #include "WebPageCreationParameters.h"
@@ -717,7 +718,7 @@ void WebChromeClient::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> prpFile
     WebFrame* webFrame = WebFrame::fromCoreFrame(*frame);
     ASSERT(webFrame);
 
-    m_page->send(Messages::WebPageProxy::RunOpenPanel(webFrame->frameID(), SecurityOriginData::fromFrame(frame), fileChooser->settings()));
+    m_page->send(Messages::WebPageProxy::RunOpenPanel(webFrame->frameID(), fileChooser->settings()));
 }
 
 void WebChromeClient::loadIconForFiles(const Vector<String>& filenames, FileIconLoader* loader)
index 96a3fa9..8a0463c 100644 (file)
@@ -1,3 +1,15 @@
+2016-04-14  Jiewen Tan  <jiewen_tan@apple.com>
+
+        Unreviewed, rolling out r199554.
+
+        The change breaks Yosemite Release/Debug build
+
+        Reverted changeset:
+
+        "[Mac] Add API for open panel handling to WKWebView"
+        https://bugs.webkit.org/show_bug.cgi?id=137759
+        http://trac.webkit.org/changeset/199554
+
 2016-04-14  Anders Carlsson  <andersca@apple.com>
 
         [Mac] Add API for open panel handling to WKWebView
index 8e9a2ed..4f5dfa6 100644 (file)
@@ -448,20 +448,6 @@ static CGFloat viewScaleForMenuItemTag(NSInteger tag)
     }];
 }
 
-- (void)webView:(WKWebView *)webView runOpenPanelWithParameters:(WKOpenPanelParameters *)parameters initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(NSArray<NSURL *> * _Nullable result))completionHandler
-{
-    NSOpenPanel *openPanel = [NSOpenPanel openPanel];
-
-    openPanel.allowsMultipleSelection = parameters.allowsMultipleSelection;
-
-    [openPanel beginSheetModalForWindow:webView.window completionHandler:^(NSInteger result) {
-        if (result == NSFileHandlingPanelOKButton)
-            completionHandler(openPanel.URLs);
-        else
-            completionHandler(@[]);
-    }];
-}
-
 - (void)updateTextFieldFromURL:(NSURL *)URL
 {
     if (!URL)