[webkit-changes] [215639] trunk/Source

2017-04-21 Thread andersca
Title: [215639] trunk/Source








Revision 215639
Author ander...@apple.com
Date 2017-04-21 14:28:22 -0700 (Fri, 21 Apr 2017)


Log Message
Stop using deprecated APIs, part 5
https://bugs.webkit.org/show_bug.cgi?id=171134
rdar://problem/31589635

Reviewed by Tim Horton.

Source/WebCore:

* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
Stop using the toPaymentAuthorizationStatus. Convert the passed in status results to the remaining
PaymentAuthorizationStatus values, and add errors if needed.

(WebCore::toPaymentAuthorizationStatus):
This function is no longer used.

* Modules/applepay/PaymentAuthorizationStatus.h:
Remove deprecated status values. We can achieve the same results with errors now.

* Modules/applepay/PaymentRequest.cpp:
(WebCore::isFinalStateResult):
Remove deprecated status values.

* Modules/applepay/PaymentRequest.h:
Remove deprecated status values.

Source/WebKit2:

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toPKPaymentAuthorizationStatus):
Remove this and add a new version that doesn't use any deprecated values.

(WebKit::toPKPaymentAuthorizationStatus):
New function that takes a WebCore::PaymentAuthorizationResult and converts it to a status, for older OSes.

(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
Use the new toPKPaymentAuthorizationStatus versions.

(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
Ditto.

(WebKit::status): Deleted.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp
trunk/Source/WebCore/Modules/applepay/PaymentAuthorizationStatus.h
trunk/Source/WebCore/Modules/applepay/PaymentRequest.cpp
trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (215638 => 215639)

--- trunk/Source/WebCore/ChangeLog	2017-04-21 21:28:17 UTC (rev 215638)
+++ trunk/Source/WebCore/ChangeLog	2017-04-21 21:28:22 UTC (rev 215639)
@@ -1,3 +1,29 @@
+2017-04-21  Anders Carlsson  
+
+Stop using deprecated APIs, part 5
+https://bugs.webkit.org/show_bug.cgi?id=171134
+rdar://problem/31589635
+
+Reviewed by Tim Horton.
+
+* Modules/applepay/ApplePaySession.cpp:
+(WebCore::convertAndValidate):
+Stop using the toPaymentAuthorizationStatus. Convert the passed in status results to the remaining
+PaymentAuthorizationStatus values, and add errors if needed.
+
+(WebCore::toPaymentAuthorizationStatus):
+This function is no longer used.
+
+* Modules/applepay/PaymentAuthorizationStatus.h:
+Remove deprecated status values. We can achieve the same results with errors now.
+
+* Modules/applepay/PaymentRequest.cpp:
+(WebCore::isFinalStateResult):
+Remove deprecated status values.
+
+* Modules/applepay/PaymentRequest.h:
+Remove deprecated status values.
+
 2017-04-21  Per Arne Vollan  
 
 Validate vImage arguments


Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp (215638 => 215639)

--- trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-04-21 21:28:17 UTC (rev 215638)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-04-21 21:28:22 UTC (rev 215639)
@@ -378,38 +378,6 @@
 }
 
 
-static std::optional toPaymentAuthorizationStatus(unsigned short status)
-{
-switch (status) {
-case ApplePaySession::STATUS_SUCCESS:
-return PaymentAuthorizationStatus::Success;
-
-case ApplePaySession::STATUS_FAILURE:
-return PaymentAuthorizationStatus::Failure;
-
-case ApplePaySession::STATUS_INVALID_BILLING_POSTAL_ADDRESS:
-return PaymentAuthorizationStatus::InvalidBillingPostalAddress;
-
-case ApplePaySession::STATUS_INVALID_SHIPPING_POSTAL_ADDRESS:
-return PaymentAuthorizationStatus::InvalidShippingPostalAddress;
-
-case ApplePaySession::STATUS_INVALID_SHIPPING_CONTACT:
-return PaymentAuthorizationStatus::InvalidShippingContact;
-
-case ApplePaySession::STATUS_PIN_REQUIRED:
-return PaymentAuthorizationStatus::PINRequired;
-
-case ApplePaySession::STATUS_PIN_INCORRECT:
-return PaymentAuthorizationStatus::PINIncorrect;
-
-case ApplePaySession::STATUS_PIN_LOCKOUT:
-return PaymentAuthorizationStatus::PINLockout;
-
-default:
-return std::nullopt;
-}
-}
-
 static Vector convert(const Vector>& errors)
 {
 Vector convertedErrors;
@@ -431,12 +399,51 @@
 {
 PaymentAuthorizationResult convertedResult;
 
-auto authorizationStatus = toPaymentAuthorizationStatus(result.status);
-if (!authorizationStatus)
+std::optional errorCode;
+std::optional contactField;
+
+switch (result.status) {
+case ApplePaySession::STATUS_SUCCESS:
+convertedResult.status = PaymentAuthorizationStatus::Success;
+break;
+
+case ApplePaySession::STATUS_

[webkit-changes] [215621] trunk/Source/WebKit2

2017-04-21 Thread andersca
Title: [215621] trunk/Source/WebKit2








Revision 215621
Author ander...@apple.com
Date 2017-04-21 11:40:34 -0700 (Fri, 21 Apr 2017)


Log Message
Stop using deprecated APIs, part 4
https://bugs.webkit.org/show_bug.cgi?id=171125
rdar://problem/31589635

Reviewed by Tim Horton.

It doesn't really matter what we pass to these completion functions, since the sheet has already been dismissed at this point
so just remove the status parameter.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (215620 => 215621)

--- trunk/Source/WebKit2/ChangeLog	2017-04-21 18:35:42 UTC (rev 215620)
+++ trunk/Source/WebKit2/ChangeLog	2017-04-21 18:40:34 UTC (rev 215621)
@@ -1,3 +1,19 @@
+2017-04-21  Anders Carlsson  
+
+Stop using deprecated APIs, part 4
+https://bugs.webkit.org/show_bug.cgi?id=171125
+rdar://problem/31589635
+
+Reviewed by Tim Horton.
+
+It doesn't really matter what we pass to these completion functions, since the sheet has already been dismissed at this point
+so just remove the status parameter.
+
+* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
+(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
+(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
+(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):
+
 2017-04-21  Andrew Gold  
 
 -[WKUIDelegatePrivate _webView:requestUserMediaAuthorizationForMicrophone:camera:url:mainFrameURL:decisionHandler:] 


Modified: trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm (215620 => 215621)

--- trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm	2017-04-21 18:35:42 UTC (rev 215620)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm	2017-04-21 18:40:34 UTC (rev 215621)
@@ -168,10 +168,7 @@
 - (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller didSelectPaymentMethod:(PKPaymentMethod *)paymentMethod handler:(void (^)(PKPaymentRequestPaymentMethodUpdate *update))completion
 {
 if (!_webPaymentCoordinatorProxy) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-completion(adoptNS([allocPKPaymentRequestPaymentMethodUpdateInstance() initWithStatus:PKPaymentAuthorizationStatusFailure paymentSummaryItems:@[ ]]).get());
-#pragma clang diagnostic pop
+completion(adoptNS([allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:@[ ]]).get());
 return;
 }
 
@@ -182,10 +179,7 @@
 
 - (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller didSelectShippingMethod:(PKShippingMethod *)shippingMethod handler:(void (^)(PKPaymentRequestShippingMethodUpdate *update))completion {
 if (!_webPaymentCoordinatorProxy) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-completion(adoptNS([allocPKPaymentRequestShippingMethodUpdateInstance() initWithStatus:PKPaymentAuthorizationStatusFailure paymentSummaryItems:@[ ]]).get());
-#pragma clang diagnostic pop
+completion(adoptNS([allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:@[ ]]).get());
 return;
 }
 
@@ -197,10 +191,7 @@
 - (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller didSelectShippingContact:(PKContact *)contact handler:(void (^)(PKPaymentRequestShippingContactUpdate *update))completion
 {
 if (!_webPaymentCoordinatorProxy) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-completion(adoptNS([allocPKPaymentRequestShippingContactUpdateInstance() initWithStatus:PKPaymentAuthorizationStatusFailure errors:@[ ] paymentSummaryItems:@[ ] shippingMethods:@[ ]]).get());
-#pragma clang diagnostic pop
+completion(adoptNS([allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:@[ ] paymentSummaryItems:@[ ] shippingMethods:@[ ]]).get());
 return;
 }
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit

[webkit-changes] [215612] trunk/Source/WebCore

2017-04-21 Thread andersca
Title: [215612] trunk/Source/WebCore








Revision 215612
Author ander...@apple.com
Date 2017-04-21 09:40:57 -0700 (Fri, 21 Apr 2017)


Log Message
Remove another use of toPaymentAuthorizationStatus
https://bugs.webkit.org/show_bug.cgi?id=171114

Reviewed by Dan Bernstein.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::completeShippingContactSelection):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (215611 => 215612)

--- trunk/Source/WebCore/ChangeLog	2017-04-21 15:13:13 UTC (rev 215611)
+++ trunk/Source/WebCore/ChangeLog	2017-04-21 16:40:57 UTC (rev 215612)
@@ -1,3 +1,13 @@
+2017-04-21  Anders Carlsson  
+
+Remove another use of toPaymentAuthorizationStatus
+https://bugs.webkit.org/show_bug.cgi?id=171114
+
+Reviewed by Dan Bernstein.
+
+* Modules/applepay/ApplePaySession.cpp:
+(WebCore::ApplePaySession::completeShippingContactSelection):
+
 2017-04-21  Alex Christensen  
 
 Reduce copies and allocations in SharedBuffer::append


Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp (215611 => 215612)

--- trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-04-21 15:13:13 UTC (rev 215611)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-04-21 16:40:57 UTC (rev 215612)
@@ -828,36 +828,35 @@
 {
 ApplePayShippingContactUpdate update;
 
-auto authorizationStatus = toPaymentAuthorizationStatus(status);
-if (!authorizationStatus)
-return Exception { INVALID_ACCESS_ERR };
-
 std::optional errorCode;
 std::optional contactField;
 
-switch (*authorizationStatus) {
-case PaymentAuthorizationStatus::Success:
+switch (status) {
+case ApplePaySession::STATUS_SUCCESS:
 break;
 
-case PaymentAuthorizationStatus::Failure:
-case PaymentAuthorizationStatus::PINRequired:
-case PaymentAuthorizationStatus::PINIncorrect:
-case PaymentAuthorizationStatus::PINLockout:
+case ApplePaySession::STATUS_FAILURE:
+case ApplePaySession::STATUS_PIN_REQUIRED:
+case ApplePaySession::STATUS_PIN_INCORRECT:
+case ApplePaySession::STATUS_PIN_LOCKOUT:
 errorCode = ApplePayError::Code::Unknown;
 break;
 
-case PaymentAuthorizationStatus::InvalidBillingPostalAddress:
+case ApplePaySession::STATUS_INVALID_BILLING_POSTAL_ADDRESS:
 errorCode = ApplePayError::Code::BillingContactInvalid;
 break;
 
-case PaymentAuthorizationStatus::InvalidShippingPostalAddress:
+case ApplePaySession::STATUS_INVALID_SHIPPING_POSTAL_ADDRESS:
 errorCode = ApplePayError::Code::ShippingContactInvalid;
 contactField = ApplePayError::ContactField::PostalAddress;
 break;
 
-case PaymentAuthorizationStatus::InvalidShippingContact:
+case ApplePaySession::STATUS_INVALID_SHIPPING_CONTACT:
 errorCode = ApplePayError::Code::ShippingContactInvalid;
 break;
+
+default:
+return Exception { INVALID_ACCESS_ERR };
 }
 
 if (errorCode)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [215588] trunk/Source/WebCore

2017-04-20 Thread andersca
Title: [215588] trunk/Source/WebCore








Revision 215588
Author ander...@apple.com
Date 2017-04-20 16:49:34 -0700 (Thu, 20 Apr 2017)


Log Message
Remove one use of toPaymentAuthorizationStatus
https://bugs.webkit.org/show_bug.cgi?id=171086

Reviewed by Tim Horton.

Just switch on the individual ApplePaySession::STATUS_ values.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::completeShippingMethodSelection):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (215587 => 215588)

--- trunk/Source/WebCore/ChangeLog	2017-04-20 23:42:00 UTC (rev 215587)
+++ trunk/Source/WebCore/ChangeLog	2017-04-20 23:49:34 UTC (rev 215588)
@@ -1,3 +1,15 @@
+2017-04-20  Anders Carlsson  
+
+Remove one use of toPaymentAuthorizationStatus
+https://bugs.webkit.org/show_bug.cgi?id=171086
+
+Reviewed by Tim Horton.
+
+Just switch on the individual ApplePaySession::STATUS_ values.
+
+* Modules/applepay/ApplePaySession.cpp:
+(WebCore::ApplePaySession::completeShippingMethodSelection):
+
 2017-04-20  Fujii Hironori  
 
 [WinCairo] Fix build break after updating ANGLE


Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp (215587 => 215588)

--- trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-04-20 23:42:00 UTC (rev 215587)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-04-20 23:49:34 UTC (rev 215588)
@@ -799,15 +799,23 @@
 {
 ApplePayShippingMethodUpdate update;
 
-auto authorizationStatus = toPaymentAuthorizationStatus(status);
-if (!authorizationStatus)
-return Exception { INVALID_ACCESS_ERR };
-
-if (*authorizationStatus != PaymentAuthorizationStatus::Success) {
+switch (status) {
+case ApplePaySession::STATUS_SUCCESS:
+break;
+case ApplePaySession::STATUS_FAILURE:
+case ApplePaySession::STATUS_INVALID_BILLING_POSTAL_ADDRESS:
+case ApplePaySession::STATUS_INVALID_SHIPPING_POSTAL_ADDRESS:
+case ApplePaySession::STATUS_INVALID_SHIPPING_CONTACT:
+case ApplePaySession::STATUS_PIN_REQUIRED:
+case ApplePaySession::STATUS_PIN_INCORRECT:
+case ApplePaySession::STATUS_PIN_LOCKOUT:
 // This is a fatal error. Cancel the request.
 m_state = State::CancelRequested;
 paymentCoordinator().cancelPaymentSession();
 return { };
+
+default:
+return Exception { INVALID_ACCESS_ERR };
 }
 
 update.newTotal = WTFMove(newTotal);






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [215578] trunk/Source/WebKit2

2017-04-20 Thread andersca
Title: [215578] trunk/Source/WebKit2








Revision 215578
Author ander...@apple.com
Date 2017-04-20 14:30:35 -0700 (Thu, 20 Apr 2017)


Log Message
Fix build.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (215577 => 215578)

--- trunk/Source/WebKit2/ChangeLog	2017-04-20 20:53:03 UTC (rev 215577)
+++ trunk/Source/WebKit2/ChangeLog	2017-04-20 21:30:35 UTC (rev 215578)
@@ -1,3 +1,10 @@
+2017-04-20  Anders Carlsson  
+
+Fix build.
+
+* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
+(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
+
 2017-04-20  Brady Eidson  
 
 Add CompletionHandlerCallChecker to SPI added in r215545.


Modified: trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm (215577 => 215578)

--- trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm	2017-04-20 20:53:03 UTC (rev 215577)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm	2017-04-20 21:30:35 UTC (rev 215578)
@@ -682,7 +682,7 @@
 ASSERT(m_paymentAuthorizationViewControllerDelegate);
 
 auto status = result ? result->status : WebCore::PaymentAuthorizationStatus::Success;
-m_paymentAuthorizationViewControllerDelegate->_didReachFinalState = WebCore::isFinalStateStatus(status);
+m_paymentAuthorizationViewControllerDelegate->_didReachFinalState = WebCore::isFinalStateResult(result);
 
 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 11)
 auto pkPaymentAuthorizationResult = adoptNS([allocPKPaymentAuthorizationResultInstance() initWithStatus:toPKPaymentAuthorizationStatus(status) errors:result ? toNSErrors(result->errors).get() : @[ ]]);






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [215576] trunk/Source

2017-04-20 Thread andersca
Title: [215576] trunk/Source








Revision 215576
Author ander...@apple.com
Date 2017-04-20 13:52:02 -0700 (Thu, 20 Apr 2017)


Log Message
Replace isFinalStateStatus with isFinalStateResult
https://bugs.webkit.org/show_bug.cgi?id=171072
rdar://problem/31589635

Reviewed by Tim Horton.

Source/WebCore:

This will let us get rid of some of the status enum declarations.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::completePayment):
* Modules/applepay/PaymentAuthorizationStatus.h:
(WebCore::isFinalStateStatus): Deleted.
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::completePaymentSession):
* Modules/applepay/PaymentRequest.cpp:
(WebCore::isFinalStateResult):
* Modules/applepay/PaymentRequest.h:

Source/WebKit2:

* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::completePaymentSession):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp
trunk/Source/WebCore/Modules/applepay/PaymentAuthorizationStatus.h
trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp
trunk/Source/WebCore/Modules/applepay/PaymentRequest.cpp
trunk/Source/WebCore/Modules/applepay/PaymentRequest.h
trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (215575 => 215576)

--- trunk/Source/WebCore/ChangeLog	2017-04-20 20:14:55 UTC (rev 215575)
+++ trunk/Source/WebCore/ChangeLog	2017-04-20 20:52:02 UTC (rev 215576)
@@ -1,3 +1,23 @@
+2017-04-20  Anders Carlsson  
+
+Replace isFinalStateStatus with isFinalStateResult
+https://bugs.webkit.org/show_bug.cgi?id=171072
+rdar://problem/31589635
+
+Reviewed by Tim Horton.
+
+This will let us get rid of some of the status enum declarations.
+
+* Modules/applepay/ApplePaySession.cpp:
+(WebCore::ApplePaySession::completePayment):
+* Modules/applepay/PaymentAuthorizationStatus.h:
+(WebCore::isFinalStateStatus): Deleted.
+* Modules/applepay/PaymentCoordinator.cpp:
+(WebCore::PaymentCoordinator::completePaymentSession):
+* Modules/applepay/PaymentRequest.cpp:
+(WebCore::isFinalStateResult):
+* Modules/applepay/PaymentRequest.h:
+
 2017-04-20  Brent Fulgham  
 
 [Win] REGRESSION(r215486): Windows Release build is broken


Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp (215575 => 215576)

--- trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-04-20 20:14:55 UTC (rev 215575)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-04-20 20:52:02 UTC (rev 215576)
@@ -780,11 +780,11 @@
 if (convertedResult.hasException())
 return convertedResult.releaseException();
 
-auto authorizationStatus = convertedResult.releaseReturnValue().status;
+bool isFinalState = isFinalStateResult(convertedResult.releaseReturnValue());
 
 paymentCoordinator().completePaymentSession(convertedResult.releaseReturnValue());
 
-if (!isFinalStateStatus(authorizationStatus)) {
+if (!isFinalState) {
 m_state = State::Active;
 return { };
 }


Modified: trunk/Source/WebCore/Modules/applepay/PaymentAuthorizationStatus.h (215575 => 215576)

--- trunk/Source/WebCore/Modules/applepay/PaymentAuthorizationStatus.h	2017-04-20 20:14:55 UTC (rev 215575)
+++ trunk/Source/WebCore/Modules/applepay/PaymentAuthorizationStatus.h	2017-04-20 20:52:02 UTC (rev 215576)
@@ -42,25 +42,8 @@
 PINLockout,
 };
 
-static inline bool isFinalStateStatus(PaymentAuthorizationStatus status)
-{
-switch (status) {
-case PaymentAuthorizationStatus::Success:
-case PaymentAuthorizationStatus::Failure:
-return true;
-
-case PaymentAuthorizationStatus::InvalidBillingPostalAddress:
-case PaymentAuthorizationStatus::InvalidShippingPostalAddress:
-case PaymentAuthorizationStatus::InvalidShippingContact:
-case PaymentAuthorizationStatus::PINRequired:
-case PaymentAuthorizationStatus::PINIncorrect:
-case PaymentAuthorizationStatus::PINLockout:
-return false;
-}
 }
 
-}
-
 namespace WTF {
 template<> struct EnumTraits {
 using values = EnumValues<


Modified: trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp (215575 => 215576)

--- trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp	2017-04-20 20:14:55 UTC (rev 215575)
+++ trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp	2017-04-20 20:52:02 UTC (rev 215576)
@@ -108,11 +108,11 @@
 {
 ASSERT(m_activeSession);
 
-auto status = result ? result->status : PaymentAuthorizationStatus::Success;
+bool isFinalState = isFinalStateResult(result);
 
 m_client.completePaymentSession(WTFMove(result));
 
-if (!isFinalStateStatus(status))
+if (!isFinalState)
 return;
 
 m_activeSession = nullptr;


Modified: trunk/Source/WebCore/Modules/applepay/PaymentRequest.cpp (

[webkit-changes] [215569] trunk/Source/WebKit2

2017-04-20 Thread andersca
Title: [215569] trunk/Source/WebKit2








Revision 215569
Author ander...@apple.com
Date 2017-04-20 12:34:21 -0700 (Thu, 20 Apr 2017)


Log Message
Fix a PassKit function declaration typo
https://bugs.webkit.org/show_bug.cgi?id=171068
rdar://problem/31635008

Reviewed by Tim Horton.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (215568 => 215569)

--- trunk/Source/WebKit2/ChangeLog	2017-04-20 19:22:23 UTC (rev 215568)
+++ trunk/Source/WebKit2/ChangeLog	2017-04-20 19:34:21 UTC (rev 215569)
@@ -1,3 +1,14 @@
+2017-04-20  Anders Carlsson  
+
+Fix a PassKit function declaration typo
+https://bugs.webkit.org/show_bug.cgi?id=171068
+rdar://problem/31635008
+
+Reviewed by Tim Horton.
+
+* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
+(WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
+
 2017-04-20  Jer Noble  
 
 [MediaCapture] gUM() with CoreAudio fails if capturing audio in the UIProcess.


Modified: trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm (215568 => 215569)

--- trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm	2017-04-20 19:22:23 UTC (rev 215568)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm	2017-04-20 19:34:21 UTC (rev 215569)
@@ -80,7 +80,7 @@
 typedef void (^PKCanMakePaymentsCompletion)(BOOL isValid, NSError *error);
 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 11)
 extern "C" void PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication(NSString *identifier, NSString *domain, NSString *sourceApplicationSecondaryIdentifier, PKCanMakePaymentsCompletion completion);
-SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebKit, PassKit, PKCanMakePaymentsWithMerchantIdentifierAndDomainAndSourceApplication, void, (NSString *identifier, NSString *domain, NSString *sourceApplicationSecondaryIdentifier, PKCanMakePaymentsCompletion completion), (identifier, domain, sourceApplicationSecondaryIdentifier, completion));
+SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebKit, PassKit, PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication, void, (NSString *identifier, NSString *domain, NSString *sourceApplicationSecondaryIdentifier, PKCanMakePaymentsCompletion completion), (identifier, domain, sourceApplicationSecondaryIdentifier, completion));
 #else
 extern "C" void PKCanMakePaymentsWithMerchantIdentifierAndDomain(NSString *identifier, NSString *domain, PKCanMakePaymentsCompletion completion);
 SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebKit, PassKit, PKCanMakePaymentsWithMerchantIdentifierAndDomain, void, (NSString *identifier, NSString *domain, PKCanMakePaymentsCompletion completion), (identifier, domain, completion));
@@ -296,7 +296,7 @@
 void WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, std::function completionHandler)
 {
 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 11)
-if (!canLoad_PassKit_PKCanMakePaymentsWithMerchantIdentifierAndDomainAndSourceApplication()) {
+if (!canLoad_PassKit_PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication()) {
 RunLoop::main().dispatch([completionHandler] {
 completionHandler(false);
 });
@@ -303,7 +303,7 @@
 return;
 }
 
-softLink_PassKit_PKCanMakePaymentsWithMerchantIdentifierAndDomainAndSourceApplication(merchantIdentifier, domainName, m_webPageProxy.process().processPool().configuration().sourceApplicationSecondaryIdentifier(), [completionHandler](BOOL canMakePayments, NSError *error) {
+softLink_PassKit_PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication(merchantIdentifier, domainName, m_webPageProxy.process().processPool().configuration().sourceApplicationSecondaryIdentifier(), [completionHandler](BOOL canMakePayments, NSError *error) {
 if (error)
 LOG_ERROR("PKCanMakePaymentsWithMerchantIdentifierAndDomain error %@", error);
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [215541] trunk/Source

2017-04-19 Thread andersca
Title: [215541] trunk/Source








Revision 215541
Author ander...@apple.com
Date 2017-04-19 16:30:47 -0700 (Wed, 19 Apr 2017)


Log Message
Stop using deprecated APIs, part 3
https://bugs.webkit.org/show_bug.cgi?id=171003
rdar://problem/31589635
Source/WebCore:

rdar://problem/31589635

Reviewed by Tim Horton.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
The status member variable has been removed from ApplePayShippingMethodUpdate.

(WebCore::ApplePaySession::completeShippingMethodSelection):
If status is not STATUS_SUCCESS, cancel the payment session.

(WebCore::ApplePaySession::canSuspendForDocumentSuspension):
(WebCore::ApplePaySession::canBegin):
(WebCore::ApplePaySession::canAbort):
(WebCore::ApplePaySession::canCancel):
(WebCore::ApplePaySession::canCompleteShippingMethodSelection):
(WebCore::ApplePaySession::canCompleteShippingContactSelection):
(WebCore::ApplePaySession::canCompletePaymentMethodSelection):
(WebCore::ApplePaySession::canCompletePayment):
(WebCore::ApplePaySession::isFinalState):
Add State::CancelRequested.

* Modules/applepay/ApplePayShippingMethodUpdate.h:
* Modules/applepay/ApplePayShippingMethodUpdate.idl:
Remove status.

* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::cancelPaymentSession):
Call through to the client.

* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
Add cancelPaymentSession().

* Modules/applepay/PaymentRequest.h:
Remove status.

* loader/EmptyClients.cpp:
Add new client member function.

Source/WebKit/mac:

Reviewed by Tim Horton.

* WebCoreSupport/WebPaymentCoordinatorClient.h:
* WebCoreSupport/WebPaymentCoordinatorClient.mm:
(WebPaymentCoordinatorClient::cancelPaymentSession):
Update for WebCore changes.

Source/WebKit2:

Reviewed by Tim Horton.

* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder::encode):
(IPC::ArgumentCoder::decode):
Don't encode/decode status.

* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::cancelPaymentSession):
Hide the UI and report back.

* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
Add new member.

* UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
Add new message.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
Always pass success in the old code path. Stop using the deprecated method.

* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::cancelPaymentSession):
Send a message to the UI process.

* WebProcess/ApplePay/WebPaymentCoordinator.h:
Add new member.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp
trunk/Source/WebCore/Modules/applepay/ApplePaySession.h
trunk/Source/WebCore/Modules/applepay/ApplePayShippingMethodUpdate.h
trunk/Source/WebCore/Modules/applepay/ApplePayShippingMethodUpdate.idl
trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp
trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.h
trunk/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h
trunk/Source/WebCore/Modules/applepay/PaymentRequest.h
trunk/Source/WebCore/loader/EmptyClients.cpp
trunk/Source/WebKit/mac/ChangeLog
trunk/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.h
trunk/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm
trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm
trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp
trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h
trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in
trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm
trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.cpp
trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (215540 => 215541)

--- trunk/Source/WebCore/ChangeLog	2017-04-19 23:27:05 UTC (rev 215540)
+++ trunk/Source/WebCore/ChangeLog	2017-04-19 23:30:47 UTC (rev 215541)
@@ -1,3 +1,48 @@
+2017-04-19  Anders Carlsson  
+
+Stop using deprecated APIs, part 3
+https://bugs.webkit.org/show_bug.cgi?id=171003
+rdar://problem/31589635
+rdar://problem/31589635
+
+Reviewed by Tim Horton.
+
+* Modules/applepay/ApplePaySession.cpp:
+(WebCore::convertAndValidate):
+The status member variable has been removed from ApplePayShippingMethodUpdate.
+
+(WebCore::ApplePaySession::completeShippingMethodSelection):
+If status is not STATUS_SUCCESS, cancel the payment session.
+
+(WebCore::ApplePaySession::canSuspendForDocumentSuspension):
+(WebCore::ApplePaySession::canBegin):
+(WebCore::ApplePaySession::canAbort):
+(WebCore::ApplePaySession::canCancel):
+(WebCore::ApplePaySession::canComplete

[webkit-changes] [215530] trunk/Source

2017-04-19 Thread andersca
Title: [215530] trunk/Source








Revision 215530
Author ander...@apple.com
Date 2017-04-19 14:30:05 -0700 (Wed, 19 Apr 2017)


Log Message
Rename cancelPayment to cancelPaymentSession
https://bugs.webkit.org/show_bug.cgi?id=171007

Reviewed by Tim Horton.

Source/WebCore:

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::didCancelPaymentSession):
(WebCore::ApplePaySession::didCancelPayment): Deleted.
* Modules/applepay/ApplePaySession.h:
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::didCancelPaymentSession):
(WebCore::PaymentCoordinator::didCancelPayment): Deleted.
* Modules/applepay/PaymentCoordinator.h:

Source/WebKit2:

* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
(WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession):
(WebKit::WebPaymentCoordinatorProxy::didCancelPayment): Deleted.
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]):
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::didCancelPaymentSession):
(WebKit::WebPaymentCoordinator::didCancelPayment): Deleted.
* WebProcess/ApplePay/WebPaymentCoordinator.h:
* WebProcess/ApplePay/WebPaymentCoordinator.messages.in:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp
trunk/Source/WebCore/Modules/applepay/ApplePaySession.h
trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp
trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.h
trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp
trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h
trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm
trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.cpp
trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.h
trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.messages.in




Diff

Modified: trunk/Source/WebCore/ChangeLog (215529 => 215530)

--- trunk/Source/WebCore/ChangeLog	2017-04-19 21:00:47 UTC (rev 215529)
+++ trunk/Source/WebCore/ChangeLog	2017-04-19 21:30:05 UTC (rev 215530)
@@ -1,3 +1,19 @@
+2017-04-19  Anders Carlsson  
+
+Rename cancelPayment to cancelPaymentSession
+https://bugs.webkit.org/show_bug.cgi?id=171007
+
+Reviewed by Tim Horton.
+
+* Modules/applepay/ApplePaySession.cpp:
+(WebCore::ApplePaySession::didCancelPaymentSession):
+(WebCore::ApplePaySession::didCancelPayment): Deleted.
+* Modules/applepay/ApplePaySession.h:
+* Modules/applepay/PaymentCoordinator.cpp:
+(WebCore::PaymentCoordinator::didCancelPaymentSession):
+(WebCore::PaymentCoordinator::didCancelPayment): Deleted.
+* Modules/applepay/PaymentCoordinator.h:
+
 2017-04-19  Joseph Pecoraro  
 
 ASAN Crash running LayoutTests/inspector/worker tests


Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp (215529 => 215530)

--- trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-04-19 21:00:47 UTC (rev 215529)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-04-19 21:30:05 UTC (rev 215530)
@@ -949,7 +949,7 @@
 dispatchEvent(event.get());
 }
 
-void ApplePaySession::didCancelPayment()
+void ApplePaySession::didCancelPaymentSession()
 {
 ASSERT(canCancel());
 


Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySession.h (215529 => 215530)

--- trunk/Source/WebCore/Modules/applepay/ApplePaySession.h	2017-04-19 21:00:47 UTC (rev 215529)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySession.h	2017-04-19 21:30:05 UTC (rev 215530)
@@ -97,7 +97,7 @@
 void didSelectShippingMethod(const PaymentRequest::ShippingMethod&);
 void didSelectShippingContact(const PaymentContact&);
 void didSelectPaymentMethod(const PaymentMethod&);
-void didCancelPayment();
+void didCancelPaymentSession();
 
 using RefCounted::ref;
 using RefCounted::deref;


Modified: trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp (215529 => 215530)

--- trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp	2017-04-19 21:00:47 UTC (rev 215529)
+++ trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp	2017-04-19 21:30:05 UTC (rev 215530)
@@ -176,7 +176,7 @@
 m_activeSession->didSelectShippingContact(shippingContact);
 }
 
-void PaymentCoordinator::didCancelPayment()
+void PaymentCoordinator::didCancelPaymentSession()
 {
 if (!m_activeSession) {
 // It's possible that the payment has been aborted already.
@@ -183,7 +183,7 @@
 return;
 }
 
-m_activeSession->didCancelPayment();
+m_activeSession->didCancelPaymentSession();
 m_activeSession = nullptr;
 }
 


Modified: trunk/Source/WebCore/Modules/applepay/Paym

[webkit-changes] [215480] trunk/Source

2017-04-18 Thread andersca
Title: [215480] trunk/Source








Revision 215480
Author ander...@apple.com
Date 2017-04-18 15:22:06 -0700 (Tue, 18 Apr 2017)


Log Message
Stop using deprecated APIs, part 2
https://bugs.webkit.org/show_bug.cgi?id=170965
Source/WebCore:

rdar://problem/31589635

Reviewed by Tim Horton.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
No need to convert the status anymore.

(WebCore::ApplePaySession::completeShippingContactSelection):
Create an ApplePayError given the status.

* Modules/applepay/ApplePayShippingContactUpdate.h:
Remove the status member variable.

* Modules/applepay/PaymentRequest.h:
Remove the status member variable.

Source/WebKit2:

Reviewed by Tim Horton.

* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder::encode):
(IPC::ArgumentCoder::decode):
Remove the status member variable.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::status):
New function to be used by older OSes. This will recreate a PKPaymentAuthorizationStatus given a ShippingContactUpdate.

(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
Stop using the deprecated API.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp
trunk/Source/WebCore/Modules/applepay/ApplePayShippingContactUpdate.h
trunk/Source/WebCore/Modules/applepay/PaymentRequest.h
trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm
trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (215479 => 215480)

--- trunk/Source/WebCore/ChangeLog	2017-04-18 20:59:37 UTC (rev 215479)
+++ trunk/Source/WebCore/ChangeLog	2017-04-18 22:22:06 UTC (rev 215480)
@@ -1,3 +1,24 @@
+2017-04-18  Anders Carlsson  
+
+Stop using deprecated APIs, part 2
+https://bugs.webkit.org/show_bug.cgi?id=170965
+rdar://problem/31589635
+
+Reviewed by Tim Horton.
+
+* Modules/applepay/ApplePaySession.cpp:
+(WebCore::convertAndValidate):
+No need to convert the status anymore.
+
+(WebCore::ApplePaySession::completeShippingContactSelection):
+Create an ApplePayError given the status.
+
+* Modules/applepay/ApplePayShippingContactUpdate.h:
+Remove the status member variable.
+
+* Modules/applepay/PaymentRequest.h:
+Remove the status member variable.
+
 2017-04-18  Tim Horton  
 
 Safari crash when clicking phone number data detector popover button


Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp (215479 => 215480)

--- trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-04-18 20:59:37 UTC (rev 215479)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-04-18 22:22:06 UTC (rev 215480)
@@ -467,22 +467,8 @@
 {
 ShippingContactUpdate convertedUpdate;
 
-if (!update.status) {
-convertedUpdate.errors = convert(update.errors);
-if (convertedUpdate.errors.isEmpty())
-convertedUpdate.status = PaymentAuthorizationStatus::Success;
-else
-convertedUpdate.status = PaymentAuthorizationStatus::Failure;
-} else {
-ASSERT(update.errors.isEmpty());
+convertedUpdate.errors = convert(update.errors);
 
-auto authorizationStatus = toPaymentAuthorizationStatus(*update.status);
-if (!authorizationStatus)
-return Exception { INVALID_ACCESS_ERR };
-
-convertedUpdate.status = *authorizationStatus;
-}
-
 auto convertedNewShippingMethods = convertAndValidate(WTFMove(update.newShippingMethods));
 if (convertedNewShippingMethods.hasException())
 return convertedNewShippingMethods.releaseException();
@@ -829,7 +815,41 @@
 {
 ApplePayShippingContactUpdate update;
 
-update.status = status;
+auto authorizationStatus = toPaymentAuthorizationStatus(status);
+if (!authorizationStatus)
+return Exception { INVALID_ACCESS_ERR };
+
+std::optional errorCode;
+std::optional contactField;
+
+switch (*authorizationStatus) {
+case PaymentAuthorizationStatus::Success:
+break;
+
+case PaymentAuthorizationStatus::Failure:
+case PaymentAuthorizationStatus::PINRequired:
+case PaymentAuthorizationStatus::PINIncorrect:
+case PaymentAuthorizationStatus::PINLockout:
+errorCode = ApplePayError::Code::Unknown;
+break;
+
+case PaymentAuthorizationStatus::InvalidBillingPostalAddress:
+errorCode = ApplePayError::Code::BillingContactInvalid;
+break;
+
+case PaymentAuthorizationStatus::InvalidShippingPostalAddress:
+errorCode = ApplePayError::Code::ShippingContactInvalid;
+contactField = ApplePayError::ContactField::PostalAddress;
+break;
+
+case PaymentAuthorizationStatus::InvalidShippingContact:
+errorCode = ApplePayError::Code::ShippingContactInvalid;
+break;
+

[webkit-changes] [215431] trunk/Source

2017-04-17 Thread andersca
Title: [215431] trunk/Source








Revision 215431
Author ander...@apple.com
Date 2017-04-17 14:34:20 -0700 (Mon, 17 Apr 2017)


Log Message
Stop using deprecated APIs, part 1
https://bugs.webkit.org/show_bug.cgi?id=170915
rdar://problem/31589635

Reviewed by Tim Horton.

Source/WebCore:

Get rid of the status parameter from ApplePayPaymentMethodUpdate.

* Modules/applepay/ApplePayPaymentMethodUpdate.h:
* Modules/applepay/ApplePayPaymentMethodUpdate.idl:
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
(WebCore::ApplePaySession::completePaymentMethodSelection):
* Modules/applepay/PaymentRequest.h:

Source/WebKit2:

Stop using the PKPaymentRequestPaymentMethodUpdate initializer that takes a status, it's been deprecated
and we always passed PKPaymentAuthorizationStatusSuccess anyway.

* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder::encode):
(IPC::ArgumentCoder::decode):
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodUpdate.h
trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodUpdate.idl
trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp
trunk/Source/WebCore/Modules/applepay/PaymentRequest.h
trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm
trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (215430 => 215431)

--- trunk/Source/WebCore/ChangeLog	2017-04-17 21:29:35 UTC (rev 215430)
+++ trunk/Source/WebCore/ChangeLog	2017-04-17 21:34:20 UTC (rev 215431)
@@ -1,3 +1,20 @@
+2017-04-17  Anders Carlsson  
+
+Stop using deprecated APIs, part 1
+https://bugs.webkit.org/show_bug.cgi?id=170915
+rdar://problem/31589635
+
+Reviewed by Tim Horton.
+
+Get rid of the status parameter from ApplePayPaymentMethodUpdate.
+
+* Modules/applepay/ApplePayPaymentMethodUpdate.h:
+* Modules/applepay/ApplePayPaymentMethodUpdate.idl:
+* Modules/applepay/ApplePaySession.cpp:
+(WebCore::convertAndValidate):
+(WebCore::ApplePaySession::completePaymentMethodSelection):
+* Modules/applepay/PaymentRequest.h:
+
 2017-04-17  Youenn Fablet  
 
 Disable outdated WritableStream API


Modified: trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodUpdate.h (215430 => 215431)

--- trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodUpdate.h	2017-04-17 21:29:35 UTC (rev 215430)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodUpdate.h	2017-04-17 21:34:20 UTC (rev 215431)
@@ -32,8 +32,6 @@
 namespace WebCore {
 
 struct ApplePayPaymentMethodUpdate {
-unsigned short status;
-
 ApplePayLineItem newTotal;
 Vector newLineItems;
 };


Modified: trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodUpdate.idl (215430 => 215431)

--- trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodUpdate.idl	2017-04-17 21:29:35 UTC (rev 215430)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodUpdate.idl	2017-04-17 21:34:20 UTC (rev 215431)
@@ -26,8 +26,6 @@
 [
 Conditional=APPLE_PAY_DELEGATE,
 ] dictionary ApplePayPaymentMethodUpdate {
-required unsigned short status;
-
 required ApplePayLineItem newTotal;
 sequence newLineItems;
 };


Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp (215430 => 215431)

--- trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-04-17 21:29:35 UTC (rev 215430)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-04-17 21:34:20 UTC (rev 215431)
@@ -444,11 +444,6 @@
 {
 PaymentMethodUpdate convertedUpdate;
 
-auto authorizationStatus = toPaymentAuthorizationStatus(update.status);
-if (!authorizationStatus)
-return Exception { INVALID_ACCESS_ERR };
-convertedUpdate.status = *authorizationStatus;
-
 auto convertedNewTotal = convertAndValidateTotal(WTFMove(update.newTotal));
 if (convertedNewTotal.hasException())
 return convertedNewTotal.releaseException();
@@ -846,7 +841,6 @@
 {
 ApplePayPaymentMethodUpdate update;
 
-update.status = STATUS_SUCCESS;
 update.newTotal = WTFMove(newTotal);
 update.newLineItems = WTFMove(newLineItems);
 


Modified: trunk/Source/WebCore/Modules/applepay/PaymentRequest.h (215430 => 215431)

--- trunk/Source/WebCore/Modules/applepay/PaymentRequest.h	2017-04-17 21:29:35 UTC (rev 215430)
+++ trunk/Source/WebCore/Modules/applepay/PaymentRequest.h	2017-04-17 21:34:20 UTC (rev 215431)
@@ -181,7 +181,6 @@
 };
 
 struct PaymentMethodUpdate {
-PaymentAuthorizationStatus status;
 PaymentRequest::TotalAndLineItems newTotalAndLineItems;
 };
 


Modified: trunk/Source/WebKit2/ChangeLog (215430 => 215431)

--- trunk/Source/WebKit2/ChangeLog	2017-04-17 21:29:35 UTC (rev 215430

[webkit-changes] [215290] trunk/Source

2017-04-12 Thread andersca
Title: [215290] trunk/Source








Revision 215290
Author ander...@apple.com
Date 2017-04-12 14:08:15 -0700 (Wed, 12 Apr 2017)


Log Message
Tweak WebCore::setMetadataURL function
https://bugs.webkit.org/show_bug.cgi?id=170786

Reviewed by Beth Dakin.

Source/WebCore:

Get rid of the "referrer" parameter, it isn't used. Make the remaining parameters const. Swap the
urlString and path parameters since that makes more sense. Use String instead of NSString in the call to WKSetMetadataURL.

* platform/FileSystem.cpp:
(WebCore::setMetadataURL): Deleted.
* platform/FileSystem.h:
* platform/mac/FileSystemMac.mm:
(WebCore::setMetadataURL):

Source/WebKit2:

Update for WebCore changes.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::namesOfPromisedFilesDroppedAtDestination):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/FileSystem.cpp
trunk/Source/WebCore/platform/FileSystem.h
trunk/Source/WebCore/platform/mac/FileSystemMac.mm
trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (215289 => 215290)

--- trunk/Source/WebCore/ChangeLog	2017-04-12 21:04:18 UTC (rev 215289)
+++ trunk/Source/WebCore/ChangeLog	2017-04-12 21:08:15 UTC (rev 215290)
@@ -1,3 +1,19 @@
+2017-04-12  Anders Carlsson  
+
+Tweak WebCore::setMetadataURL function
+https://bugs.webkit.org/show_bug.cgi?id=170786
+
+Reviewed by Beth Dakin.
+
+Get rid of the "referrer" parameter, it isn't used. Make the remaining parameters const. Swap the
+urlString and path parameters since that makes more sense. Use String instead of NSString in the call to WKSetMetadataURL.
+
+* platform/FileSystem.cpp:
+(WebCore::setMetadataURL): Deleted.
+* platform/FileSystem.h:
+* platform/mac/FileSystemMac.mm:
+(WebCore::setMetadataURL):
+
 2017-04-12  Myles C. Maxfield  
 
 Well-known variations should clamp to the values listed in the @font-face block


Modified: trunk/Source/WebCore/platform/FileSystem.cpp (215289 => 215290)

--- trunk/Source/WebCore/platform/FileSystem.cpp	2017-04-12 21:04:18 UTC (rev 215289)
+++ trunk/Source/WebCore/platform/FileSystem.cpp	2017-04-12 21:08:15 UTC (rev 215290)
@@ -255,7 +255,7 @@
 
 #if !PLATFORM(MAC)
 
-void setMetadataURL(String&, const String&, const String&)
+void setMetadataURL(const String&, const String&)
 {
 }
 


Modified: trunk/Source/WebCore/platform/FileSystem.h (215289 => 215290)

--- trunk/Source/WebCore/platform/FileSystem.h	2017-04-12 21:04:18 UTC (rev 215289)
+++ trunk/Source/WebCore/platform/FileSystem.h	2017-04-12 21:08:15 UTC (rev 215290)
@@ -146,7 +146,7 @@
 WEBCORE_EXPORT bool getVolumeFreeSpace(const String&, uint64_t&);
 WEBCORE_EXPORT std::optional getFileDeviceId(const CString&);
 
-WEBCORE_EXPORT void setMetadataURL(String& URLString, const String& referrer, const String& path);
+WEBCORE_EXPORT void setMetadataURL(const String& path, const String& urlString);
 
 bool canExcludeFromBackup(); // Returns true if any file can ever be excluded from backup.
 bool excludeFromBackup(const String&); // Returns true if successful.


Modified: trunk/Source/WebCore/platform/mac/FileSystemMac.mm (215289 => 215290)

--- trunk/Source/WebCore/platform/mac/FileSystemMac.mm	2017-04-12 21:04:18 UTC (rev 215289)
+++ trunk/Source/WebCore/platform/mac/FileSystemMac.mm	2017-04-12 21:08:15 UTC (rev 215290)
@@ -48,18 +48,17 @@
 return !rmdir(fileSystemRepresentation(path).data());
 }
 
-void setMetadataURL(String& URLString, const String& referrer, const String& path)
+void setMetadataURL(const String& path, const String& metadataURLString)
 {
-NSURL *URL = "" nil);
-if (URL)
-URLString = userVisibleString(URLByRemovingUserInfo(URL));
+String urlString;
+if (NSURL *url = "" nil))
+urlString = userVisibleString(URLByRemovingUserInfo(url));
+else
+urlString = metadataURLString;
 
 // Call WKSetMetadataURL on a background queue because it can take some time.
-NSString *URLStringCopy = URLString;
-NSString *referrerCopy = referrer;
-NSString *pathCopy = path;
-dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-wkSetMetadataURL(URLStringCopy, referrerCopy, [NSString stringWithUTF8String:[pathCopy fileSystemRepresentation]]);
+dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), [path = path.isolatedCopy(), urlString = urlString.isolatedCopy()] {
+wkSetMetadataURL(urlString, nil, [NSString stringWithUTF8String:[path fileSystemRepresentation]]);
 });
 }
 


Modified: trunk/Source/WebKit2/ChangeLog (215289 => 215290)

--- trunk/Source/WebKit2/ChangeLog	2017-04-12 21:04:18 UTC (rev 215289)
+++ trunk/Source/WebKit2/ChangeLog	2017-04-12 21:08:15 UTC (rev 215290)
@@ -1,3 +1,15 @@
+2017-04-12  Anders Carlsson  
+
+Tweak WebCore::setMetadataURL function
+https://bugs.webkit.org/show_b

[webkit-changes] [215204] trunk/Source/WebKit/mac

2017-04-10 Thread andersca
Title: [215204] trunk/Source/WebKit/mac








Revision 215204
Author ander...@apple.com
Date 2017-04-10 14:44:20 -0700 (Mon, 10 Apr 2017)


Log Message
Remove call to WKShowKeyAndMain
https://bugs.webkit.org/show_bug.cgi?id=170691
rdar://problem/31050032

Reviewed by Beth Dakin.

* Carbon/CarbonWindowAdapter.mm:
(-[CarbonWindowAdapter makeKeyWindow]):

Modified Paths

trunk/Source/WebKit/mac/Carbon/CarbonWindowAdapter.mm
trunk/Source/WebKit/mac/ChangeLog




Diff

Modified: trunk/Source/WebKit/mac/Carbon/CarbonWindowAdapter.mm (215203 => 215204)

--- trunk/Source/WebKit/mac/Carbon/CarbonWindowAdapter.mm	2017-04-10 21:43:11 UTC (rev 215203)
+++ trunk/Source/WebKit/mac/Carbon/CarbonWindowAdapter.mm	2017-04-10 21:44:20 UTC (rev 215204)
@@ -661,14 +661,13 @@
 	}
 }
 
-- (void)makeKeyWindow {
-	[NSApp _setMouseActivationInProgress:NO];
-	[NSApp setIsActive:YES];
-	[super makeKeyWindow];
-	WKShowKeyAndMain();
+- (void)makeKeyWindow
+{
+[NSApp _setMouseActivationInProgress:NO];
+[NSApp setIsActive:YES];
+[super makeKeyWindow];
 }
 
-
 // Do the right thing for a Carbon window.
 - (BOOL)canBecomeKeyWindow {
 


Modified: trunk/Source/WebKit/mac/ChangeLog (215203 => 215204)

--- trunk/Source/WebKit/mac/ChangeLog	2017-04-10 21:43:11 UTC (rev 215203)
+++ trunk/Source/WebKit/mac/ChangeLog	2017-04-10 21:44:20 UTC (rev 215204)
@@ -1,3 +1,14 @@
+2017-04-10  Anders Carlsson  
+
+Remove call to WKShowKeyAndMain
+https://bugs.webkit.org/show_bug.cgi?id=170691
+rdar://problem/31050032
+
+Reviewed by Beth Dakin.
+
+* Carbon/CarbonWindowAdapter.mm:
+(-[CarbonWindowAdapter makeKeyWindow]):
+
 2017-04-10  Jeremy Jones  
 
 Add CoreAudioCaptureSource.






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [215060] trunk/Source/WebKit2

2017-04-06 Thread andersca
Title: [215060] trunk/Source/WebKit2








Revision 215060
Author ander...@apple.com
Date 2017-04-06 14:35:09 -0700 (Thu, 06 Apr 2017)


Log Message
OptionSet options need to be powers of two
https://bugs.webkit.org/show_bug.cgi?id=170565

Reviewed by Chris Dumez.

Change Cache::Option to be powers of two.

* NetworkProcess/cache/NetworkCache.h:

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h




Diff

Modified: trunk/Source/WebKit2/ChangeLog (215059 => 215060)

--- trunk/Source/WebKit2/ChangeLog	2017-04-06 21:12:25 UTC (rev 215059)
+++ trunk/Source/WebKit2/ChangeLog	2017-04-06 21:35:09 UTC (rev 215060)
@@ -1,3 +1,14 @@
+2017-04-06  Anders Carlsson  
+
+OptionSet options need to be powers of two
+https://bugs.webkit.org/show_bug.cgi?id=170565
+
+Reviewed by Chris Dumez.
+
+Change Cache::Option to be powers of two.
+
+* NetworkProcess/cache/NetworkCache.h:
+
 2017-04-06  Youenn Fablet  
 
 WebRTC tests gardening


Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h (215059 => 215060)

--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h	2017-04-06 21:12:25 UTC (rev 215059)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h	2017-04-06 21:35:09 UTC (rev 215060)
@@ -96,11 +96,11 @@
 friend class WTF::NeverDestroyed;
 public:
 enum class Option {
-EfficacyLogging,
+EfficacyLogging = 1 << 0,
 // In testing mode we try to eliminate sources of randomness. Cache does not shrink and there are no read timeouts.
-TestingMode,
+TestingMode = 1 << 1,
 #if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION)
-SpeculativeRevalidation,
+SpeculativeRevalidation = 1 << 2,
 #endif
 };
 bool initialize(const String& cachePath, OptionSet);






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [214829] trunk/Source

2017-04-03 Thread andersca
Title: [214829] trunk/Source








Revision 214829
Author ander...@apple.com
Date 2017-04-03 12:07:50 -0700 (Mon, 03 Apr 2017)


Log Message
Tweak ApplePaySession API
https://bugs.webkit.org/show_bug.cgi?id=170409
rdar://problem/31405459

Reviewed by Tim Horton.

Source/WebCore:

Rename "address" to "addressLines". Add "postalAddress". Reorder the ApplePayError constructor parameters.

* Modules/applepay/ApplePayError.cpp:
(WebCore::ApplePayError::create):
(WebCore::ApplePayError::ApplePayError):
* Modules/applepay/ApplePayError.h:
* Modules/applepay/ApplePayError.idl:
* Modules/applepay/PaymentRequest.h:

Source/WebKit2:

Update for WebCore changes.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toNSError):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/applepay/ApplePayError.cpp
trunk/Source/WebCore/Modules/applepay/ApplePayError.h
trunk/Source/WebCore/Modules/applepay/ApplePayError.idl
trunk/Source/WebCore/Modules/applepay/PaymentRequest.h
trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (214828 => 214829)

--- trunk/Source/WebCore/ChangeLog	2017-04-03 19:04:16 UTC (rev 214828)
+++ trunk/Source/WebCore/ChangeLog	2017-04-03 19:07:50 UTC (rev 214829)
@@ -1,3 +1,20 @@
+2017-04-03  Anders Carlsson  
+
+Tweak ApplePaySession API
+https://bugs.webkit.org/show_bug.cgi?id=170409
+rdar://problem/31405459
+
+Reviewed by Tim Horton.
+
+Rename "address" to "addressLines". Add "postalAddress". Reorder the ApplePayError constructor parameters.
+
+* Modules/applepay/ApplePayError.cpp:
+(WebCore::ApplePayError::create):
+(WebCore::ApplePayError::ApplePayError):
+* Modules/applepay/ApplePayError.h:
+* Modules/applepay/ApplePayError.idl:
+* Modules/applepay/PaymentRequest.h:
+
 2017-04-03  Zan Dobersek  
 
 [GCrypt] Implement CryptoKeyEC::keySizeInBits(), ::platformGeneratePair()


Modified: trunk/Source/WebCore/Modules/applepay/ApplePayError.cpp (214828 => 214829)

--- trunk/Source/WebCore/Modules/applepay/ApplePayError.cpp	2017-04-03 19:04:16 UTC (rev 214828)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayError.cpp	2017-04-03 19:07:50 UTC (rev 214829)
@@ -30,15 +30,15 @@
 
 namespace WebCore {
 
-Ref ApplePayError::create(Code code, const String& message, std::optional contactField)
+Ref ApplePayError::create(Code code, std::optional contactField, const String& message)
 {
-return adoptRef(*new ApplePayError { code, message, contactField });
+return adoptRef(*new ApplePayError { code, contactField, message });
 }
 
-ApplePayError::ApplePayError(Code code, const String& message, std::optional contactField)
+ApplePayError::ApplePayError(Code code, std::optional contactField, const String& message)
 : m_code { code }
+, m_contactField { contactField }
 , m_message { message }
-, m_contactField { contactField }
 {
 }
 


Modified: trunk/Source/WebCore/Modules/applepay/ApplePayError.h (214828 => 214829)

--- trunk/Source/WebCore/Modules/applepay/ApplePayError.h	2017-04-03 19:04:16 UTC (rev 214828)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayError.h	2017-04-03 19:07:50 UTC (rev 214829)
@@ -38,24 +38,24 @@
 using Code = PaymentError::Code;
 using ContactField = PaymentError::ContactField;
 
-static Ref create(Code, const String& message, std::optional);
+static Ref create(Code, std::optional, const String& message);
 virtual ~ApplePayError();
 
 Code code() const { return m_code; }
 void setCode(Code code) { m_code = code; }
 
+std::optional contactField() const { return m_contactField; }
+void setContactField(std::optional contactField) { m_contactField = contactField; }
+
 String message() const { return m_message; }
 void setMessage(String&& message) { m_message = WTFMove(message); }
 
-std::optional contactField() const { return m_contactField; }
-void setContactField(std::optional contactField) { m_contactField = contactField; }
-
 private:
-ApplePayError(Code, const String& message, std::optional);
+ApplePayError(Code, std::optional, const String& message);
 
 Code m_code;
+std::optional m_contactField;
 String m_message;
-std::optional m_contactField;
 };
 
 }


Modified: trunk/Source/WebCore/Modules/applepay/ApplePayError.idl (214828 => 214829)

--- trunk/Source/WebCore/Modules/applepay/ApplePayError.idl	2017-04-03 19:04:16 UTC (rev 214828)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayError.idl	2017-04-03 19:07:50 UTC (rev 214829)
@@ -38,7 +38,8 @@
 "phoneNumber",
 "emailAddress",
 "name",
-"address",
+"postalAddress",
+"addressLines",
 "locality",
 "postalCode",
 "administrativeArea",
@@ -46,11 +47,10 @@
 };
 
 [
-Constructor(ApplePayErrorCode errorCode, optional DOMString message = "", optional ApplePa

[webkit-changes] [214499] trunk/Source/WebCore

2017-03-28 Thread andersca
Title: [214499] trunk/Source/WebCore








Revision 214499
Author ander...@apple.com
Date 2017-03-28 15:26:25 -0700 (Tue, 28 Mar 2017)


Log Message
ApplePayShippingContactUpdate.idl shouldn't have status field
https://bugs.webkit.org/show_bug.cgi?id=170202
rdar://problem/31307106

Reviewed by Beth Dakin.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
If status isn't set, infer it based on whether there are errors present or not.

* Modules/applepay/ApplePayShippingContactUpdate.h:
Make status optional here; it's still used by the old code path.

* Modules/applepay/ApplePayShippingContactUpdate.idl:
Remove status here.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp
trunk/Source/WebCore/Modules/applepay/ApplePayShippingContactUpdate.h
trunk/Source/WebCore/Modules/applepay/ApplePayShippingContactUpdate.idl




Diff

Modified: trunk/Source/WebCore/ChangeLog (214498 => 214499)

--- trunk/Source/WebCore/ChangeLog	2017-03-28 22:16:01 UTC (rev 214498)
+++ trunk/Source/WebCore/ChangeLog	2017-03-28 22:26:25 UTC (rev 214499)
@@ -1,3 +1,21 @@
+2017-03-28  Anders Carlsson  
+
+ApplePayShippingContactUpdate.idl shouldn't have status field
+https://bugs.webkit.org/show_bug.cgi?id=170202
+rdar://problem/31307106
+
+Reviewed by Beth Dakin.
+
+* Modules/applepay/ApplePaySession.cpp:
+(WebCore::convertAndValidate):
+If status isn't set, infer it based on whether there are errors present or not.
+
+* Modules/applepay/ApplePayShippingContactUpdate.h:
+Make status optional here; it's still used by the old code path.
+
+* Modules/applepay/ApplePayShippingContactUpdate.idl:
+Remove status here.
+
 2017-03-28  Brian Burg  
 
 Web Inspector: Add "Disable Caches" option that only applies to the inspected page while Web Inspector is open


Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp (214498 => 214499)

--- trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-03-28 22:16:01 UTC (rev 214498)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-03-28 22:26:25 UTC (rev 214499)
@@ -472,12 +472,22 @@
 {
 ShippingContactUpdate convertedUpdate;
 
-auto authorizationStatus = toPaymentAuthorizationStatus(update.status);
-if (!authorizationStatus)
-return Exception { INVALID_ACCESS_ERR };
-convertedUpdate.status = *authorizationStatus;
-convertedUpdate.errors = convert(update.errors);
+if (!update.status) {
+convertedUpdate.errors = convert(update.errors);
+if (convertedUpdate.errors.isEmpty())
+convertedUpdate.status = PaymentAuthorizationStatus::Success;
+else
+convertedUpdate.status = PaymentAuthorizationStatus::Failure;
+} else {
+ASSERT(update.errors.isEmpty());
 
+auto authorizationStatus = toPaymentAuthorizationStatus(*update.status);
+if (!authorizationStatus)
+return Exception { INVALID_ACCESS_ERR };
+
+convertedUpdate.status = *authorizationStatus;
+}
+
 auto convertedNewShippingMethods = convertAndValidate(WTFMove(update.newShippingMethods));
 if (convertedNewShippingMethods.hasException())
 return convertedNewShippingMethods.releaseException();


Modified: trunk/Source/WebCore/Modules/applepay/ApplePayShippingContactUpdate.h (214498 => 214499)

--- trunk/Source/WebCore/Modules/applepay/ApplePayShippingContactUpdate.h	2017-03-28 22:16:01 UTC (rev 214498)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayShippingContactUpdate.h	2017-03-28 22:26:25 UTC (rev 214499)
@@ -34,7 +34,7 @@
 namespace WebCore {
 
 struct ApplePayShippingContactUpdate {
-unsigned short status;
+std::optional status;
 Vector> errors;
 
 Vector newShippingMethods;


Modified: trunk/Source/WebCore/Modules/applepay/ApplePayShippingContactUpdate.idl (214498 => 214499)

--- trunk/Source/WebCore/Modules/applepay/ApplePayShippingContactUpdate.idl	2017-03-28 22:16:01 UTC (rev 214498)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayShippingContactUpdate.idl	2017-03-28 22:26:25 UTC (rev 214499)
@@ -26,7 +26,6 @@
 [
 Conditional=APPLE_PAY_DELEGATE,
 ] dictionary ApplePayShippingContactUpdate {
-required unsigned short status;
 sequence errors;
 
 sequence newShippingMethods;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [214430] trunk/Source/WebCore

2017-03-27 Thread andersca
Title: [214430] trunk/Source/WebCore








Revision 214430
Author ander...@apple.com
Date 2017-03-27 14:32:17 -0700 (Mon, 27 Mar 2017)


Log Message
Propagate shipping contact update errors
https://bugs.webkit.org/show_bug.cgi?id=170141
rdar://problem/31276576

Reviewed by Tim Horton.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (214429 => 214430)

--- trunk/Source/WebCore/ChangeLog	2017-03-27 21:20:30 UTC (rev 214429)
+++ trunk/Source/WebCore/ChangeLog	2017-03-27 21:32:17 UTC (rev 214430)
@@ -1,3 +1,14 @@
+2017-03-27  Anders Carlsson  
+
+Propagate shipping contact update errors
+https://bugs.webkit.org/show_bug.cgi?id=170141
+rdar://problem/31276576
+
+Reviewed by Tim Horton.
+
+* Modules/applepay/ApplePaySession.cpp:
+(WebCore::convertAndValidate):
+
 2017-03-27  Ryan Haddad  
 
 Unreviewed, rolling out r214411.


Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp (214429 => 214430)

--- trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-03-27 21:20:30 UTC (rev 214429)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-03-27 21:32:17 UTC (rev 214430)
@@ -476,6 +476,7 @@
 if (!authorizationStatus)
 return Exception { INVALID_ACCESS_ERR };
 convertedUpdate.status = *authorizationStatus;
+convertedUpdate.errors = convert(update.errors);
 
 auto convertedNewShippingMethods = convertAndValidate(WTFMove(update.newShippingMethods));
 if (convertedNewShippingMethods.hasException())






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [214428] trunk/Source/WebKit2

2017-03-27 Thread andersca
Title: [214428] trunk/Source/WebKit2








Revision 214428
Author ander...@apple.com
Date 2017-03-27 13:55:45 -0700 (Mon, 27 Mar 2017)


Log Message
Fix uses of deprecated API
https://bugs.webkit.org/show_bug.cgi?id=170138
rdar://problem/28882449

Reviewed by Tim Horton.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toPKContactFields):
(WebKit::toPKAddressField):
(WebKit::toPKPaymentRequest):
Don't use deprecated APIs.

(WebKit::toNSError):
Don't try to insert nil in a dictionary.

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (214427 => 214428)

--- trunk/Source/WebKit2/ChangeLog	2017-03-27 19:57:22 UTC (rev 214427)
+++ trunk/Source/WebKit2/ChangeLog	2017-03-27 20:55:45 UTC (rev 214428)
@@ -1,3 +1,20 @@
+2017-03-27  Anders Carlsson  
+
+Fix uses of deprecated API
+https://bugs.webkit.org/show_bug.cgi?id=170138
+rdar://problem/28882449
+
+Reviewed by Tim Horton.
+
+* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
+(WebKit::toPKContactFields):
+(WebKit::toPKAddressField):
+(WebKit::toPKPaymentRequest):
+Don't use deprecated APIs.
+
+(WebKit::toNSError):
+Don't try to insert nil in a dictionary.
+
 2017-03-27  Alex Christensen  
 
 Make WebSockets work in network process


Modified: trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm (214427 => 214428)

--- trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm	2017-03-27 19:57:22 UTC (rev 214427)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm	2017-03-27 20:55:45 UTC (rev 214428)
@@ -308,12 +308,27 @@
 }];
 }
 
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 11)
+static RetainPtr toPKContactFields(const WebCore::PaymentRequest::ContactFields& contactFields)
+{
+Vector result;
+
+if (contactFields.postalAddress)
+result.append(getPKContactFieldPostalAddress());
+if (contactFields.phone)
+result.append(getPKContactFieldPhoneNumber());
+if (contactFields.email)
+result.append(getPKContactFieldEmailAddress());
+if (contactFields.name)
+result.append(getPKContactFieldName());
+
+return adoptNS([[NSSet alloc] initWithObjects:result.data() count:result.size()]);
+}
+#else
 static PKAddressField toPKAddressField(const WebCore::PaymentRequest::ContactFields& contactFields)
 {
 PKAddressField result = 0;
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
 if (contactFields.postalAddress)
 result |= PKAddressFieldPostalAddress;
 if (contactFields.phone)
@@ -322,10 +337,10 @@
 result |= PKAddressFieldEmail;
 if (contactFields.name)
 result |= PKAddressFieldName;
-#pragma clang diagnostic pop
 
 return result;
 }
+#endif
 
 static PKPaymentSummaryItemType toPKPaymentSummaryItemType(WebCore::PaymentRequest::LineItem::Type type)
 {
@@ -488,11 +503,13 @@
 [result setCurrencyCode:paymentRequest.currencyCode()];
 [result setBillingContact:paymentRequest.billingContact().pkContact()];
 [result setShippingContact:paymentRequest.shippingContact().pkContact()];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 11)
+[result setRequiredBillingContactFields:toPKContactFields(paymentRequest.requiredBillingContactFields()).get()];
+[result setRequiredShippingContactFields:toPKContactFields(paymentRequest.requiredShippingContactFields()).get()];
+#else
 [result setRequiredBillingAddressFields:toPKAddressField(paymentRequest.requiredBillingContactFields())];
 [result setRequiredShippingAddressFields:toPKAddressField(paymentRequest.requiredShippingContactFields())];
-#pragma clang diagnostic pop
+#endif
 
 [result setSupportedNetworks:toSupportedNetworks(paymentRequest.supportedNetworks()).get()];
 [result setMerchantCapabilities:toPKMerchantCapabilities(paymentRequest.merchantCapabilities())];
@@ -603,7 +620,8 @@
 }
 
 [userInfo setObject:pkContactField forKey:getPKPaymentErrorContactFieldUserInfoKey()];
-[userInfo setObject:postalAddressKey forKey:getPKPaymentErrorPostalAddressUserInfoKey()];
+if (postalAddressKey)
+[userInfo setObject:postalAddressKey forKey:getPKPaymentErrorPostalAddressUserInfoKey()];
 }
 
 return adoptNS([[NSError alloc] initWithDomain:getPKPaymentErrorDomain() code:toPKPaymentErrorCode(error.code) userInfo:userInfo.get()]);






___
webkit-changes mailing list
webkit-changes@lists.webki

[webkit-changes] [214235] trunk/Source

2017-03-21 Thread andersca
Title: [214235] trunk/Source








Revision 214235
Author ander...@apple.com
Date 2017-03-21 16:40:26 -0700 (Tue, 21 Mar 2017)


Log Message
Remove bogus availability annotations from DOM SPI headers.
rdar://problem/31015675

Rubber-stamped by Dan Bernstein.

Source/WebCore:

* platform/cocoa/WebKitAvailability.h:
Remove __NSi_9876_5 #define.

Source/WebKit/mac:

* DOM/DOMHTMLMediaElement.h:
* DOM/DOMHTMLVideoElement.h:
* DOM/DOMMediaError.h:
* DOM/DOMTextEvent.h:
* DOM/DOMTimeRanges.h:
* DOM/DOMTokenList.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/cocoa/WebKitAvailability.h
trunk/Source/WebKit/mac/ChangeLog
trunk/Source/WebKit/mac/DOM/DOMHTMLMediaElement.h
trunk/Source/WebKit/mac/DOM/DOMHTMLVideoElement.h
trunk/Source/WebKit/mac/DOM/DOMMediaError.h
trunk/Source/WebKit/mac/DOM/DOMTextEvent.h
trunk/Source/WebKit/mac/DOM/DOMTimeRanges.h
trunk/Source/WebKit/mac/DOM/DOMTokenList.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (214234 => 214235)

--- trunk/Source/WebCore/ChangeLog	2017-03-21 23:02:30 UTC (rev 214234)
+++ trunk/Source/WebCore/ChangeLog	2017-03-21 23:40:26 UTC (rev 214235)
@@ -1,3 +1,13 @@
+2017-03-21  Anders Carlsson  
+
+Remove bogus availability annotations from DOM SPI headers.
+rdar://problem/31015675
+
+Rubber-stamped by Dan Bernstein.
+
+* platform/cocoa/WebKitAvailability.h:
+Remove __NSi_9876_5 #define.
+
 2017-03-21  Zalan Bujtas  
 
 Tear down descendant renderers when 's display value is set to no "contents".


Modified: trunk/Source/WebCore/platform/cocoa/WebKitAvailability.h (214234 => 214235)

--- trunk/Source/WebCore/platform/cocoa/WebKitAvailability.h	2017-03-21 23:02:30 UTC (rev 214234)
+++ trunk/Source/WebCore/platform/cocoa/WebKitAvailability.h	2017-03-21 23:40:26 UTC (rev 214235)
@@ -31,10 +31,6 @@
 #if !TARGET_OS_IPHONE
 #import 
 
-#ifndef __NSi_9876_5
-#define __NSi_9876_5 introduced=9876.5
-#endif
-
 #define WEBKIT_AVAILABLE_MAC(introduced) NS_AVAILABLE_MAC(introduced)
 #define WEBKIT_CLASS_AVAILABLE_MAC(introduced) NS_CLASS_AVAILABLE_MAC(introduced)
 #define WEBKIT_ENUM_AVAILABLE_MAC(introduced) NS_ENUM_AVAILABLE_MAC(introduced)


Modified: trunk/Source/WebKit/mac/ChangeLog (214234 => 214235)

--- trunk/Source/WebKit/mac/ChangeLog	2017-03-21 23:02:30 UTC (rev 214234)
+++ trunk/Source/WebKit/mac/ChangeLog	2017-03-21 23:40:26 UTC (rev 214235)
@@ -1,3 +1,17 @@
+2017-03-21  Anders Carlsson  
+
+Remove bogus availability annotations from DOM SPI headers.
+rdar://problem/31015675
+
+Rubber-stamped by Dan Bernstein.
+
+* DOM/DOMHTMLMediaElement.h:
+* DOM/DOMHTMLVideoElement.h:
+* DOM/DOMMediaError.h:
+* DOM/DOMTextEvent.h:
+* DOM/DOMTimeRanges.h:
+* DOM/DOMTokenList.h:
+
 2017-03-19  Wenson Hsieh  
 
 Teach TextIndicator to estimate the background color of the given Range


Modified: trunk/Source/WebKit/mac/DOM/DOMHTMLMediaElement.h (214234 => 214235)

--- trunk/Source/WebKit/mac/DOM/DOMHTMLMediaElement.h	2017-03-21 23:02:30 UTC (rev 214234)
+++ trunk/Source/WebKit/mac/DOM/DOMHTMLMediaElement.h	2017-03-21 23:40:26 UTC (rev 214235)
@@ -39,9 +39,9 @@
 DOM_HAVE_CURRENT_DATA = 2,
 DOM_HAVE_FUTURE_DATA = 3,
 DOM_HAVE_ENOUGH_DATA = 4
-} WEBKIT_ENUM_AVAILABLE_MAC(9876_5);
+};
 
-WEBKIT_CLASS_AVAILABLE_MAC(9876_5)
+__attribute__((visibility("default")))
 @interface DOMHTMLMediaElement : DOMHTMLElement
 @property (readonly, strong) DOMMediaError *error;
 @property (copy) NSString *src;


Modified: trunk/Source/WebKit/mac/DOM/DOMHTMLVideoElement.h (214234 => 214235)

--- trunk/Source/WebKit/mac/DOM/DOMHTMLVideoElement.h	2017-03-21 23:02:30 UTC (rev 214234)
+++ trunk/Source/WebKit/mac/DOM/DOMHTMLVideoElement.h	2017-03-21 23:40:26 UTC (rev 214235)
@@ -27,7 +27,7 @@
 
 @class NSString;
 
-WEBKIT_CLASS_AVAILABLE_MAC(9876_5)
+__attribute__((visibility("default")))
 @interface DOMHTMLVideoElement : DOMHTMLMediaElement
 @property unsigned width;
 @property unsigned height;


Modified: trunk/Source/WebKit/mac/DOM/DOMMediaError.h (214234 => 214235)

--- trunk/Source/WebKit/mac/DOM/DOMMediaError.h	2017-03-21 23:02:30 UTC (rev 214234)
+++ trunk/Source/WebKit/mac/DOM/DOMMediaError.h	2017-03-21 23:40:26 UTC (rev 214235)
@@ -31,9 +31,9 @@
 DOM_MEDIA_ERR_DECODE = 3,
 DOM_MEDIA_ERR_SRC_NOT_SUPPORTED = 4,
 DOM_MEDIA_ERR_ENCRYPTED = 5
-} WEBKIT_ENUM_AVAILABLE_MAC(9876_5);
+};
 
-WEBKIT_CLASS_AVAILABLE_MAC(9876_5)
+__attribute__((visibility("default")))
 @interface DOMMediaError : DOMObject
 @property (readonly) unsigned short code;
 @end


Modified: trunk/Source/WebKit/mac/DOM/DOMTextEvent.h (214234 => 214235)

--- trunk/Source/WebKit/mac/DOM/DOMTextEvent.h	2017-03-21 23:02:30 UTC (rev 214234)
+++ trunk/Source/WebKit/mac/DOM/DOMTextEvent.h	2017-03-21 23:40:26 UTC (rev 214235)
@@ -28,7 +28,7 @@
 @class DOMAbstractView;
 @class NSString;
 
-WEBKIT_CLASS_AVAILABLE_MAC(9876_5)
+__attribute__((visibility("default")))

[webkit-changes] [214179] trunk/Source/WebKit2

2017-03-20 Thread andersca
Title: [214179] trunk/Source/WebKit2








Revision 214179
Author ander...@apple.com
Date 2017-03-20 11:30:19 -0700 (Mon, 20 Mar 2017)


Log Message
Fix a paste-o in WebPaymentCoordinatorProxy::platformCompletePaymentSession
https://bugs.webkit.org/show_bug.cgi?id=169881
rdar://problem/31030944

Reviewed by Dan Bernstein.

Don't always pass PKPaymentAuthorizationStatusFailure to the completion handler.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (214178 => 214179)

--- trunk/Source/WebKit2/ChangeLog	2017-03-20 17:55:20 UTC (rev 214178)
+++ trunk/Source/WebKit2/ChangeLog	2017-03-20 18:30:19 UTC (rev 214179)
@@ -1,3 +1,16 @@
+2017-03-20  Anders Carlsson  
+
+Fix a paste-o in WebPaymentCoordinatorProxy::platformCompletePaymentSession
+https://bugs.webkit.org/show_bug.cgi?id=169881
+rdar://problem/31030944
+
+Reviewed by Dan Bernstein.
+
+Don't always pass PKPaymentAuthorizationStatusFailure to the completion handler.
+
+* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
+(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
+
 2017-03-20  Wenson Hsieh  
 
 TextIndicator should support a mode where selection rects are used to size the snapshot


Modified: trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm (214178 => 214179)

--- trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm	2017-03-20 17:55:20 UTC (rev 214178)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm	2017-03-20 18:30:19 UTC (rev 214179)
@@ -631,7 +631,7 @@
 m_paymentAuthorizationViewControllerDelegate->_didReachFinalState = WebCore::isFinalStateStatus(status);
 
 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 11)
-auto pkPaymentAuthorizationResult = adoptNS([allocPKPaymentAuthorizationResultInstance() initWithStatus:PKPaymentAuthorizationStatusFailure errors:result ? toNSErrors(result->errors).get() : @[ ]]);
+auto pkPaymentAuthorizationResult = adoptNS([allocPKPaymentAuthorizationResultInstance() initWithStatus:toPKPaymentAuthorizationStatus(status) errors:result ? toNSErrors(result->errors).get() : @[ ]]);
 m_paymentAuthorizationViewControllerDelegate->_paymentAuthorizedCompletion(pkPaymentAuthorizationResult.get());
 #else
 m_paymentAuthorizationViewControllerDelegate->_paymentAuthorizedCompletion(toPKPaymentAuthorizationStatus(status));






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [213946] trunk/Source

2017-03-14 Thread andersca
Title: [213946] trunk/Source








Revision 213946
Author ander...@apple.com
Date 2017-03-14 15:32:10 -0700 (Tue, 14 Mar 2017)


Log Message
Propagate PassKit errors
https://bugs.webkit.org/show_bug.cgi?id=169633
rdar://problem/31043392

Reviewed by Dean Jackson.

Source/WebCore:

* Modules/applepay/ApplePayError.idl:
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convert):
(WebCore::convertAndValidate):
* Modules/applepay/PaymentRequest.h:

Source/WebKit2:

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toNSError):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/applepay/ApplePayError.idl
trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp
trunk/Source/WebCore/Modules/applepay/PaymentRequest.h
trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (213945 => 213946)

--- trunk/Source/WebCore/ChangeLog	2017-03-14 22:23:06 UTC (rev 213945)
+++ trunk/Source/WebCore/ChangeLog	2017-03-14 22:32:10 UTC (rev 213946)
@@ -1,3 +1,17 @@
+2017-03-14  Anders Carlsson  
+
+Propagate PassKit errors
+https://bugs.webkit.org/show_bug.cgi?id=169633
+rdar://problem/31043392
+
+Reviewed by Dean Jackson.
+
+* Modules/applepay/ApplePayError.idl:
+* Modules/applepay/ApplePaySession.cpp:
+(WebCore::convert):
+(WebCore::convertAndValidate):
+* Modules/applepay/PaymentRequest.h:
+
 2017-03-14  Alan Kinsley  
 
 Simple line layout: Adjust hyphenation constrains based on the normal line layout line-breaking logic.


Modified: trunk/Source/WebCore/Modules/applepay/ApplePayError.idl (213945 => 213946)

--- trunk/Source/WebCore/Modules/applepay/ApplePayError.idl	2017-03-14 22:23:06 UTC (rev 213945)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayError.idl	2017-03-14 22:32:10 UTC (rev 213946)
@@ -37,14 +37,12 @@
 ] enum ApplePayErrorContactField {
 "phoneNumber",
 "emailAddress",
-"givenName",
-"familyName",
-"addressLines",
+"name",
+"address",
 "locality",
 "postalCode",
 "administrativeArea",
-"country",
-"countryCode"
+"country"
 };
 
 [


Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp (213945 => 213946)

--- trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-03-14 22:23:06 UTC (rev 213945)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-03-14 22:32:10 UTC (rev 213946)
@@ -413,6 +413,23 @@
 }
 }
 
+static Vector convert(const Vector>& errors)
+{
+Vector convertedErrors;
+
+for (auto& error : errors) {
+PaymentError convertedError;
+
+convertedError.code = error->code();
+convertedError.message = error->message();
+convertedError.contactField = error->contactField();
+
+convertedErrors.append(convertedError);
+}
+
+return convertedErrors;
+}
+
 static ExceptionOr convertAndValidate(ApplePayPaymentAuthorizationResult&& result)
 {
 PaymentAuthorizationResult convertedResult;
@@ -421,6 +438,7 @@
 if (!authorizationStatus)
 return Exception { INVALID_ACCESS_ERR };
 convertedResult.status = *authorizationStatus;
+convertedResult.errors = convert(result.errors);
 
 return WTFMove(convertedResult);
 }


Modified: trunk/Source/WebCore/Modules/applepay/PaymentRequest.h (213945 => 213946)

--- trunk/Source/WebCore/Modules/applepay/PaymentRequest.h	2017-03-14 22:23:06 UTC (rev 213945)
+++ trunk/Source/WebCore/Modules/applepay/PaymentRequest.h	2017-03-14 22:32:10 UTC (rev 213946)
@@ -161,14 +161,12 @@
 enum class ContactField {
 PhoneNumber,
 EmailAddress,
-GivenName,
-FamilyName,
-AddressLines,
+Name,
+Address,
 Locality,
 PostalCode,
 AdministrativeArea,
 Country,
-CountryCode,
 };
 
 Code code;
@@ -218,14 +216,12 @@
 WebCore::PaymentError::ContactField,
 WebCore::PaymentError::ContactField::PhoneNumber,
 WebCore::PaymentError::ContactField::EmailAddress,
-WebCore::PaymentError::ContactField::GivenName,
-WebCore::PaymentError::ContactField::FamilyName,
-WebCore::PaymentError::ContactField::AddressLines,
+WebCore::PaymentError::ContactField::Name,
+WebCore::PaymentError::ContactField::Address,
 WebCore::PaymentError::ContactField::Locality,
 WebCore::PaymentError::ContactField::PostalCode,
 WebCore::PaymentError::ContactField::AdministrativeArea,
-WebCore::PaymentError::ContactField::Country,
-WebCore::PaymentError::ContactField::CountryCode
+WebCore::PaymentError::ContactField::Country
 >;
 };
 


Modified: trunk/Source/WebKit2/ChangeLog (213945 => 213946)

--- trunk/Source/WebKit2/ChangeLog	2017-03-14 22:23:06 UTC (rev 213945)
+++ trunk/Source/WebKit2/ChangeLog	2017-03-14 22:32:10 UTC 

[webkit-changes] [213864] trunk/Tools

2017-03-13 Thread andersca
Title: [213864] trunk/Tools








Revision 213864
Author ander...@apple.com
Date 2017-03-13 13:16:24 -0700 (Mon, 13 Mar 2017)


Log Message
Fix build warnings.

* MiniBrowser/mac/AppDelegate.m:
(-[BrowserAppDelegate openDocument:]):
* MiniBrowser/mac/ExtensionManagerWindowController.m:
(-[ExtensionManagerWindowController add:]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:]):

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/MiniBrowser/mac/AppDelegate.m
trunk/Tools/MiniBrowser/mac/ExtensionManagerWindowController.m
trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m




Diff

Modified: trunk/Tools/ChangeLog (213863 => 213864)

--- trunk/Tools/ChangeLog	2017-03-13 20:08:04 UTC (rev 213863)
+++ trunk/Tools/ChangeLog	2017-03-13 20:16:24 UTC (rev 213864)
@@ -1,3 +1,14 @@
+2017-03-13  Anders Carlsson  
+
+Fix build warnings.
+
+* MiniBrowser/mac/AppDelegate.m:
+(-[BrowserAppDelegate openDocument:]):
+* MiniBrowser/mac/ExtensionManagerWindowController.m:
+(-[ExtensionManagerWindowController add:]):
+* MiniBrowser/mac/WK2BrowserWindowController.m:
+(-[WK2BrowserWindowController webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:]):
+
 2017-03-13  Martin Robinson  
 
 Remove my email from some of the watchlists


Modified: trunk/Tools/MiniBrowser/mac/AppDelegate.m (213863 => 213864)

--- trunk/Tools/MiniBrowser/mac/AppDelegate.m	2017-03-13 20:08:04 UTC (rev 213863)
+++ trunk/Tools/MiniBrowser/mac/AppDelegate.m	2017-03-13 20:16:24 UTC (rev 213864)
@@ -243,7 +243,7 @@
 if (browserWindowController) {
 NSOpenPanel *openPanel = [[NSOpenPanel openPanel] retain];
 [openPanel beginSheetModalForWindow:browserWindowController.window completionHandler:^(NSInteger result) {
-if (result != NSFileHandlingPanelOKButton)
+if (result != NSModalResponseOK)
 return;
 
 NSURL *url = "" objectAtIndex:0];
@@ -254,7 +254,7 @@
 
 NSOpenPanel *openPanel = [NSOpenPanel openPanel];
 [openPanel beginWithCompletionHandler:^(NSInteger result) {
-if (result != NSFileHandlingPanelOKButton)
+if (result != NSModalResponseOK)
 return;
 
 BrowserWindowController *controller = [self createBrowserWindowController:nil];


Modified: trunk/Tools/MiniBrowser/mac/ExtensionManagerWindowController.m (213863 => 213864)

--- trunk/Tools/MiniBrowser/mac/ExtensionManagerWindowController.m	2017-03-13 20:08:04 UTC (rev 213863)
+++ trunk/Tools/MiniBrowser/mac/ExtensionManagerWindowController.m	2017-03-13 20:16:24 UTC (rev 213864)
@@ -75,7 +75,7 @@
 
 [openPanel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result)
 {
-if (result != NSFileHandlingPanelOKButton)
+if (result != NSModalResponseOK)
 return;
 
 NSURL *url = "" objectAtIndex:0];


Modified: trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m (213863 => 213864)

--- trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m	2017-03-13 20:08:04 UTC (rev 213863)
+++ trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m	2017-03-13 20:16:24 UTC (rev 213864)
@@ -507,7 +507,7 @@
 openPanel.allowsMultipleSelection = parameters.allowsMultipleSelection;
 
 [openPanel beginSheetModalForWindow:webView.window completionHandler:^(NSInteger result) {
-if (result == NSFileHandlingPanelOKButton)
+if (result == NSModalResponseOK)
 completionHandler(openPanel.URLs);
 else
 completionHandler(nil);






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [213863] trunk/Source/WebKit2

2017-03-13 Thread andersca
Title: [213863] trunk/Source/WebKit2








Revision 213863
Author ander...@apple.com
Date 2017-03-13 13:08:04 -0700 (Mon, 13 Mar 2017)


Log Message
Fix more build warnings.

* UIProcess/mac/WKWebInspectorWKWebView.mm:
(WebKit::runOpenPanel):
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformSave):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/UIProcess/mac/WKWebInspectorWKWebView.mm
trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (213862 => 213863)

--- trunk/Source/WebKit2/ChangeLog	2017-03-13 19:46:05 UTC (rev 213862)
+++ trunk/Source/WebKit2/ChangeLog	2017-03-13 20:08:04 UTC (rev 213863)
@@ -1,5 +1,14 @@
 2017-03-13  Anders Carlsson  
 
+Fix more build warnings.
+
+* UIProcess/mac/WKWebInspectorWKWebView.mm:
+(WebKit::runOpenPanel):
+* UIProcess/mac/WebInspectorProxyMac.mm:
+(WebKit::WebInspectorProxy::platformSave):
+
+2017-03-13  Anders Carlsson  
+
 Fix build warnings.
 
 * UIProcess/mac/RemoteWebInspectorProxyMac.mm:


Modified: trunk/Source/WebKit2/UIProcess/mac/WKWebInspectorWKWebView.mm (213862 => 213863)

--- trunk/Source/WebKit2/UIProcess/mac/WKWebInspectorWKWebView.mm	2017-03-13 19:46:05 UTC (rev 213862)
+++ trunk/Source/WebKit2/UIProcess/mac/WKWebInspectorWKWebView.mm	2017-03-13 20:08:04 UTC (rev 213863)
@@ -81,7 +81,7 @@
 WKRetain(listener);
 
 auto completionHandler = ^(NSInteger result) {
-if (result == NSFileHandlingPanelOKButton) {
+if (result == NSModalResponseOK) {
 WKRetainPtr fileURLs = adoptWK(WKMutableArrayCreate());
 
 for (NSURL* nsURL in [openPanel URLs]) {


Modified: trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm (213862 => 213863)

--- trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2017-03-13 19:46:05 UTC (rev 213862)
+++ trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2017-03-13 20:08:04 UTC (rev 213863)
@@ -463,9 +463,9 @@
 panel.directoryURL = [platformURL URLByDeletingLastPathComponent];
 
 auto completionHandler = ^(NSInteger result) {
-if (result == NSFileHandlingPanelCancelButton)
+if (result == NSModalResponseCancel)
 return;
-ASSERT(result == NSFileHandlingPanelOKButton);
+ASSERT(result == NSModalResponseOK);
 saveToURL(panel.URL);
 };
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [213861] trunk/Source

2017-03-13 Thread andersca
Title: [213861] trunk/Source








Revision 213861
Author ander...@apple.com
Date 2017-03-13 12:42:05 -0700 (Mon, 13 Mar 2017)


Log Message
Fix build warnings.

Source/WebKit/mac:

* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::save):
(-[WebInspectorWindowController webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles:]):

Source/WebKit2:

* UIProcess/mac/RemoteWebInspectorProxyMac.mm:
(WebKit::RemoteWebInspectorProxy::platformSave):

Modified Paths

trunk/Source/WebKit/mac/ChangeLog
trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/UIProcess/mac/RemoteWebInspectorProxyMac.mm




Diff

Modified: trunk/Source/WebKit/mac/ChangeLog (213860 => 213861)

--- trunk/Source/WebKit/mac/ChangeLog	2017-03-13 19:36:27 UTC (rev 213860)
+++ trunk/Source/WebKit/mac/ChangeLog	2017-03-13 19:42:05 UTC (rev 213861)
@@ -1,3 +1,11 @@
+2017-03-13  Anders Carlsson  
+
+Fix build warnings.
+
+* WebCoreSupport/WebInspectorClient.mm:
+(WebInspectorFrontendClient::save):
+(-[WebInspectorWindowController webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles:]):
+
 2017-03-11  Brady Eidson  
 
 Cleanup "addCookie" and its sole user.


Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm (213860 => 213861)

--- trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm	2017-03-13 19:36:27 UTC (rev 213860)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm	2017-03-13 19:42:05 UTC (rev 213861)
@@ -332,9 +332,9 @@
 panel.directoryURL = [platformURL URLByDeletingLastPathComponent];
 
 auto completionHandler = ^(NSInteger result) {
-if (result == NSFileHandlingPanelCancelButton)
+if (result == NSModalResponseCancel)
 return;
-ASSERT(result == NSFileHandlingPanelOKButton);
+ASSERT(result == NSModalResponseOK);
 saveToURL(panel.URL);
 };
 
@@ -684,11 +684,11 @@
 panel.allowsMultipleSelection = allowMultipleFiles;
 
 auto completionHandler = ^(NSInteger result) {
-if (result == NSFileHandlingPanelCancelButton) {
+if (result == NSModalResponseCancel) {
 [resultListener cancel];
 return;
 }
-ASSERT(result == NSFileHandlingPanelOKButton);
+ASSERT(result == NSModalResponseOK);
 
 NSArray *URLs = panel.URLs;
 NSMutableArray *filenames = [NSMutableArray arrayWithCapacity:URLs.count];


Modified: trunk/Source/WebKit2/ChangeLog (213860 => 213861)

--- trunk/Source/WebKit2/ChangeLog	2017-03-13 19:36:27 UTC (rev 213860)
+++ trunk/Source/WebKit2/ChangeLog	2017-03-13 19:42:05 UTC (rev 213861)
@@ -1,3 +1,10 @@
+2017-03-13  Anders Carlsson  
+
+Fix build warnings.
+
+* UIProcess/mac/RemoteWebInspectorProxyMac.mm:
+(WebKit::RemoteWebInspectorProxy::platformSave):
+
 2017-03-13  Yusuke Suzuki  
 
 [WTF] Clean up RunLoop and WorkQueue with Seconds and Function


Modified: trunk/Source/WebKit2/UIProcess/mac/RemoteWebInspectorProxyMac.mm (213860 => 213861)

--- trunk/Source/WebKit2/UIProcess/mac/RemoteWebInspectorProxyMac.mm	2017-03-13 19:36:27 UTC (rev 213860)
+++ trunk/Source/WebKit2/UIProcess/mac/RemoteWebInspectorProxyMac.mm	2017-03-13 19:42:05 UTC (rev 213861)
@@ -182,9 +182,9 @@
 panel.directoryURL = [platformURL URLByDeletingLastPathComponent];
 
 auto completionHandler = ^(NSInteger result) {
-if (result == NSFileHandlingPanelCancelButton)
+if (result == NSModalResponseCancel)
 return;
-ASSERT(result == NSFileHandlingPanelOKButton);
+ASSERT(result == NSModalResponseOK);
 saveToURL(panel.URL);
 };
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [213679] trunk/Source/WebCore

2017-03-09 Thread andersca
Title: [213679] trunk/Source/WebCore








Revision 213679
Author ander...@apple.com
Date 2017-03-09 14:49:45 -0800 (Thu, 09 Mar 2017)


Log Message
Use the right conditional.

* Modules/applepay/ApplePayError.idl:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/applepay/ApplePayError.idl




Diff

Modified: trunk/Source/WebCore/ChangeLog (213678 => 213679)

--- trunk/Source/WebCore/ChangeLog	2017-03-09 22:47:29 UTC (rev 213678)
+++ trunk/Source/WebCore/ChangeLog	2017-03-09 22:49:45 UTC (rev 213679)
@@ -1,3 +1,9 @@
+2017-03-09  Anders Carlsson  
+
+Use the right conditional.
+
+* Modules/applepay/ApplePayError.idl:
+
 2017-03-09  Daniel Bates  
 
 Guard Credential Management implementation behind a runtime enabled feature flag


Modified: trunk/Source/WebCore/Modules/applepay/ApplePayError.idl (213678 => 213679)

--- trunk/Source/WebCore/Modules/applepay/ApplePayError.idl	2017-03-09 22:47:29 UTC (rev 213678)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayError.idl	2017-03-09 22:49:45 UTC (rev 213679)
@@ -49,7 +49,7 @@
 
 [
 Constructor(ApplePayErrorCode errorCode, optional DOMString message = "", optional ApplePayErrorContactField contactField),
-Conditional=APPLE_PAY,
+Conditional=APPLE_PAY_DELEGATE,
 ] interface ApplePayError {
 attribute ApplePayErrorCode code;
 attribute DOMString message;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [213673] trunk

2017-03-09 Thread andersca
Title: [213673] trunk








Revision 213673
Author ander...@apple.com
Date 2017-03-09 14:34:52 -0800 (Thu, 09 Mar 2017)


Log Message
Add delegate support to WebCore
https://bugs.webkit.org/show_bug.cgi?id=169427
Part of rdar://problem/28880714.

Reviewed by Geoffrey Garen.

Source/_javascript_Core:

* Configurations/FeatureDefines.xcconfig:
Add feature define.

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:
Add feature define.

* DerivedSources.make:
Add idl files.

* Modules/applepay/ApplePayError.cpp:
(WebCore::ApplePayError::create):
(WebCore::ApplePayError::ApplePayError):
(WebCore::ApplePayError::~ApplePayError):
* Modules/applepay/ApplePayError.h:
* Modules/applepay/ApplePayError.idl:
* Modules/applepay/ApplePayPaymentAuthorizationResult.h:
* Modules/applepay/ApplePayPaymentAuthorizationResult.idl:
* Modules/applepay/ApplePayPaymentMethodUpdate.h:
* Modules/applepay/ApplePayPaymentMethodUpdate.idl:
* Modules/applepay/ApplePayShippingContactUpdate.h:
* Modules/applepay/ApplePayShippingContactUpdate.idl:
* Modules/applepay/ApplePayShippingMethodUpdate.h:
* Modules/applepay/ApplePayShippingMethodUpdate.idl:
Add new files.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::toPaymentAuthorizationStatus):
Move this function to the top.

(WebCore::convertAndValidate):
Add new convertAndValidate functions.

(WebCore::ApplePaySession::completeShippingMethodSelection):
(WebCore::ApplePaySession::completeShippingContactSelection):
(WebCore::ApplePaySession::completePaymentMethodSelection):
(WebCore::ApplePaySession::completePayment):
* Modules/applepay/ApplePaySession.h:
* Modules/applepay/ApplePaySession.idl:
Implement the old functions in terms of the new functions.

* Modules/applepay/PaymentCoordinator.cpp:
* WebCore.xcodeproj/project.pbxproj:
Add new files.

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:
Add feature define.

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:
Add feature define.

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:
Add feature define.

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig
trunk/Source/WebCore/DerivedSources.make
trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp
trunk/Source/WebCore/Modules/applepay/ApplePaySession.h
trunk/Source/WebCore/Modules/applepay/ApplePaySession.idl
trunk/Source/WebCore/PAL/ChangeLog
trunk/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
trunk/Source/WebKit/mac/ChangeLog
trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig


Added Paths

trunk/Source/WebCore/Modules/applepay/ApplePayError.cpp
trunk/Source/WebCore/Modules/applepay/ApplePayError.h
trunk/Source/WebCore/Modules/applepay/ApplePayError.idl
trunk/Source/WebCore/Modules/applepay/ApplePayPaymentAuthorizationResult.h
trunk/Source/WebCore/Modules/applepay/ApplePayPaymentAuthorizationResult.idl
trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodUpdate.h
trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodUpdate.idl
trunk/Source/WebCore/Modules/applepay/ApplePayShippingContactUpdate.h
trunk/Source/WebCore/Modules/applepay/ApplePayShippingContactUpdate.idl
trunk/Source/WebCore/Modules/applepay/ApplePayShippingMethodUpdate.h
trunk/Source/WebCore/Modules/applepay/ApplePayShippingMethodUpdate.idl




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (213672 => 213673)

--- trunk/Source/_javascript_Core/ChangeLog	2017-03-09 22:29:39 UTC (rev 213672)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-03-09 22:34:52 UTC (rev 213673)
@@ -1,3 +1,14 @@
+2017-03-09  Anders Carlsson  
+
+Add delegate support to WebCore
+https://bugs.webkit.org/show_bug.cgi?id=169427
+Part of rdar://problem/28880714.
+
+Reviewed by Geoffrey Garen.
+
+* Configurations/FeatureDefines.xcconfig:
+Add feature define.
+
 2017-03-09  Nikita Vasilyev  
 
 Web Inspector: Show individual messages in the content pane for a WebSocket


Modified: trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig (213672 => 213673)

--- trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig	2017-03-09 22:29:39 UTC (rev 213672)
+++ trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig	2017-03-09 22:34:52 UTC (rev 213673)
@@ -35,6 +35,11 @@
 TARGET_MAC_OS_X_VERSION_LESS_THAN_1012000_101000 = YES;
 TARGET_MAC_OS_X_VERSION_LESS_THAN_1012000_101100 = YES;
 
+TARGET_MAC_OS_X_VERSION_LESS_THAN_1013000 = $(TARGET_MAC_OS_X_VERSION_LESS_THAN_1013000_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+TARGET_MAC_OS_X_VER

[webkit-changes] [213647] trunk/Source/WebKit2

2017-03-09 Thread andersca
Title: [213647] trunk/Source/WebKit2








Revision 213647
Author ander...@apple.com
Date 2017-03-09 10:33:17 -0800 (Thu, 09 Mar 2017)


Log Message
Add new delegate methods
https://bugs.webkit.org/show_bug.cgi?id=169394
Part of rdar://problem/28880714.

Reviewed by Tim Horton.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(-[WKPaymentAuthorizationViewControllerDelegate invalidate]):
(toShippingMethod):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:completion:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:completion:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:completion:]):
(WebKit::toPKPaymentAuthorizationStatus):
(WebKit::toPKPaymentErrorCode):
(WebKit::toNSError):
(WebKit::toNSErrors):
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h
trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (213646 => 213647)

--- trunk/Source/WebKit2/ChangeLog	2017-03-09 17:59:46 UTC (rev 213646)
+++ trunk/Source/WebKit2/ChangeLog	2017-03-09 18:33:17 UTC (rev 213647)
@@ -1,3 +1,31 @@
+2017-03-08  Anders Carlsson  
+
+Add new delegate methods
+https://bugs.webkit.org/show_bug.cgi?id=169394
+Part of rdar://problem/28880714.
+
+Reviewed by Tim Horton.
+
+* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
+* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
+(-[WKPaymentAuthorizationViewControllerDelegate invalidate]):
+(toShippingMethod):
+(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]):
+(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
+(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
+(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):
+(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:completion:]):
+(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:completion:]):
+(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:completion:]):
+(WebKit::toPKPaymentAuthorizationStatus):
+(WebKit::toPKPaymentErrorCode):
+(WebKit::toNSError):
+(WebKit::toNSErrors):
+(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
+(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
+(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
+(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
+
 2017-03-09  Tim Horton  
 
 WKWebView should automatically respect insets from the view controller hierarchy


Modified: trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h (213646 => 213647)

--- trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h	2017-03-09 17:59:46 UTC (rev 213646)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h	2017-03-09 18:33:17 UTC (rev 213647)
@@ -52,10 +52,17 @@
 BlockPtr _sessionBlock;
 
 BOOL _didReachFinalState;
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 11)
+BlockPtr _paymentAuthorizedCompletion;
+BlockPtr _didSelectPaymentMethodCompletion;
+BlockPtr _didSelectShippingMethodCompletion;
+BlockPtr _didSelectShippingContactCompletion;
+#else
 BlockPtr _paymentAuthorizedCompletion;
 BlockPtr _didSelectPaymentMethodCo

[webkit-changes] [213609] trunk/Source/WebKit2

2017-03-08 Thread andersca
Title: [213609] trunk/Source/WebKit2








Revision 213609
Author ander...@apple.com
Date 2017-03-08 16:43:31 -0800 (Wed, 08 Mar 2017)


Log Message
Clean up WebPaymentCoordinatorProxy
https://bugs.webkit.org/show_bug.cgi?id=169393
Part of rdar://problem/28880714.

Reviewed by Beth Dakin.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]):
Move this to where it belongs.

(WebKit::toPKPaymentSummaryItems):
Add a new helper function.

(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
Use the new helper function.

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (213608 => 213609)

--- trunk/Source/WebKit2/ChangeLog	2017-03-09 00:34:36 UTC (rev 213608)
+++ trunk/Source/WebKit2/ChangeLog	2017-03-09 00:43:31 UTC (rev 213609)
@@ -1,3 +1,22 @@
+2017-03-08  Anders Carlsson  
+
+Clean up WebPaymentCoordinatorProxy
+https://bugs.webkit.org/show_bug.cgi?id=169393
+Part of rdar://problem/28880714.
+
+Reviewed by Beth Dakin.
+
+* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
+(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]):
+Move this to where it belongs.
+
+(WebKit::toPKPaymentSummaryItems):
+Add a new helper function.
+
+(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
+(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
+Use the new helper function.
+
 2017-03-08  Brent Fulgham  
 
 [Mac][WK2] Whitelist a local cache needed by CFNetwork


Modified: trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm (213608 => 213609)

--- trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm	2017-03-09 00:34:36 UTC (rev 213608)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm	2017-03-09 00:43:31 UTC (rev 213609)
@@ -122,17 +122,6 @@
 _webPaymentCoordinatorProxy->didAuthorizePayment(WebCore::Payment(payment));
 }
 
-- (void)paymentAuthorizationViewControllerDidFinish:(PKPaymentAuthorizationViewController *)controller
-{
-if (!_webPaymentCoordinatorProxy)
-return;
-
-if (!_didReachFinalState)
-_webPaymentCoordinatorProxy->didCancelPayment();
-
-_webPaymentCoordinatorProxy->hidePaymentUI();
-}
-
 static WebCore::PaymentRequest::ShippingMethod toShippingMethod(PKShippingMethod *shippingMethod)
 {
 ASSERT(shippingMethod);
@@ -183,6 +172,17 @@
 _webPaymentCoordinatorProxy->didSelectPaymentMethod(WebCore::PaymentMethod(paymentMethod));
 }
 
+- (void)paymentAuthorizationViewControllerDidFinish:(PKPaymentAuthorizationViewController *)controller
+{
+if (!_webPaymentCoordinatorProxy)
+return;
+
+if (!_didReachFinalState)
+_webPaymentCoordinatorProxy->didCancelPayment();
+
+_webPaymentCoordinatorProxy->hidePaymentUI();
+}
+
 @end
 
 // FIXME: Once rdar://problem/24420024 has been fixed, import PKPaymentRequest_Private.h instead.
@@ -274,6 +274,20 @@
 return [getPKPaymentSummaryItemClass() summaryItemWithLabel:lineItem.label amount:toDecimalNumber(lineItem.amount.value_or(0)).get() type:toPKPaymentSummaryItemType(lineItem.type)];
 }
 
+static RetainPtr toPKPaymentSummaryItems(const WebCore::PaymentRequest::TotalAndLineItems& totalAndLineItems)
+{
+auto paymentSummaryItems = adoptNS([[NSMutableArray alloc] init]);
+for (auto& lineItem : totalAndLineItems.lineItems) {
+if (auto summaryItem = toPKPaymentSummaryItem(lineItem))
+[paymentSummaryItems addObject:summaryItem.get()];
+}
+
+if (auto totalItem = toPKPaymentSummaryItem(totalAndLineItems.total))
+[paymentSummaryItems addObject:totalItem.get()];
+
+return paymentSummaryItems;
+}
+
 static PKMerchantCapability toPKMerchantCapabilities(const WebCore::PaymentRequest::MerchantCapabilities& merchantCapabilities)
 {
 PKMerchantCapability result = 0;
@@ -479,19 +493,9 @@
 
 auto status = update ? update->status : WebCore::PaymentAuthorizationStatus::Success;
 
-if (update) {
-auto paymentSummaryItems = adoptNS([[NSMutableArray alloc] init]);
-for (auto& lineItem : update->newTotalAndLineItems.lineItems) {
-if (auto summaryItem = toPKPaymentSummaryItem(lineItem))
-[paymentSummaryItems addObject:summaryItem.get()];
-}
+if (update)
+m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems = toPKPaymentSummaryItems(update->newTotalAndLineItems);
 
-if (auto totalItem = toPKPaymentSummaryItem(update->newTotalAndLineItems.total))
-

[webkit-changes] [213601] trunk/Source

2017-03-08 Thread andersca
Title: [213601] trunk/Source








Revision 213601
Author ander...@apple.com
Date 2017-03-08 14:56:22 -0800 (Wed, 08 Mar 2017)


Log Message
Simplify the PaymentCoordinator interface
https://bugs.webkit.org/show_bug.cgi?id=169382
Part of rdar://problem/28880714.

Reviewed by Tim Horton.

Source/WebCore:

Add four new structs: PaymentAuthorizationResult, PaymentMethodUpdate, ShippingContactUpdate and ShippingMethodUpdate.
Change the various PaymentCoordinator and PaymentCoordinatorClient functions to take these new objects instead of multiple parameters.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::completeShippingMethodSelection):
(WebCore::ApplePaySession::completeShippingContactSelection):
(WebCore::ApplePaySession::completePaymentMethodSelection):
(WebCore::ApplePaySession::completePayment):
(WebCore::ApplePaySession::didSelectShippingMethod):
(WebCore::ApplePaySession::didSelectShippingContact):
* Modules/applepay/PaymentAuthorizationStatus.h:
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::completeShippingMethodSelection):
(WebCore::PaymentCoordinator::completeShippingContactSelection):
(WebCore::PaymentCoordinator::completePaymentMethodSelection):
(WebCore::PaymentCoordinator::completePaymentSession):
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
* Modules/applepay/PaymentRequest.h:
* loader/EmptyClients.cpp:

Source/WebKit/mac:

Update for PaymentCoordinatorClient changes.

* WebCoreSupport/WebPaymentCoordinatorClient.h:
* WebCoreSupport/WebPaymentCoordinatorClient.mm:
(WebPaymentCoordinatorClient::completeShippingMethodSelection):
(WebPaymentCoordinatorClient::completeShippingContactSelection):
(WebPaymentCoordinatorClient::completePaymentMethodSelection):
(WebPaymentCoordinatorClient::completePaymentSession):

Source/WebKit2:

Send the new structs over the wire to the UI process and update the various proxy object to take them instead of
multiple parameters.

* Scripts/webkit/messages.py:
(headers_for_type):
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder::encode):
(IPC::ArgumentCoder::decode):
(IPC::ArgumentCoder::encode):
(IPC::ArgumentCoder::decode):
(IPC::ArgumentCoder::encode):
(IPC::ArgumentCoder::decode):
(IPC::ArgumentCoder::encode):
(IPC::ArgumentCoder::decode):
(IPC::ArgumentCoder::encode):
(IPC::ArgumentCoder::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::completeShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::completeShippingContactSelection):
(WebKit::WebPaymentCoordinatorProxy::completePaymentMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::completePaymentSession):
(WebKit::isValidEnum): Deleted.
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::completeShippingMethodSelection):
(WebKit::WebPaymentCoordinator::completeShippingContactSelection):
(WebKit::WebPaymentCoordinator::completePaymentMethodSelection):
(WebKit::WebPaymentCoordinator::completePaymentSession):
* WebProcess/ApplePay/WebPaymentCoordinator.h:

Source/WTF:

* wtf/EnumTraits.h:
Fix a build warning.

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/EnumTraits.h
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp
trunk/Source/WebCore/Modules/applepay/PaymentAuthorizationStatus.h
trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp
trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.h
trunk/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h
trunk/Source/WebCore/Modules/applepay/PaymentRequest.h
trunk/Source/WebCore/loader/EmptyClients.cpp
trunk/Source/WebKit/mac/ChangeLog
trunk/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.h
trunk/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm
trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Scripts/webkit/messages.py
trunk/Source/WebKit2/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm
trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h
trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp
trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h
trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in
trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm
trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.cpp
trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.h




Diff

[webkit-changes] [213597] trunk/Source/WebCore

2017-03-08 Thread andersca
Title: [213597] trunk/Source/WebCore








Revision 213597
Author ander...@apple.com
Date 2017-03-08 14:14:26 -0800 (Wed, 08 Mar 2017)


Log Message
Use the new code path when dragging web contents
https://bugs.webkit.org/show_bug.cgi?id=169298

Reviewed by Beth Dakin.

* editing/Editor.h:
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::writeSelection):
Add a new function that writes the selection to a writer object.

* page/DragController.cpp:
(WebCore::DragController::startDrag):
Use the new writeSelection if mustUseLegacyDragClient is false.

* platform/PasteboardWriterData.cpp:
(WebCore::PasteboardWriterData::WebContent::WebContent):
(WebCore::PasteboardWriterData::WebContent::~WebContent):
(WebCore::PasteboardWriterData::setWebContent):
* platform/PasteboardWriterData.h:
Add getters and setters.

* platform/mac/PasteboardWriter.mm:
(WebCore::toUTIUnlessAlreadyUTI):
Add a helper.

(WebCore::createPasteboardWriter):
Convert web content to pasteboard types.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/editing/Editor.h
trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm
trunk/Source/WebCore/page/DragController.cpp
trunk/Source/WebCore/platform/PasteboardWriterData.cpp
trunk/Source/WebCore/platform/PasteboardWriterData.h
trunk/Source/WebCore/platform/mac/PasteboardWriter.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (213596 => 213597)

--- trunk/Source/WebCore/ChangeLog	2017-03-08 22:10:45 UTC (rev 213596)
+++ trunk/Source/WebCore/ChangeLog	2017-03-08 22:14:26 UTC (rev 213597)
@@ -1,3 +1,33 @@
+2017-03-07  Anders Carlsson  
+
+Use the new code path when dragging web contents
+https://bugs.webkit.org/show_bug.cgi?id=169298
+
+Reviewed by Beth Dakin.
+
+* editing/Editor.h:
+* editing/cocoa/EditorCocoa.mm:
+(WebCore::Editor::writeSelection):
+Add a new function that writes the selection to a writer object.
+
+* page/DragController.cpp:
+(WebCore::DragController::startDrag):
+Use the new writeSelection if mustUseLegacyDragClient is false.
+
+* platform/PasteboardWriterData.cpp:
+(WebCore::PasteboardWriterData::WebContent::WebContent):
+(WebCore::PasteboardWriterData::WebContent::~WebContent):
+(WebCore::PasteboardWriterData::setWebContent):
+* platform/PasteboardWriterData.h:
+Add getters and setters.
+
+* platform/mac/PasteboardWriter.mm:
+(WebCore::toUTIUnlessAlreadyUTI):
+Add a helper.
+
+(WebCore::createPasteboardWriter):
+Convert web content to pasteboard types.
+
 2017-03-08  Dave Hyatt  
 
 CSS Multicolumn should not clip columns horizontally


Modified: trunk/Source/WebCore/editing/Editor.h (213596 => 213597)

--- trunk/Source/WebCore/editing/Editor.h	2017-03-08 22:10:45 UTC (rev 213596)
+++ trunk/Source/WebCore/editing/Editor.h	2017-03-08 22:14:26 UTC (rev 213597)
@@ -66,6 +66,7 @@
 class KeyboardEvent;
 class KillRing;
 class Pasteboard;
+class PasteboardWriterData;
 class SharedBuffer;
 class Font;
 class SpellCheckRequest;
@@ -469,6 +470,7 @@
 #if PLATFORM(COCOA) || PLATFORM(GTK)
 WEBCORE_EXPORT void writeSelectionToPasteboard(Pasteboard&);
 WEBCORE_EXPORT void writeImageToPasteboard(Pasteboard&, Element& imageElement, const URL&, const String& title);
+void writeSelection(PasteboardWriterData&);
 #endif
 
 #if ENABLE(TELEPHONE_NUMBER_DETECTION) && !PLATFORM(IOS)


Modified: trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm (213596 => 213597)

--- trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm	2017-03-08 22:10:45 UTC (rev 213596)
+++ trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm	2017-03-08 22:14:26 UTC (rev 213597)
@@ -171,6 +171,25 @@
 pasteboard.write(content);
 }
 
+void Editor::writeSelection(PasteboardWriterData& pasteboardWriterData)
+{
+NSAttributedString *attributedString = attributedStringFromRange(*selectedRange());
+
+PasteboardWriterData::WebContent webContent;
+webContent.canSmartCopyOrDelete = canSmartCopyOrDelete();
+webContent.dataInWebArchiveFormat = selectionInWebArchiveFormat();
+webContent.dataInRTFDFormat = attributedString.containsAttachments ? dataInRTFDFormat(attributedString) : nullptr;
+webContent.dataInRTFFormat = dataInRTFFormat(attributedString);
+// FIXME: Why don't we want this on iOS?
+#if PLATFORM(MAC)
+webContent.dataInHTMLFormat = selectionInHTMLFormat();
+#endif
+webContent.dataInStringFormat = stringSelectionForPasteboardWithImageAltText();
+client()->getClientPasteboardDataForRange(selectedRange().get(), webContent.clientTypes, webContent.clientData);
+
+pasteboardWriterData.setWebContent(WTFMove(webContent));
+}
+
 RefPtr Editor::selectionInWebArchiveFormat()
 {
 RefPtr archive = LegacyWebArchive::createFromSelection(&m_frame);


Modified: trunk/Source/WebCore/page/DragController.cpp (213596 => 213597)

--- trunk/Source/WebCore/page/DragController.cpp	2017-03-08 22:10:45 UTC (rev 2135

[webkit-changes] [213529] trunk/Tools

2017-03-07 Thread andersca
Title: [213529] trunk/Tools








Revision 213529
Author ander...@apple.com
Date 2017-03-07 11:27:51 -0800 (Tue, 07 Mar 2017)


Log Message
Rewrite the DRT Pasteboard implementation to use UTIs and WTF types
https://bugs.webkit.org/show_bug.cgi?id=169289

Reviewed by Tim Horton.

* DumpRenderTree/mac/DumpRenderTreePasteboard.mm:
(-[LocalPasteboard initWithName:]):
(-[LocalPasteboard name]):
(-[LocalPasteboard declareTypes:owner:]):
(isUTI):
(toUTI):
(-[LocalPasteboard addTypes:owner:]):
(-[LocalPasteboard changeCount]):
(-[LocalPasteboard types]):
(-[LocalPasteboard availableTypeFromArray:]):
(-[LocalPasteboard setData:forType:]):
(-[LocalPasteboard dataForType:]):
(-[LocalPasteboard writeObjects:]):
(-[LocalPasteboard dealloc]): Deleted.

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/DumpRenderTree/mac/DumpRenderTreePasteboard.mm




Diff

Modified: trunk/Tools/ChangeLog (213528 => 213529)

--- trunk/Tools/ChangeLog	2017-03-07 19:26:21 UTC (rev 213528)
+++ trunk/Tools/ChangeLog	2017-03-07 19:27:51 UTC (rev 213529)
@@ -1,3 +1,25 @@
+2017-03-07  Anders Carlsson  
+
+Rewrite the DRT Pasteboard implementation to use UTIs and WTF types
+https://bugs.webkit.org/show_bug.cgi?id=169289
+
+Reviewed by Tim Horton.
+
+* DumpRenderTree/mac/DumpRenderTreePasteboard.mm:
+(-[LocalPasteboard initWithName:]):
+(-[LocalPasteboard name]):
+(-[LocalPasteboard declareTypes:owner:]):
+(isUTI):
+(toUTI):
+(-[LocalPasteboard addTypes:owner:]):
+(-[LocalPasteboard changeCount]):
+(-[LocalPasteboard types]):
+(-[LocalPasteboard availableTypeFromArray:]):
+(-[LocalPasteboard setData:forType:]):
+(-[LocalPasteboard dataForType:]):
+(-[LocalPasteboard writeObjects:]):
+(-[LocalPasteboard dealloc]): Deleted.
+
 2017-03-07  Myles C. Maxfield  
 
 Add David Jonathan Ross to contributors.json


Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTreePasteboard.mm (213528 => 213529)

--- trunk/Tools/DumpRenderTree/mac/DumpRenderTreePasteboard.mm	2017-03-07 19:26:21 UTC (rev 213528)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTreePasteboard.mm	2017-03-07 19:27:51 UTC (rev 213529)
@@ -37,14 +37,16 @@
 
 #import 
 #import 
+#import 
+#import 
 #import 
 
 @interface LocalPasteboard : NSPasteboard {
-NSMutableArray *typesArray;
-NSMutableSet *typesSet;
-NSMutableDictionary *dataByType;
-NSInteger changeCount;
-NSString *pasteboardName;
+RetainPtr _pasteboardName;
+NSInteger _changeCount;
+
+ListHashSet, WTF::RetainPtrObjectHash> _types;
+HashMap, RetainPtr, WTF::RetainPtrObjectHash, WTF::RetainPtrObjectHashTraits> _data;
 }
 
 -(id)initWithName:(NSString *)name;
@@ -98,25 +100,15 @@
 self = [super init];
 if (!self)
 return nil;
-typesArray = [[NSMutableArray alloc] init];
-typesSet = [[NSMutableSet alloc] init];
-dataByType = [[NSMutableDictionary alloc] init];
-pasteboardName = [name copy];
+
+_pasteboardName = adoptNS([name copy]);
+
 return self;
 }
 
-- (void)dealloc
-{
-[typesArray release];
-[typesSet release];
-[dataByType release];
-[pasteboardName release];
-[super dealloc];
-}
-
 - (NSString *)name
 {
-return pasteboardName;
+return _pasteboardName.get();
 }
 
 - (void)releaseGlobally
@@ -125,68 +117,84 @@
 
 - (NSInteger)declareTypes:(NSArray *)newTypes owner:(id)newOwner
 {
-[typesArray removeAllObjects];
-[typesSet removeAllObjects];
-[dataByType removeAllObjects];
+_types.clear();
+_data.clear();
+
 return [self addTypes:newTypes owner:newOwner];
 }
 
+static bool isUTI(NSString *type)
+{
+return UTTypeIsDynamic((__bridge CFStringRef)type) || UTTypeIsDeclared((__bridge CFStringRef)type);
+}
+
+static RetainPtr toUTI(NSString *type)
+{
+if (isUTI(type)) {
+// This is already an UTI.
+return adoptNS([type copy]);
+}
+
+return adoptNS((__bridge NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassNSPboardType, (__bridge CFStringRef)type, nullptr));
+}
+
 - (NSInteger)addTypes:(NSArray *)newTypes owner:(id)newOwner
 {
-unsigned count = [newTypes count];
-unsigned i;
-for (i = 0; i < count; ++i) {
-NSString *type = [newTypes objectAtIndex:i];
-NSString *setType = [typesSet member:type];
-if (!setType) {
-setType = [type copy];
-[typesArray addObject:setType];
-[typesSet addObject:setType];
-[setType release];
-}
+for (NSString *type in newTypes) {
+_types.add(toUTI(type));
+
 if (newOwner && [newOwner respondsToSelector:@selector(pasteboard:provideDataForType:)])
-[newOwner pasteboard:self provideDataForType:setType];
+[newOwner pasteboard:self provideDataForType:type];
 }
-return ++changeCount;
+
+return ++_changeCount;
 }
 
 - (NSInteger)changeCount
 {
-return changeCoun

[webkit-changes] [212850] trunk/Source/WebKit2

2017-02-22 Thread andersca
Title: [212850] trunk/Source/WebKit2








Revision 212850
Author ander...@apple.com
Date 2017-02-22 13:49:54 -0800 (Wed, 22 Feb 2017)


Log Message
Crash if there's a mismatch between the WebKit used by the UI process and child processes respectively
https://bugs.webkit.org/show_bug.cgi?id=168739
Part of rdar://problem/30631411.

Reviewed by Geoffrey Garen.

If the UI process and web process for some reason end up using different versions of the WebKit framework, weird things happen
because the message format is different between versions. To avoid this, send along the WebKit bundle version from the UI process
in the XPC bootstrap message, check that it matches inside the XPC main functions. If there's a mismatch, crash.

* Shared/Cocoa/ChildProcessCocoa.mm:
(WebKit::ChildProcess::didReceiveInvalidMessage):
Fix parameters.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
(main):
Check for the bundle version and crash if it's not what we expect.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
Initialize the bundle version.

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::_WKSetCrashReportApplicationSpecificInformation):
Export this so we can call it from the XPC services without having to link WKSI.

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Shared/Cocoa/ChildProcessCocoa.mm
trunk/Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm
trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (212849 => 212850)

--- trunk/Source/WebKit2/ChangeLog	2017-02-22 21:33:10 UTC (rev 212849)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-22 21:49:54 UTC (rev 212850)
@@ -1,3 +1,31 @@
+2017-02-22  Anders Carlsson  
+
+Crash if there's a mismatch between the WebKit used by the UI process and child processes respectively
+https://bugs.webkit.org/show_bug.cgi?id=168739
+Part of rdar://problem/30631411.
+
+Reviewed by Geoffrey Garen.
+
+If the UI process and web process for some reason end up using different versions of the WebKit framework, weird things happen
+because the message format is different between versions. To avoid this, send along the WebKit bundle version from the UI process
+in the XPC bootstrap message, check that it matches inside the XPC main functions. If there's a mismatch, crash.
+
+* Shared/Cocoa/ChildProcessCocoa.mm:
+(WebKit::ChildProcess::didReceiveInvalidMessage):
+Fix parameters.
+
+* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
+(main):
+Check for the bundle version and crash if it's not what we expect.
+
+* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+(WebKit::ProcessLauncher::launchProcess):
+Initialize the bundle version.
+
+* WebProcess/cocoa/WebProcessCocoa.mm:
+(WebKit::_WKSetCrashReportApplicationSpecificInformation):
+Export this so we can call it from the XPC services without having to link WKSI.
+
 2017-02-22  Chris Dumez  
 
 [WK2] Call processDidBecomeUnresponsive delegate when a background process is unresponsive


Modified: trunk/Source/WebKit2/Shared/Cocoa/ChildProcessCocoa.mm (212849 => 212850)

--- trunk/Source/WebKit2/Shared/Cocoa/ChildProcessCocoa.mm	2017-02-22 21:33:10 UTC (rev 212849)
+++ trunk/Source/WebKit2/Shared/Cocoa/ChildProcessCocoa.mm	2017-02-22 21:49:54 UTC (rev 212850)
@@ -30,7 +30,7 @@
 
 namespace WebKit {
 
-void ChildProcess::didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageName, IPC::StringReference messageReceiverName)
+void ChildProcess::didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName)
 {
 WKSetCrashReportApplicationSpecificInformation((__bridge CFStringRef)[NSString stringWithFormat:@"Received invalid message: '%s::%s'", messageReceiverName.toString().data(), messageName.toString().data()]);
 CRASH();


Modified: trunk/Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm (212849 => 212850)

--- trunk/Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm	2017-02-22 21:33:10 UTC (rev 212849)
+++ trunk/Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm	2017-02-22 21:49:54 UTC (rev 212850)
@@ -30,6 +30,9 @@
 #import 
 #import 
 
+extern "C"
+void _WKSetCrashReportApplicationSpecificInformation(NSString *infoString);
+
 namespace WebKit {
 
 static void XPCServiceEventHandler(xpc_connection_t peer)
@@ -112,6 +115,18 @@
 #endif
 
 if (bootstrap) {
+#if PLATFORM(MAC)
+if (const char* webKitBundleVersion = xpc_dictionary_get_string(bootstrap.get(), "WebKitBundleVersion")) {
+CFBundleRef webKitBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebKit"));
+NSString *expe

[webkit-changes] [212739] trunk/Source/WebCore

2017-02-21 Thread andersca
Title: [212739] trunk/Source/WebCore








Revision 212739
Author ander...@apple.com
Date 2017-02-21 12:15:11 -0800 (Tue, 21 Feb 2017)


Log Message
Fix two failing WebKit legacy tests
https://bugs.webkit.org/show_bug.cgi?id=168667

Reviewed by Tim Horton.

Handle the NSPasteboardTypeString type.

* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::read):
(WebCore::addHTMLClipboardTypesForCocoaType):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/mac/PasteboardMac.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (212738 => 212739)

--- trunk/Source/WebCore/ChangeLog	2017-02-21 20:12:24 UTC (rev 212738)
+++ trunk/Source/WebCore/ChangeLog	2017-02-21 20:15:11 UTC (rev 212739)
@@ -1,3 +1,16 @@
+2017-02-21  Anders Carlsson  
+
+Fix two failing WebKit legacy tests
+https://bugs.webkit.org/show_bug.cgi?id=168667
+
+Reviewed by Tim Horton.
+
+Handle the NSPasteboardTypeString type.
+
+* platform/mac/PasteboardMac.mm:
+(WebCore::Pasteboard::read):
+(WebCore::addHTMLClipboardTypesForCocoaType):
+
 2017-02-21  Simon Fraser  
 
 Add Web Audio and Web MIDI to features.json.


Modified: trunk/Source/WebCore/platform/mac/PasteboardMac.mm (212738 => 212739)

--- trunk/Source/WebCore/platform/mac/PasteboardMac.mm	2017-02-21 20:12:24 UTC (rev 212738)
+++ trunk/Source/WebCore/platform/mac/PasteboardMac.mm	2017-02-21 20:15:11 UTC (rev 212739)
@@ -306,7 +306,13 @@
 
 Vector types;
 strategy.getTypes(types, m_pasteboardName);
-
+
+if (types.contains(String(NSPasteboardTypeString))) {
+text.text = strategy.stringForType(NSPasteboardTypeString, m_pasteboardName);
+text.isURL = false;
+return;
+}
+
 if (types.contains(String(NSStringPboardType))) {
 text.text = strategy.stringForType(NSStringPboardType, m_pasteboardName);
 text.isURL = false;
@@ -566,7 +572,7 @@
 static void addHTMLClipboardTypesForCocoaType(ListHashSet& resultTypes, const String& cocoaType, const String& pasteboardName)
 {
 // UTI may not do these right, so make sure we get the right, predictable result
-if (cocoaType == String(NSStringPboardType)) {
+if (cocoaType == String(NSStringPboardType) || cocoaType == String(NSPasteboardTypeString)) {
 resultTypes.add(ASCIILiteral("text/plain"));
 return;
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [212681] trunk

2017-02-20 Thread andersca
Title: [212681] trunk








Revision 212681
Author ander...@apple.com
Date 2017-02-20 16:08:34 -0800 (Mon, 20 Feb 2017)


Log Message
Use the new drag code path when dragging links
https://bugs.webkit.org/show_bug.cgi?id=168612

Reviewed by Tim Horton.

Source/WebCore:

* editing/Editor.cpp:
(WebCore::Editor::copyURL):
Use userVisibleString instead of fillInUserVisibleForm.

(WebCore::Editor::pasteboardWriterURL):
New function that returns a PasteboardWriterData::URL for a given URL + title.

* editing/Editor.h:
Add new members.

* editing/mac/EditorMac.mm:
(WebCore::Editor::userVisibleString):
(WebCore::Editor::fillInUserVisibleForm): Deleted.
Add a getter instead of a function that fills in a struct member.

* page/DragController.cpp:
(WebCore::DragController::startDrag):
Add the new DragItem code path when dragging links.

* platform/PasteboardWriterData.cpp:
(WebCore::PasteboardWriterData::isEmpty):
Check for m_url as well.

(WebCore::PasteboardWriterData::setURL):
Set m_url.

* platform/PasteboardWriterData.h:
Add new members.

* platform/mac/PasteboardWriter.mm:
(WebCore::toUTI):
New helper function that returns an UTI from a pasteboard type.

(WebCore::createPasteboardWriter):
Handle converting URLs to the various pasteboard types.

Tools:

If a type is not dynamic, just use the static UTI.

* DumpRenderTree/mac/DumpRenderTreePasteboard.mm:
(-[LocalPasteboard writeObjects:]):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/editing/Editor.cpp
trunk/Source/WebCore/editing/Editor.h
trunk/Source/WebCore/editing/mac/EditorMac.mm
trunk/Source/WebCore/page/DragController.cpp
trunk/Source/WebCore/platform/PasteboardWriterData.cpp
trunk/Source/WebCore/platform/PasteboardWriterData.h
trunk/Source/WebCore/platform/mac/PasteboardWriter.mm
trunk/Tools/ChangeLog
trunk/Tools/DumpRenderTree/mac/DumpRenderTreePasteboard.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (212680 => 212681)

--- trunk/Source/WebCore/ChangeLog	2017-02-21 00:04:38 UTC (rev 212680)
+++ trunk/Source/WebCore/ChangeLog	2017-02-21 00:08:34 UTC (rev 212681)
@@ -1,3 +1,46 @@
+2017-02-20  Anders Carlsson  
+
+Use the new drag code path when dragging links
+https://bugs.webkit.org/show_bug.cgi?id=168612
+
+Reviewed by Tim Horton.
+
+* editing/Editor.cpp:
+(WebCore::Editor::copyURL):
+Use userVisibleString instead of fillInUserVisibleForm.
+
+(WebCore::Editor::pasteboardWriterURL):
+New function that returns a PasteboardWriterData::URL for a given URL + title.
+
+* editing/Editor.h:
+Add new members.
+
+* editing/mac/EditorMac.mm:
+(WebCore::Editor::userVisibleString):
+(WebCore::Editor::fillInUserVisibleForm): Deleted.
+Add a getter instead of a function that fills in a struct member.
+
+* page/DragController.cpp:
+(WebCore::DragController::startDrag):
+Add the new DragItem code path when dragging links.
+
+* platform/PasteboardWriterData.cpp:
+(WebCore::PasteboardWriterData::isEmpty):
+Check for m_url as well.
+
+(WebCore::PasteboardWriterData::setURL):
+Set m_url.
+
+* platform/PasteboardWriterData.h:
+Add new members.
+
+* platform/mac/PasteboardWriter.mm:
+(WebCore::toUTI):
+New helper function that returns an UTI from a pasteboard type.
+
+(WebCore::createPasteboardWriter):
+Handle converting URLs to the various pasteboard types.
+
 2017-02-20  Wenson Hsieh  
 
 Add plumbing to the UI process for TextIndicatorData when computing the drag image


Modified: trunk/Source/WebCore/editing/Editor.cpp (212680 => 212681)

--- trunk/Source/WebCore/editing/Editor.cpp	2017-02-21 00:04:38 UTC (rev 212680)
+++ trunk/Source/WebCore/editing/Editor.cpp	2017-02-21 00:08:34 UTC (rev 212681)
@@ -1346,12 +1346,25 @@
 pasteboardURL.title = title;
 
 #if PLATFORM(MAC)
-fillInUserVisibleForm(pasteboardURL);
+pasteboardURL.userVisibleForm = userVisibleString(url);
 #endif
 
 pasteboard.write(pasteboardURL);
 }
 
+PasteboardWriterData::URL Editor::pasteboardWriterURL(const URL& url, const String& title)
+{
+PasteboardWriterData::URL result;
+
+result.url = ""
+result.title = title;
+#if PLATFORM(MAC)
+result.userVisibleForm = userVisibleString(url);
+#endif
+
+return result;
+}
+
 #if !PLATFORM(IOS)
 
 void Editor::copyImage(const HitTestResult& result)


Modified: trunk/Source/WebCore/editing/Editor.h (212680 => 212681)

--- trunk/Source/WebCore/editing/Editor.h	2017-02-21 00:04:38 UTC (rev 212680)
+++ trunk/Source/WebCore/editing/Editor.h	2017-02-21 00:08:34 UTC (rev 212681)
@@ -35,6 +35,7 @@
 #include "EditorInsertAction.h"
 #include "FindOptions.h"
 #include "FrameSelection.h"
+#include "PasteboardWriterData.h"
 #include "TextChecking.h"
 #include "TextEventInputType.h"
 #include "TextIteratorBehavior.h"
@@ -147,6 +148,7 @@
 
 WEBCORE_EXPORT void copyURL(const 

[webkit-changes] [212663] trunk

2017-02-20 Thread andersca
Title: [212663] trunk








Revision 212663
Author ander...@apple.com
Date 2017-02-20 11:32:56 -0800 (Mon, 20 Feb 2017)


Log Message
Add a new drag code path and use it for dragging plain text
https://bugs.webkit.org/show_bug.cgi?id=168534

Reviewed by Geoffrey Garen.

Source/WebCore:

The new code path is currently only used for plain text selection dragging.

* WebCore.xcodeproj/project.pbxproj:
* page/DragClient.h:
(WebCore::DragClient::useLegacyDragClient):
Add a new member function. This currently returns true everywhere except legacy WebKit on Mac.

(WebCore::DragClient::beginDrag):
Add new empty member function.

* page/DragController.cpp:
(WebCore::dragImageAnchorPointForSelectionDrag):
Helper function that returns the anchor point for a selection drag image.

(WebCore::DragController::startDrag):
If we can use the new code path, set up a drag item with an image and pasteboard data.

(WebCore::DragController::beginDrag):
New function that calls out to the client.

* page/DragController.h:
Add new members.

* platform/DragItem.h:
Add a new class - it's essentially a tuple of a drag image, an anchor point and the pasteboard data the item represents.

* platform/mac/PasteboardWriter.h:
Rename createPasteboardWriting to createPasteboardWriter.

* platform/mac/PasteboardWriter.mm:
(WebCore::createPasteboardWriter):
Use the UTI pasteboard type.

Source/WebKit/mac:

* WebCoreSupport/WebDragClient.h:
Add new members.

* WebCoreSupport/WebDragClient.mm:
(WebDragClient::useLegacyDragClient):
Return false here.

(WebDragClient::beginDrag):
New client member function. Create an NSDraggingItem and use it to begin a dragging session.

* WebView/WebHTMLView.mm:
(-[WebHTMLView draggingSession:sourceOperationMaskForDraggingContext:]):
Get the source operation mask from WebCore.

(-[WebHTMLView draggingSession:endedAtPoint:operation:]):
Send a fake mouse up event.

* WebView/WebHTMLViewInternal.h:
Declare that WebHTMLView conforms to NSDraggingSource.

Tools:

Update the testing infrastructure to handle NSDraggingSession.

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/mac/DumpRenderTreePasteboard.mm: Renamed from Tools/DumpRenderTree/mac/DumpRenderTreePasteboard.m.
(-[LocalPasteboard writeObjects:]):
Implement this in terms of the legacy pasteboard API.

* DumpRenderTree/mac/EventSendingController.mm:
(drt_WebHTMLView_beginDraggingSessionWithItemsEventSource):
(+[EventSendingController initialize]):
Swizzle the drag method instead of adding a delegate method (like the old code does).

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
trunk/Source/WebCore/page/DragClient.h
trunk/Source/WebCore/page/DragController.cpp
trunk/Source/WebCore/page/DragController.h
trunk/Source/WebCore/platform/mac/PasteboardWriter.h
trunk/Source/WebCore/platform/mac/PasteboardWriter.mm
trunk/Source/WebKit/mac/ChangeLog
trunk/Source/WebKit/mac/WebCoreSupport/WebDragClient.h
trunk/Source/WebKit/mac/WebCoreSupport/WebDragClient.mm
trunk/Source/WebKit/mac/WebView/WebHTMLView.mm
trunk/Source/WebKit/mac/WebView/WebHTMLViewInternal.h
trunk/Tools/ChangeLog
trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
trunk/Tools/DumpRenderTree/mac/EventSendingController.mm


Added Paths

trunk/Source/WebCore/platform/DragItem.h
trunk/Tools/DumpRenderTree/mac/DumpRenderTreePasteboard.mm


Removed Paths

trunk/Tools/DumpRenderTree/mac/DumpRenderTreePasteboard.m




Diff

Modified: trunk/Source/WebCore/ChangeLog (212662 => 212663)

--- trunk/Source/WebCore/ChangeLog	2017-02-20 19:14:51 UTC (rev 212662)
+++ trunk/Source/WebCore/ChangeLog	2017-02-20 19:32:56 UTC (rev 212663)
@@ -1,3 +1,43 @@
+2017-02-17  Anders Carlsson  
+
+Add a new drag code path and use it for dragging plain text
+https://bugs.webkit.org/show_bug.cgi?id=168534
+
+Reviewed by Geoffrey Garen.
+
+The new code path is currently only used for plain text selection dragging.
+
+* WebCore.xcodeproj/project.pbxproj:
+* page/DragClient.h:
+(WebCore::DragClient::useLegacyDragClient):
+Add a new member function. This currently returns true everywhere except legacy WebKit on Mac.
+
+(WebCore::DragClient::beginDrag):
+Add new empty member function.
+
+* page/DragController.cpp:
+(WebCore::dragImageAnchorPointForSelectionDrag):
+Helper function that returns the anchor point for a selection drag image.
+
+(WebCore::DragController::startDrag):
+If we can use the new code path, set up a drag item with an image and pasteboard data.
+
+(WebCore::DragController::beginDrag):
+New function that calls out to the client.
+
+* page/DragController.h:
+Add new members.
+
+* platform/DragItem.h:
+Add a new class - it's essentially a tuple of a drag image, an anchor point and the pasteboard data the item represents.
+
+* platform/mac/PasteboardWrit

[webkit-changes] [212563] trunk/Source/WebCore

2017-02-17 Thread andersca
Title: [212563] trunk/Source/WebCore








Revision 212563
Author ander...@apple.com
Date 2017-02-17 12:02:03 -0800 (Fri, 17 Feb 2017)


Log Message
Begin overhauling the pasteboard implementation
https://bugs.webkit.org/show_bug.cgi?id=168525

Reviewed by Tim Horton.

Add a new PasteboardWriterData object. This object will hold data that is going
to be written to the pasteboard at some point. Currently it only supports plain text.

Also add a Mac-only PasteboardWriter class which can convert a PasteboardWriterDataObject
into an object that conforms to NSPasteboardWriting.

The basic idea is that instead of doing a bunch of pasteboard operations,
we'll just package all the pasteboard data up into an object and ship it over to WebKit.

This code is currently unused but will be adopted by a new drag implementation (in an upcoming patch).

* WebCore.xcodeproj/project.pbxproj:
* platform/PasteboardWriterData.cpp: Added.
(WebCore::PasteboardWriterData::PasteboardWriterData):
(WebCore::PasteboardWriterData::~PasteboardWriterData):
(WebCore::PasteboardWriterData::isEmpty):
(WebCore::PasteboardWriterData::setPlainText):
* platform/PasteboardWriterData.h: Added.
* platform/mac/PasteboardWriter.h: Added.
* platform/mac/PasteboardWriter.mm: Added.
(WebCore::createPasteboardWriting):
* platform/spi/mac/NSPasteboardSPI.h: Added.

Modified Paths

trunk/Source/WebCore/CMakeLists.txt
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj


Added Paths

trunk/Source/WebCore/platform/PasteboardWriterData.cpp
trunk/Source/WebCore/platform/PasteboardWriterData.h
trunk/Source/WebCore/platform/mac/PasteboardWriter.h
trunk/Source/WebCore/platform/mac/PasteboardWriter.mm
trunk/Source/WebCore/platform/spi/mac/NSPasteboardSPI.h




Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (212562 => 212563)

--- trunk/Source/WebCore/CMakeLists.txt	2017-02-17 19:34:48 UTC (rev 212562)
+++ trunk/Source/WebCore/CMakeLists.txt	2017-02-17 20:02:03 UTC (rev 212563)
@@ -2093,6 +2093,7 @@
 platform/MainThreadSharedTimer.cpp
 platform/MemoryPressureHandler.cpp
 platform/NotImplemented.cpp
+platform/PasteboardWriterData.cpp
 platform/PlatformSpeechSynthesisUtterance.cpp
 platform/PlatformSpeechSynthesisVoice.cpp
 platform/PlatformSpeechSynthesizer.cpp


Modified: trunk/Source/WebCore/ChangeLog (212562 => 212563)

--- trunk/Source/WebCore/ChangeLog	2017-02-17 19:34:48 UTC (rev 212562)
+++ trunk/Source/WebCore/ChangeLog	2017-02-17 20:02:03 UTC (rev 212563)
@@ -1,3 +1,33 @@
+2017-02-17  Anders Carlsson  
+
+Begin overhauling the pasteboard implementation
+https://bugs.webkit.org/show_bug.cgi?id=168525
+
+Reviewed by Tim Horton.
+
+Add a new PasteboardWriterData object. This object will hold data that is going
+to be written to the pasteboard at some point. Currently it only supports plain text.
+
+Also add a Mac-only PasteboardWriter class which can convert a PasteboardWriterDataObject
+into an object that conforms to NSPasteboardWriting.
+
+The basic idea is that instead of doing a bunch of pasteboard operations,
+we'll just package all the pasteboard data up into an object and ship it over to WebKit.
+
+This code is currently unused but will be adopted by a new drag implementation (in an upcoming patch).
+
+* WebCore.xcodeproj/project.pbxproj:
+* platform/PasteboardWriterData.cpp: Added.
+(WebCore::PasteboardWriterData::PasteboardWriterData):
+(WebCore::PasteboardWriterData::~PasteboardWriterData):
+(WebCore::PasteboardWriterData::isEmpty):
+(WebCore::PasteboardWriterData::setPlainText):
+* platform/PasteboardWriterData.h: Added.
+* platform/mac/PasteboardWriter.h: Added.
+* platform/mac/PasteboardWriter.mm: Added.
+(WebCore::createPasteboardWriting):
+* platform/spi/mac/NSPasteboardSPI.h: Added.
+
 2017-02-17  Per Arne Vollan  
 
 Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text.


Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (212562 => 212563)

--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-02-17 19:34:48 UTC (rev 212562)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-02-17 20:02:03 UTC (rev 212563)
@@ -951,6 +951,10 @@
 		1AEF4E69170E174800AB2799 /* CachedSVGDocumentClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AEF4E68170E174800AB2799 /* CachedSVGDocumentClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1AF326790D78B9440068F0C4 /* EditorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AF326770D78B9440068F0C4 /* EditorClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1AF4CEEC18BC3C1B00BC2D34 /* VisitedLinkStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AF4CEEB18BC3C1B00BC2D34 /* VisitedLinkStore.cpp */; };
+		1AF5E4D41E56735B004A1F01 /* PasteboardWriterData.cpp in Sources */ = {isa = 

[webkit-changes] [212485] trunk/Source/WebCore

2017-02-16 Thread andersca
Title: [212485] trunk/Source/WebCore








Revision 212485
Author ander...@apple.com
Date 2017-02-16 16:33:00 -0800 (Thu, 16 Feb 2017)


Log Message
Build fixes.

* page/gtk/EventHandlerGtk.cpp:
(WebCore::EventHandler::createDraggingDataTransfer):
* page/win/EventHandlerWin.cpp:
(WebCore::EventHandler::createDraggingDataTransfer):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/gtk/EventHandlerGtk.cpp
trunk/Source/WebCore/page/win/EventHandlerWin.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (212484 => 212485)

--- trunk/Source/WebCore/ChangeLog	2017-02-17 00:20:47 UTC (rev 212484)
+++ trunk/Source/WebCore/ChangeLog	2017-02-17 00:33:00 UTC (rev 212485)
@@ -1,5 +1,14 @@
 2017-02-16  Anders Carlsson  
 
+Build fixes.
+
+* page/gtk/EventHandlerGtk.cpp:
+(WebCore::EventHandler::createDraggingDataTransfer):
+* page/win/EventHandlerWin.cpp:
+(WebCore::EventHandler::createDraggingDataTransfer):
+
+2017-02-16  Anders Carlsson  
+
 Remove EFL from WebCore
 https://bugs.webkit.org/show_bug.cgi?id=168477
 


Modified: trunk/Source/WebCore/page/gtk/EventHandlerGtk.cpp (212484 => 212485)

--- trunk/Source/WebCore/page/gtk/EventHandlerGtk.cpp	2017-02-17 00:20:47 UTC (rev 212484)
+++ trunk/Source/WebCore/page/gtk/EventHandlerGtk.cpp	2017-02-17 00:33:00 UTC (rev 212485)
@@ -99,7 +99,7 @@
 
 Ref EventHandler::createDraggingDataTransfer() const
 {
-return DataTransfer::createForDragAndDrop();
+return DataTransfer::createForDrag();
 }
 
 #endif


Modified: trunk/Source/WebCore/page/win/EventHandlerWin.cpp (212484 => 212485)

--- trunk/Source/WebCore/page/win/EventHandlerWin.cpp	2017-02-17 00:20:47 UTC (rev 212484)
+++ trunk/Source/WebCore/page/win/EventHandlerWin.cpp	2017-02-17 00:33:00 UTC (rev 212485)
@@ -95,7 +95,7 @@
 
 Ref EventHandler::createDraggingDataTransfer() const
 {
-return DataTransfer::createForDragAndDrop();
+return DataTransfer::createForDrag();
 }
 
 #endif






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [212484] trunk/Source/WebCore

2017-02-16 Thread andersca
Title: [212484] trunk/Source/WebCore








Revision 212484
Author ander...@apple.com
Date 2017-02-16 16:20:47 -0800 (Thu, 16 Feb 2017)


Log Message
Remove EFL from WebCore
https://bugs.webkit.org/show_bug.cgi?id=168477

Reviewed by Brian Burg.

* accessibility/AccessibilityList.cpp:
(WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canSetValueAttribute):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::AccessibilityObject):
(WebCore::AccessibilityObject::textIteratorBehaviorForTextRange):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/AccessibilityTableColumn.cpp:
(WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored):
* accessibility/AccessibilityTableHeaderContainer.cpp:
(WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored):
* crypto/CryptoKey.cpp:
* crypto/keys/CryptoKeyRSA.h:
* dom/Document.cpp:
(WebCore::Document::implicitClose):
* editing/Editor.cpp:
(WebCore::Editor::performCutOrCopy):
(WebCore::Editor::copyImage):
* editing/Editor.h:
* editing/FrameSelection.h:
* html/HTMLCanvasElement.cpp:
(WebCore::requiresAcceleratedCompositingForWebGL):
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::port):
* loader/HistoryController.cpp:
(WebCore::HistoryController::restoreScrollPositionAndViewState):
* loader/icon/IconDatabase.cpp:
(WebCore::IconDatabase::performURLImport):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
(WebCore::ContextMenuController::populate):
(WebCore::ContextMenuController::checkOrEnableIfNeeded):
* page/DragController.cpp:
(WebCore::DragController::startDrag):
* page/EventHandler.cpp:
(WebCore::EventHandler::eventInvertsTabsToLinksClientCallResult):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
* platform/ContextMenuItem.h:
* platform/Cursor.h:
* platform/DragData.h:
* platform/DragImage.h:
* platform/FileSystem.h:
* platform/LocalizedStrings.h:
* platform/MIMETypeRegistry.cpp:
(WebCore::initializeSupportedImageMIMETypesForEncoding):
* platform/NotImplemented.h:
* platform/Pasteboard.h:
* platform/PlatformKeyboardEvent.h:
* platform/PlatformMouseEvent.h:
* platform/PlatformSpeechSynthesizer.h:
* platform/PlatformWheelEvent.h:
* platform/Widget.h:
* platform/graphics/ANGLEWebKitBridge.h:
* platform/graphics/BitmapImage.h:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/Icon.h:
* platform/graphics/Image.h:
(WebCore::Image::getEvasObject): Deleted.
* platform/graphics/IntPoint.h:
* platform/graphics/IntRect.h:
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::createVertexArrayOES):
(WebCore::Extensions3DOpenGL::deleteVertexArrayOES):
(WebCore::Extensions3DOpenGL::isVertexArrayOES):
(WebCore::Extensions3DOpenGL::bindVertexArrayOES):
(WebCore::Extensions3DOpenGL::supportsExtension):
* platform/graphics/opengl/Extensions3DOpenGL.h:
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::createForCurrentGLContext):
(WebCore::GraphicsContext3D::reshape):
(WebCore::GraphicsContext3D::createVertexArray):
(WebCore::GraphicsContext3D::deleteVertexArray):
(WebCore::GraphicsContext3D::isVertexArray):
(WebCore::GraphicsContext3D::bindVertexArray):
* platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
* platform/network/NetworkStateNotifier.h:
* platform/posix/FileSystemPOSIX.cpp:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::ensureRootLayer):
* rendering/RenderText.cpp:
(WebCore::RenderText::previousOffsetForBackwardDeletion):
* xml/XSLStyleSheetLibxslt.cpp:
* xml/XSLTExtensions.cpp:
* xml/XSLTProcessorLibxslt.cpp:
* xml/XSLTUnicodeSort.cpp:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/accessibility/AccessibilityList.cpp
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
trunk/Source/WebCore/accessibility/AccessibilityObject.h
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp
trunk/Source/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp
trunk/Source/WebCore/crypto/CryptoKey.cpp
trunk/Source/WebCore/crypto/keys/CryptoKeyRSA.h
trunk/Source/WebCore/dom/Document.cpp
trunk/Source/WebCore/editing/Editor.cpp
trunk/Source/WebCore/editing/Editor.h
trunk/Source/WebCore/editing/FrameSelection.h
trunk/Source/WebCore/html/HTMLCanvasElement.cpp
trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp
trunk/Source/WebCore/loader/HistoryController.cpp
trunk/Source/WebCore/loader/icon/IconDatabase.cpp
trunk/Source/WebCore/page/ContextMenuController.cpp
trunk/Source/WebCore/

[webkit-changes] [212481] trunk/Source/WebCore

2017-02-16 Thread andersca
Title: [212481] trunk/Source/WebCore








Revision 212481
Author ander...@apple.com
Date 2017-02-16 15:52:26 -0800 (Thu, 16 Feb 2017)


Log Message
Rename DataTransfer functions to indicate whether they are for dragging or dropping
https://bugs.webkit.org/show_bug.cgi?id=168478

Reviewed by Tim Horton.

* dom/DataTransfer.cpp:
(WebCore::DataTransfer::createForDrag):
(WebCore::DataTransfer::createForDrop):
(WebCore::DataTransfer::createForDragAndDrop): Deleted.
* dom/DataTransfer.h:
* page/DragController.cpp:
(WebCore::DragController::dragExited):
(WebCore::DragController::performDragOperation):
(WebCore::DragController::tryDHTMLDrag):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::createDraggingDataTransfer):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/DataTransfer.cpp
trunk/Source/WebCore/dom/DataTransfer.h
trunk/Source/WebCore/page/DragController.cpp
trunk/Source/WebCore/page/mac/EventHandlerMac.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (212480 => 212481)

--- trunk/Source/WebCore/ChangeLog	2017-02-16 23:48:50 UTC (rev 212480)
+++ trunk/Source/WebCore/ChangeLog	2017-02-16 23:52:26 UTC (rev 212481)
@@ -1,5 +1,24 @@
 2017-02-16  Anders Carlsson  
 
+Rename DataTransfer functions to indicate whether they are for dragging or dropping
+https://bugs.webkit.org/show_bug.cgi?id=168478
+
+Reviewed by Tim Horton.
+
+* dom/DataTransfer.cpp:
+(WebCore::DataTransfer::createForDrag):
+(WebCore::DataTransfer::createForDrop):
+(WebCore::DataTransfer::createForDragAndDrop): Deleted.
+* dom/DataTransfer.h:
+* page/DragController.cpp:
+(WebCore::DragController::dragExited):
+(WebCore::DragController::performDragOperation):
+(WebCore::DragController::tryDHTMLDrag):
+* page/mac/EventHandlerMac.mm:
+(WebCore::EventHandler::createDraggingDataTransfer):
+
+2017-02-16  Anders Carlsson  
+
 Rename EventHandler::freeDataTransfer to invalidateDataTransfer
 https://bugs.webkit.org/show_bug.cgi?id=168472
 


Modified: trunk/Source/WebCore/dom/DataTransfer.cpp (212480 => 212481)

--- trunk/Source/WebCore/dom/DataTransfer.cpp	2017-02-16 23:48:50 UTC (rev 212480)
+++ trunk/Source/WebCore/dom/DataTransfer.cpp	2017-02-16 23:52:26 UTC (rev 212481)
@@ -231,12 +231,12 @@
 
 #else
 
-Ref DataTransfer::createForDragAndDrop()
+Ref DataTransfer::createForDrag()
 {
 return adoptRef(*new DataTransfer(DataTransferAccessPolicy::Writable, Pasteboard::createForDragAndDrop(), DragAndDrop));
 }
 
-Ref DataTransfer::createForDragAndDrop(DataTransferAccessPolicy policy, const DragData& dragData)
+Ref DataTransfer::createForDrop(DataTransferAccessPolicy policy, const DragData& dragData)
 {
 return adoptRef(*new DataTransfer(policy, Pasteboard::createForDragAndDrop(dragData), DragAndDrop, dragData.containsFiles()));
 }


Modified: trunk/Source/WebCore/dom/DataTransfer.h (212480 => 212481)

--- trunk/Source/WebCore/dom/DataTransfer.h	2017-02-16 23:48:50 UTC (rev 212480)
+++ trunk/Source/WebCore/dom/DataTransfer.h	2017-02-16 23:52:26 UTC (rev 212481)
@@ -75,8 +75,8 @@
 Pasteboard& pasteboard() { return *m_pasteboard; }
 
 #if ENABLE(DRAG_SUPPORT)
-static Ref createForDragAndDrop();
-static Ref createForDragAndDrop(DataTransferAccessPolicy, const DragData&);
+static Ref createForDrag();
+static Ref createForDrop(DataTransferAccessPolicy, const DragData&);
 
 bool dropEffectIsUninitialized() const { return m_dropEffect == "uninitialized"; }
 


Modified: trunk/Source/WebCore/page/DragController.cpp (212480 => 212481)

--- trunk/Source/WebCore/page/DragController.cpp	2017-02-16 23:48:50 UTC (rev 212480)
+++ trunk/Source/WebCore/page/DragController.cpp	2017-02-16 23:52:26 UTC (rev 212481)
@@ -201,7 +201,7 @@
 #else
 DataTransferAccessPolicy policy = DataTransferAccessPolicy::TypesReadable;
 #endif
-auto dataTransfer = DataTransfer::createForDragAndDrop(policy, dragData);
+auto dataTransfer = DataTransfer::createForDrop(policy, dragData);
 dataTransfer->setSourceOperation(dragData.draggingSourceOperationMask());
 m_page.mainFrame().eventHandler().cancelDragAndDrop(createMouseEvent(dragData), dataTransfer);
 dataTransfer->setAccessPolicy(DataTransferAccessPolicy::Numb); // Invalidate dataTransfer here for security.
@@ -231,7 +231,7 @@
 bool preventedDefault = false;
 if (mainFrame->view()) {
 // Sending an event can result in the destruction of the view and part.
-auto dataTransfer = DataTransfer::createForDragAndDrop(DataTransferAccessPolicy::Readable, dragData);
+auto dataTransfer = DataTransfer::createForDrop(DataTransferAccessPolicy::Readable, dragData);
 dataTransfer->setSourceOperation(dragData.draggingSourceOperationMask());
 preventedDefault = mainFrame->eventHandler().performDragAndDrop(createMouseEvent(dragData), dataTransfer

[webkit-changes] [212476] trunk/Source/WebCore

2017-02-16 Thread andersca
Title: [212476] trunk/Source/WebCore








Revision 212476
Author ander...@apple.com
Date 2017-02-16 15:31:42 -0800 (Thu, 16 Feb 2017)


Log Message
Rename EventHandler::freeDataTransfer to invalidateDataTransfer
https://bugs.webkit.org/show_bug.cgi?id=168472

Reviewed by Tim Horton.

The code doesn't necessarily free the data transfer object, so rename the member function
to reflect that. Also, get rid of a goto.

* page/EventHandler.cpp:
(WebCore::EventHandler::invalidateDataTransfer):
(WebCore::EventHandler::dragSourceEndedAt):
(WebCore::EventHandler::handleDrag):
(WebCore::EventHandler::freeDataTransfer): Deleted.
* page/EventHandler.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/EventHandler.cpp
trunk/Source/WebCore/page/EventHandler.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (212475 => 212476)

--- trunk/Source/WebCore/ChangeLog	2017-02-16 23:26:53 UTC (rev 212475)
+++ trunk/Source/WebCore/ChangeLog	2017-02-16 23:31:42 UTC (rev 212476)
@@ -1,3 +1,20 @@
+2017-02-16  Anders Carlsson  
+
+Rename EventHandler::freeDataTransfer to invalidateDataTransfer
+https://bugs.webkit.org/show_bug.cgi?id=168472
+
+Reviewed by Tim Horton.
+
+The code doesn't necessarily free the data transfer object, so rename the member function
+to reflect that. Also, get rid of a goto.
+
+* page/EventHandler.cpp:
+(WebCore::EventHandler::invalidateDataTransfer):
+(WebCore::EventHandler::dragSourceEndedAt):
+(WebCore::EventHandler::handleDrag):
+(WebCore::EventHandler::freeDataTransfer): Deleted.
+* page/EventHandler.h:
+
 2017-02-16  Alex Christensen  
 
 Special URLs without a host are invalid


Modified: trunk/Source/WebCore/page/EventHandler.cpp (212475 => 212476)

--- trunk/Source/WebCore/page/EventHandler.cpp	2017-02-16 23:26:53 UTC (rev 212475)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2017-02-16 23:31:42 UTC (rev 212476)
@@ -3429,7 +3429,7 @@
 return mouseMovementExceedsThreshold(dragViewportLocation, threshold);
 }
 
-void EventHandler::freeDataTransfer()
+void EventHandler::invalidateDataTransfer()
 {
 if (!dragState().dataTransfer)
 return;
@@ -3448,7 +3448,7 @@
 // For now we don't care if event handler cancels default behavior, since there is no default behavior.
 dispatchDragSrcEvent(eventNames().dragendEvent, event);
 }
-freeDataTransfer();
+invalidateDataTransfer();
 dragState().source = nullptr;
 // In case the drag was ended due to an escape key press we need to ensure
 // that consecutive mousemove events don't reinitiate the drag and drop.
@@ -3564,7 +3564,7 @@
 DragOperation srcOp = DragOperationNone;  
 
 // This does work only if we missed a dragEnd. Do it anyway, just to make sure the old dataTransfer gets numbed.
-freeDataTransfer();
+invalidateDataTransfer();
 
 dragState().dataTransfer = createDraggingDataTransfer();
 
@@ -3580,7 +3580,10 @@
 // The renderer has disappeared, this can happen if the onStartDrag handler has hidden
 // the element in some way.  In this case we just kill the drag.
 m_mouseDownMayStartDrag = false;
-goto cleanupDrag;
+invalidateDataTransfer();
+dragState().source = nullptr;
+
+return true;
 }
 } 
 
@@ -3618,10 +3621,9 @@
 }
 } 
 
-cleanupDrag:
 if (!m_mouseDownMayStartDrag) {
 // Something failed to start the drag, clean up.
-freeDataTransfer();
+invalidateDataTransfer();
 dragState().source = nullptr;
 }
 


Modified: trunk/Source/WebCore/page/EventHandler.h (212475 => 212476)

--- trunk/Source/WebCore/page/EventHandler.h	2017-02-16 23:26:53 UTC (rev 212475)
+++ trunk/Source/WebCore/page/EventHandler.h	2017-02-16 23:31:42 UTC (rev 212476)
@@ -391,9 +391,8 @@
 
 #if ENABLE(DRAG_SUPPORT)
 bool dispatchDragEvent(const AtomicString& eventType, Element& target, const PlatformMouseEvent&, DataTransfer*);
+void invalidateDataTransfer();
 
-void freeDataTransfer();
-
 bool handleDrag(const MouseEventWithHitTestResults&, CheckDragHysteresis);
 #endif
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [212464] trunk/Source/JavaScriptCore

2017-02-16 Thread andersca
Title: [212464] trunk/Source/_javascript_Core








Revision 212464
Author ander...@apple.com
Date 2017-02-16 14:28:54 -0800 (Thu, 16 Feb 2017)


Log Message
Remove EFL from _javascript_Core
https://bugs.webkit.org/show_bug.cgi?id=168459

Reviewed by Geoffrey Garen.

* heap/GCActivityCallback.cpp:
(JSC::GCActivityCallback::GCActivityCallback):
(JSC::GCActivityCallback::cancelTimer):
(JSC::GCActivityCallback::didAllocate):
* heap/GCActivityCallback.h:
* heap/HeapTimer.cpp:
(JSC::HeapTimer::add): Deleted.
(JSC::HeapTimer::stop): Deleted.
(JSC::HeapTimer::timerEvent): Deleted.
* heap/HeapTimer.h:
* inspector/EventLoop.cpp:
(Inspector::EventLoop::cycle):
* jsc.cpp:
(main):
* tools/CodeProfiling.cpp:
(JSC::CodeProfiling::begin):
(JSC::CodeProfiling::end):

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/heap/GCActivityCallback.cpp
trunk/Source/_javascript_Core/heap/GCActivityCallback.h
trunk/Source/_javascript_Core/heap/HeapTimer.cpp
trunk/Source/_javascript_Core/heap/HeapTimer.h
trunk/Source/_javascript_Core/inspector/EventLoop.cpp
trunk/Source/_javascript_Core/jsc.cpp
trunk/Source/_javascript_Core/tools/CodeProfiling.cpp




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (212463 => 212464)

--- trunk/Source/_javascript_Core/ChangeLog	2017-02-16 22:04:32 UTC (rev 212463)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-02-16 22:28:54 UTC (rev 212464)
@@ -1,3 +1,28 @@
+2017-02-16  Anders Carlsson  
+
+Remove EFL from _javascript_Core
+https://bugs.webkit.org/show_bug.cgi?id=168459
+
+Reviewed by Geoffrey Garen.
+
+* heap/GCActivityCallback.cpp:
+(JSC::GCActivityCallback::GCActivityCallback):
+(JSC::GCActivityCallback::cancelTimer):
+(JSC::GCActivityCallback::didAllocate):
+* heap/GCActivityCallback.h:
+* heap/HeapTimer.cpp:
+(JSC::HeapTimer::add): Deleted.
+(JSC::HeapTimer::stop): Deleted.
+(JSC::HeapTimer::timerEvent): Deleted.
+* heap/HeapTimer.h:
+* inspector/EventLoop.cpp:
+(Inspector::EventLoop::cycle):
+* jsc.cpp:
+(main):
+* tools/CodeProfiling.cpp:
+(JSC::CodeProfiling::begin):
+(JSC::CodeProfiling::end):
+
 2017-02-15  Brian Burg  
 
 [Cocoa] Web Inspector: Inspector::fromProtocolString should return std::optional


Modified: trunk/Source/_javascript_Core/heap/GCActivityCallback.cpp (212463 => 212464)

--- trunk/Source/_javascript_Core/heap/GCActivityCallback.cpp	2017-02-16 22:04:32 UTC (rev 212463)
+++ trunk/Source/_javascript_Core/heap/GCActivityCallback.cpp	2017-02-16 22:28:54 UTC (rev 212464)
@@ -34,9 +34,7 @@
 #include "JSObject.h"
 #include "VM.h"
 
-#if PLATFORM(EFL)
-#include 
-#elif USE(GLIB)
+#if USE(GLIB)
 #include 
 #endif
 
@@ -53,11 +51,6 @@
 : GCActivityCallback(heap->vm())
 {
 }
-#elif PLATFORM(EFL)
-GCActivityCallback::GCActivityCallback(Heap* heap)
-: GCActivityCallback(heap->vm(), WTF::isMainThread())
-{
-}
 #elif USE(GLIB)
 GCActivityCallback::GCActivityCallback(Heap* heap)
 : GCActivityCallback(heap->vm())
@@ -97,24 +90,6 @@
 m_nextFireTime = 0;
 CFRunLoopTimerSetNextFireDate(m_timer.get(), CFAbsoluteTimeGetCurrent() + s_decade);
 }
-#elif PLATFORM(EFL)
-void GCActivityCallback::scheduleTimer(double newDelay)
-{
-if (newDelay * timerSlop > m_delay)
-return;
-
-stop();
-m_delay = newDelay;
-
-ASSERT(!m_timer);
-m_timer = add(newDelay, this);
-}
-
-void GCActivityCallback::cancelTimer()
-{
-m_delay = s_hour;
-stop();
-}
 #elif USE(GLIB)
 void GCActivityCallback::scheduleTimer(double newDelay)
 {
@@ -149,13 +124,6 @@
 
 void GCActivityCallback::didAllocate(size_t bytes)
 {
-#if PLATFORM(EFL)
-if (!isEnabled())
-return;
-
-ASSERT(WTF::isMainThread());
-#endif
-
 // The first byte allocated in an allocation cycle will report 0 bytes to didAllocate. 
 // We pretend it's one byte so that we don't ignore this allocation entirely.
 if (!bytes)


Modified: trunk/Source/_javascript_Core/heap/GCActivityCallback.h (212463 => 212464)

--- trunk/Source/_javascript_Core/heap/GCActivityCallback.h	2017-02-16 22:04:32 UTC (rev 212463)
+++ trunk/Source/_javascript_Core/heap/GCActivityCallback.h	2017-02-16 22:28:54 UTC (rev 212464)
@@ -75,14 +75,6 @@
 , m_delay(s_decade)
 {
 }
-#elif PLATFORM(EFL)
-static constexpr double s_hour = 3600;
-GCActivityCallback(VM* vm, bool flag)
-: HeapTimer(vm)
-, m_enabled(flag)
-, m_delay(s_hour)
-{
-}
 #elif USE(GLIB)
 GCActivityCallback(VM* vm)
 : HeapTimer(vm)


Modified: trunk/Source/_javascript_Core/heap/HeapTimer.cpp (212463 => 212464)

--- trunk/Source/_javascript_Core/heap/HeapTimer.cpp	2017-02-16 22:04:32 UTC (rev 212463)
+++ trunk/Source/_javascript_Core/heap/HeapTimer.cpp	2017-02-16 22:28:54 UTC (rev 212464)
@@ -34,9 +34,7 @@
 #include 
 #include 
 
-#if PLATFORM(EFL)
-#include 
-#elif USE(GLI

[webkit-changes] [212461] trunk/Source/WTF

2017-02-16 Thread andersca
Title: [212461] trunk/Source/WTF








Revision 212461
Author ander...@apple.com
Date 2017-02-16 13:23:33 -0800 (Thu, 16 Feb 2017)


Log Message
Remove EFL from WTF
https://bugs.webkit.org/show_bug.cgi?id=168452

Reviewed by Alex Christensen.

* wtf/CurrentTime.cpp:
* wtf/DisallowCType.h:
* wtf/FeatureDefines.h:
* wtf/MainThread.cpp:
* wtf/MainThread.h:
* wtf/Platform.h:
* wtf/RunLoop.h:
* wtf/WorkQueue.h:
* wtf/efl/DispatchQueueEfl.cpp: Removed.
* wtf/efl/DispatchQueueEfl.h: Removed.
* wtf/efl/DispatchQueueWorkItemEfl.h: Removed.
* wtf/efl/EflTypedefs.h: Removed.
* wtf/efl/MainThreadEfl.cpp: Removed.
* wtf/efl/RunLoopEfl.cpp: Removed.
* wtf/efl/UniquePtrEfl.h: Removed.
* wtf/efl/WorkQueueEfl.cpp: Removed.

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/CurrentTime.cpp
trunk/Source/WTF/wtf/DisallowCType.h
trunk/Source/WTF/wtf/FeatureDefines.h
trunk/Source/WTF/wtf/MainThread.cpp
trunk/Source/WTF/wtf/MainThread.h
trunk/Source/WTF/wtf/Platform.h
trunk/Source/WTF/wtf/RunLoop.h
trunk/Source/WTF/wtf/WorkQueue.h


Removed Paths

trunk/Source/WTF/wtf/efl/




Diff

Modified: trunk/Source/WTF/ChangeLog (212460 => 212461)

--- trunk/Source/WTF/ChangeLog	2017-02-16 21:10:29 UTC (rev 212460)
+++ trunk/Source/WTF/ChangeLog	2017-02-16 21:23:33 UTC (rev 212461)
@@ -1,3 +1,27 @@
+2017-02-16  Anders Carlsson  
+
+Remove EFL from WTF
+https://bugs.webkit.org/show_bug.cgi?id=168452
+
+Reviewed by Alex Christensen.
+
+* wtf/CurrentTime.cpp:
+* wtf/DisallowCType.h:
+* wtf/FeatureDefines.h:
+* wtf/MainThread.cpp:
+* wtf/MainThread.h:
+* wtf/Platform.h:
+* wtf/RunLoop.h:
+* wtf/WorkQueue.h:
+* wtf/efl/DispatchQueueEfl.cpp: Removed.
+* wtf/efl/DispatchQueueEfl.h: Removed.
+* wtf/efl/DispatchQueueWorkItemEfl.h: Removed.
+* wtf/efl/EflTypedefs.h: Removed.
+* wtf/efl/MainThreadEfl.cpp: Removed.
+* wtf/efl/RunLoopEfl.cpp: Removed.
+* wtf/efl/UniquePtrEfl.h: Removed.
+* wtf/efl/WorkQueueEfl.cpp: Removed.
+
 2017-02-13  Alex Christensen  
 
 URLs with an invalid IPv4 address should be invalid


Modified: trunk/Source/WTF/wtf/CurrentTime.cpp (212460 => 212461)

--- trunk/Source/WTF/wtf/CurrentTime.cpp	2017-02-16 21:10:29 UTC (rev 212460)
+++ trunk/Source/WTF/wtf/CurrentTime.cpp	2017-02-16 21:23:33 UTC (rev 212461)
@@ -52,14 +52,11 @@
 #include 
 #include 
 #include 
-
-#elif PLATFORM(EFL)
-#include 
 #else
 #include 
 #endif
 
-#if USE(GLIB) && !PLATFORM(EFL)
+#if USE(GLIB)
 #include 
 #endif
 
@@ -222,7 +219,7 @@
 
 #endif // USE(QUERY_PERFORMANCE_COUNTER)
 
-#elif USE(GLIB) && !PLATFORM(EFL)
+#elif USE(GLIB)
 
 // Note: GTK on Windows will pick up the PLATFORM(WIN) implementation above which provides
 // better accuracy compared with Windows implementation of g_get_current_time:
@@ -235,13 +232,6 @@
 return static_cast(now.tv_sec) + static_cast(now.tv_usec / 100.0);
 }
 
-#elif PLATFORM(EFL)
-
-double currentTime()
-{
-return ecore_time_unix_get();
-}
-
 #else
 
 double currentTime()
@@ -253,17 +243,10 @@
 
 #endif
 
-#if PLATFORM(EFL)
+#if USE(GLIB)
 
 double monotonicallyIncreasingTime()
 {
-return ecore_time_get();
-}
-
-#elif USE(GLIB)
-
-double monotonicallyIncreasingTime()
-{
 return static_cast(g_get_monotonic_time() / 100.0);
 }
 


Modified: trunk/Source/WTF/wtf/DisallowCType.h (212460 => 212461)

--- trunk/Source/WTF/wtf/DisallowCType.h	2017-02-16 21:10:29 UTC (rev 212460)
+++ trunk/Source/WTF/wtf/DisallowCType.h	2017-02-16 21:23:33 UTC (rev 212461)
@@ -40,7 +40,7 @@
 // are used from wx headers. On GTK+ for Mac many GTK+ files include 
 // or , which in turn include  which uses
 // isacii(). 
-#if !(OS(DARWIN) && PLATFORM(GTK)) && !PLATFORM(EFL) && !defined(_LIBCPP_VERSION) && defined(__GLIBC__)
+#if !(OS(DARWIN) && PLATFORM(GTK)) && !defined(_LIBCPP_VERSION) && defined(__GLIBC__)
 
 #include 
 


Modified: trunk/Source/WTF/wtf/FeatureDefines.h (212460 => 212461)

--- trunk/Source/WTF/wtf/FeatureDefines.h	2017-02-16 21:10:29 UTC (rev 212460)
+++ trunk/Source/WTF/wtf/FeatureDefines.h	2017-02-16 21:23:33 UTC (rev 212461)
@@ -322,10 +322,6 @@
 
 #endif /* PLATFORM(WIN_CAIRO) */
 
-/* - EFL port (Unix) - */
-#if PLATFORM(EFL)
-#endif /* PLATFORM(EFL) */
-
 /* - Gtk port (Unix, Windows, Mac) - */
 #if PLATFORM(GTK)
 #if !defined(ENABLE_KEYBOARD_KEY_ATTRIBUTE)


Modified: trunk/Source/WTF/wtf/MainThread.cpp (212460 => 212461)

--- trunk/Source/WTF/wtf/MainThread.cpp	2017-02-16 21:10:29 UTC (rev 212460)
+++ trunk/Source/WTF/wtf/MainThread.cpp	2017-02-16 21:23:33 UTC (rev 212461)
@@ -41,7 +41,7 @@
 namespace WTF {
 
 static bool callbacksPaused; // This global variable is only accessed from main thread.
-#if !OS(DARWIN) || PLATFORM(EFL) || PLATFORM(GTK)
+#if !OS(DARWIN) || PLATFORM(GTK)
 static ThreadIdentifier mainThreadIdentifier;
 #endif
 
@@ -53,7 +53,7 @@
 return functionQueue;
 }
 
-#if !OS(

[webkit-changes] [212457] trunk/Source/WebCore

2017-02-16 Thread andersca
Title: [212457] trunk/Source/WebCore








Revision 212457
Author ander...@apple.com
Date 2017-02-16 12:09:04 -0800 (Thu, 16 Feb 2017)


Log Message
Set the DHTML drag image in the DHTML type check
https://bugs.webkit.org/show_bug.cgi?id=168451

Reviewed by Wenson Hsieh.

* page/DragController.cpp:
(WebCore::DragController::startDrag):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/DragController.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (212456 => 212457)

--- trunk/Source/WebCore/ChangeLog	2017-02-16 20:08:56 UTC (rev 212456)
+++ trunk/Source/WebCore/ChangeLog	2017-02-16 20:09:04 UTC (rev 212457)
@@ -1,5 +1,15 @@
 2017-02-16  Anders Carlsson  
 
+Set the DHTML drag image in the DHTML type check
+https://bugs.webkit.org/show_bug.cgi?id=168451
+
+Reviewed by Wenson Hsieh.
+
+* page/DragController.cpp:
+(WebCore::DragController::startDrag):
+
+2017-02-16  Anders Carlsson  
+
 Begin removing EFL code from WebCore.
 
 Rubber-stamped by Alex Christensen.


Modified: trunk/Source/WebCore/page/DragController.cpp (212456 => 212457)

--- trunk/Source/WebCore/page/DragController.cpp	2017-02-16 20:08:56 UTC (rev 212456)
+++ trunk/Source/WebCore/page/DragController.cpp	2017-02-16 20:09:04 UTC (rev 212457)
@@ -798,19 +798,21 @@
 ASSERT(state.dataTransfer);
 
 DataTransfer& dataTransfer = *state.dataTransfer;
-if (state.type == DragSourceActionDHTML)
+if (state.type == DragSourceActionDHTML) {
 dragImage = DragImage { dataTransfer.createDragImage(dragImageOffset) };
-if (state.type == DragSourceActionSelection || !imageURL.isEmpty() || !linkURL.isEmpty())
+// We allow DHTML/JS to set the drag image, even if its a link, image or text we're dragging.
+// This is in the spirit of the IE API, which allows overriding of pasteboard data and DragOp.
+if (dragImage) {
+dragLoc = dragLocForDHTMLDrag(mouseDraggedPoint, dragOrigin, dragImageOffset, !linkURL.isEmpty());
+m_dragOffset = dragImageOffset;
+}
+}
+
+if (state.type == DragSourceActionSelection || !imageURL.isEmpty() || !linkURL.isEmpty()) {
 // Selection, image, and link drags receive a default set of allowed drag operations that
 // follows from:
 // http://trac.webkit.org/browser/trunk/WebKit/mac/WebView/WebHTMLView.mm?rev=48526#L3430
 m_sourceDragOperation = static_cast(m_sourceDragOperation | DragOperationGeneric | DragOperationCopy);
-
-// We allow DHTML/JS to set the drag image, even if its a link, image or text we're dragging.
-// This is in the spirit of the IE API, which allows overriding of pasteboard data and DragOp.
-if (dragImage) {
-dragLoc = dragLocForDHTMLDrag(mouseDraggedPoint, dragOrigin, dragImageOffset, !linkURL.isEmpty());
-m_dragOffset = dragImageOffset;
 }
 
 ASSERT(state.source);






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [212408] trunk/Source/WebKit2

2017-02-15 Thread andersca
Title: [212408] trunk/Source/WebKit2








Revision 212408
Author ander...@apple.com
Date 2017-02-15 15:49:42 -0800 (Wed, 15 Feb 2017)


Log Message
Try again.

* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
(WebKit::WebDragClient::startDrag):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp




Diff

Modified: trunk/Source/WebKit2/ChangeLog (212407 => 212408)

--- trunk/Source/WebKit2/ChangeLog	2017-02-15 23:45:33 UTC (rev 212407)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-15 23:49:42 UTC (rev 212408)
@@ -1,5 +1,12 @@
 2017-02-15  Anders Carlsson  
 
+Try again.
+
+* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
+(WebKit::WebDragClient::startDrag):
+
+2017-02-15  Anders Carlsson  
+
 Attempt to fix the GTK+ build.
 
 * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:


Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp (212407 => 212408)

--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp	2017-02-15 23:45:33 UTC (rev 212407)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp	2017-02-15 23:49:42 UTC (rev 212408)
@@ -56,7 +56,7 @@
 return bitmap;
 }
 
-void WebDragClient::startDrag(DragImagef dragImage, const IntPoint& clientPosition, const IntPoint& globalPosition, const FloatPoint&, DataTransfer& dataTransfer, Frame&, DragSourceAction)
+void WebDragClient::startDrag(DragImage dragImage, const IntPoint& clientPosition, const IntPoint& globalPosition, const FloatPoint&, DataTransfer& dataTransfer, Frame&, DragSourceAction)
 {
 RefPtr bitmap = convertCairoSurfaceToShareableBitmap(dragImage.get().get());
 ShareableBitmap::Handle handle;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [212407] trunk/Source/WebKit/win

2017-02-15 Thread andersca
Title: [212407] trunk/Source/WebKit/win








Revision 212407
Author ander...@apple.com
Date 2017-02-15 15:45:33 -0800 (Wed, 15 Feb 2017)


Log Message
Another attempt at fixing the Windows build.

* WebCoreSupport/WebDragClient.cpp:
(WebDragClient::startDrag):

Modified Paths

trunk/Source/WebKit/win/ChangeLog
trunk/Source/WebKit/win/WebCoreSupport/WebDragClient.cpp




Diff

Modified: trunk/Source/WebKit/win/ChangeLog (212406 => 212407)

--- trunk/Source/WebKit/win/ChangeLog	2017-02-15 23:43:19 UTC (rev 212406)
+++ trunk/Source/WebKit/win/ChangeLog	2017-02-15 23:45:33 UTC (rev 212407)
@@ -1,5 +1,12 @@
 2017-02-15  Anders Carlsson  
 
+Another attempt at fixing the Windows build.
+
+* WebCoreSupport/WebDragClient.cpp:
+(WebDragClient::startDrag):
+
+2017-02-15  Anders Carlsson  
+
 Try to fix the Windows build.
 
 * WebCoreSupport/WebDragClient.h:


Modified: trunk/Source/WebKit/win/WebCoreSupport/WebDragClient.cpp (212406 => 212407)

--- trunk/Source/WebKit/win/WebCoreSupport/WebDragClient.cpp	2017-02-15 23:43:19 UTC (rev 212406)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebDragClient.cpp	2017-02-15 23:45:33 UTC (rev 212407)
@@ -134,7 +134,7 @@
 sdi.sizeDragImage.cx = b.bmWidth;
 sdi.sizeDragImage.cy = b.bmHeight;
 sdi.crColorKey = 0x;
-sdi.hbmpDragImage = image;
+sdi.hbmpDragImage = image.get();
 sdi.ptOffset.x = dragPoint.x() - imageOrigin.x();
 sdi.ptOffset.y = dragPoint.y() - imageOrigin.y();
 if (dragSourceAction == DragSourceActionLink)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [212406] trunk/Source/WebKit2

2017-02-15 Thread andersca
Title: [212406] trunk/Source/WebKit2








Revision 212406
Author ander...@apple.com
Date 2017-02-15 15:43:19 -0800 (Wed, 15 Feb 2017)


Log Message
Attempt to fix the GTK+ build.

* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
(WebKit::WebDragClient::startDrag):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp




Diff

Modified: trunk/Source/WebKit2/ChangeLog (212405 => 212406)

--- trunk/Source/WebKit2/ChangeLog	2017-02-15 23:38:18 UTC (rev 212405)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-15 23:43:19 UTC (rev 212406)
@@ -1,3 +1,10 @@
+2017-02-15  Anders Carlsson  
+
+Attempt to fix the GTK+ build.
+
+* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
+(WebKit::WebDragClient::startDrag):
+
 2017-02-15  Simon Fraser  
 
 Clean up WebProcessCreationParameters a little


Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp (212405 => 212406)

--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp	2017-02-15 23:38:18 UTC (rev 212405)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp	2017-02-15 23:43:19 UTC (rev 212406)
@@ -56,9 +56,9 @@
 return bitmap;
 }
 
-void WebDragClient::startDrag(DragImageRef dragImage, const IntPoint& clientPosition, const IntPoint& globalPosition, const FloatPoint&, DataTransfer& dataTransfer, Frame&, bool)
+void WebDragClient::startDrag(DragImagef dragImage, const IntPoint& clientPosition, const IntPoint& globalPosition, const FloatPoint&, DataTransfer& dataTransfer, Frame&, DragSourceAction)
 {
-RefPtr bitmap = convertCairoSurfaceToShareableBitmap(dragImage.get());
+RefPtr bitmap = convertCairoSurfaceToShareableBitmap(dragImage.get().get());
 ShareableBitmap::Handle handle;
 
 // If we have a bitmap, but cannot create a handle to it, we fail early.






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [212390] trunk/Source/WebKit/win

2017-02-15 Thread andersca
Title: [212390] trunk/Source/WebKit/win








Revision 212390
Author ander...@apple.com
Date 2017-02-15 12:49:42 -0800 (Wed, 15 Feb 2017)


Log Message
Try to fix the Windows build.

* WebCoreSupport/WebDragClient.h:

Modified Paths

trunk/Source/WebKit/win/ChangeLog
trunk/Source/WebKit/win/WebCoreSupport/WebDragClient.h




Diff

Modified: trunk/Source/WebKit/win/ChangeLog (212389 => 212390)

--- trunk/Source/WebKit/win/ChangeLog	2017-02-15 20:10:50 UTC (rev 212389)
+++ trunk/Source/WebKit/win/ChangeLog	2017-02-15 20:49:42 UTC (rev 212390)
@@ -1,5 +1,11 @@
 2017-02-15  Anders Carlsson  
 
+Try to fix the Windows build.
+
+* WebCoreSupport/WebDragClient.h:
+
+2017-02-15  Anders Carlsson  
+
 Modernize DragClient::startDrag somewhat
 https://bugs.webkit.org/show_bug.cgi?id=168379
 


Modified: trunk/Source/WebKit/win/WebCoreSupport/WebDragClient.h (212389 => 212390)

--- trunk/Source/WebKit/win/WebCoreSupport/WebDragClient.h	2017-02-15 20:10:50 UTC (rev 212389)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebDragClient.h	2017-02-15 20:49:42 UTC (rev 212390)
@@ -39,7 +39,7 @@
 virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint&);
 virtual void willPerformDragDestinationAction(WebCore::DragDestinationAction, const WebCore::DragData&);
 virtual void willPerformDragSourceAction(WebCore::DragSourceAction, const WebCore::IntPoint&, WebCore::DataTransfer&);
-virtual void startDrag(WebCore::DragImageRef, const WebCore::IntPoint&, const WebCore::IntPoint&, const WebCore::FloatPoint&, WebCore::DataTransfer&, WebCore::Frame&, bool);
+virtual void startDrag(WebCore::DragImage, const WebCore::IntPoint&, const WebCore::IntPoint&, const WebCore::FloatPoint&, WebCore::DataTransfer&, WebCore::Frame&, WebCore::DragSourceAction);
 
 private:
 WebView* m_webView;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [212380] trunk/Source/WebCore

2017-02-15 Thread andersca
Title: [212380] trunk/Source/WebCore








Revision 212380
Author ander...@apple.com
Date 2017-02-15 10:45:10 -0800 (Wed, 15 Feb 2017)


Log Message
Fix build.

* page/DragController.cpp:
(WebCore::DragController::doSystemDrag):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/DragController.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (212379 => 212380)

--- trunk/Source/WebCore/ChangeLog	2017-02-15 18:31:00 UTC (rev 212379)
+++ trunk/Source/WebCore/ChangeLog	2017-02-15 18:45:10 UTC (rev 212380)
@@ -1,5 +1,12 @@
 2017-02-15  Anders Carlsson  
 
+Fix build.
+
+* page/DragController.cpp:
+(WebCore::DragController::doSystemDrag):
+
+2017-02-15  Anders Carlsson  
+
 Modernize DragClient::startDrag somewhat
 https://bugs.webkit.org/show_bug.cgi?id=168379
 


Modified: trunk/Source/WebCore/page/DragController.cpp (212379 => 212380)

--- trunk/Source/WebCore/page/DragController.cpp	2017-02-15 18:31:00 UTC (rev 212379)
+++ trunk/Source/WebCore/page/DragController.cpp	2017-02-15 18:45:10 UTC (rev 212380)
@@ -1008,7 +1008,7 @@
 void DragController::doSystemDrag(DragImage image, const IntPoint& dragLoc, const IntPoint& eventPos, const IntRect& dragImageBounds, DataTransfer& dataTransfer, Frame& frame, DragSourceAction dragSourceAction)
 {
 FloatPoint dragImageAnchor = { 0.5, 0.5 };
-if (forLink)
+if (dragSourceAction == DragSourceActionLink)
 dragImageAnchor.setY(1);
 else if (!dragImageBounds.isEmpty()) {
 dragImageAnchor.setX((eventPos.x() - dragImageBounds.x()) / (float)dragImageBounds.width());






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [212379] trunk/Source

2017-02-15 Thread andersca
Title: [212379] trunk/Source








Revision 212379
Author ander...@apple.com
Date 2017-02-15 10:31:00 -0800 (Wed, 15 Feb 2017)


Log Message
Modernize DragClient::startDrag somewhat
https://bugs.webkit.org/show_bug.cgi?id=168379

Reviewed by Tim Horton.

Source/WebCore:

Change DragClient::startDrag to take a DragImage instead of a DragImageRef, and to pass along the source action
instead of whether it's a link or not.

* loader/EmptyClients.cpp:
* page/DragClient.h:
* page/DragController.cpp:
(WebCore::DragController::startDrag):
(WebCore::DragController::doImageDrag):
(WebCore::DragController::doSystemDrag):
* page/DragController.h:

Source/WebKit/mac:

Update for WebCore changes.

* WebCoreSupport/WebDragClient.h:
* WebCoreSupport/WebDragClient.mm:
(WebDragClient::startDrag):

Source/WebKit/win:

Update for WebCore changes.

* WebCoreSupport/WebDragClient.cpp:
(WebDragClient::startDrag):

Source/WebKit2:

Update for WebCore changes.

* WebProcess/WebCoreSupport/WebDragClient.cpp:
(WebKit::WebDragClient::startDrag):
* WebProcess/WebCoreSupport/WebDragClient.h:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::startDrag):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/loader/EmptyClients.cpp
trunk/Source/WebCore/page/DragClient.h
trunk/Source/WebCore/page/DragController.cpp
trunk/Source/WebCore/page/DragController.h
trunk/Source/WebKit/mac/ChangeLog
trunk/Source/WebKit/mac/WebCoreSupport/WebDragClient.h
trunk/Source/WebKit/mac/WebCoreSupport/WebDragClient.mm
trunk/Source/WebKit/win/ChangeLog
trunk/Source/WebKit/win/WebCoreSupport/WebDragClient.cpp
trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.cpp
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.h
trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (212378 => 212379)

--- trunk/Source/WebCore/ChangeLog	2017-02-15 18:23:33 UTC (rev 212378)
+++ trunk/Source/WebCore/ChangeLog	2017-02-15 18:31:00 UTC (rev 212379)
@@ -1,3 +1,21 @@
+2017-02-15  Anders Carlsson  
+
+Modernize DragClient::startDrag somewhat
+https://bugs.webkit.org/show_bug.cgi?id=168379
+
+Reviewed by Tim Horton.
+
+Change DragClient::startDrag to take a DragImage instead of a DragImageRef, and to pass along the source action
+instead of whether it's a link or not.
+
+* loader/EmptyClients.cpp:
+* page/DragClient.h:
+* page/DragController.cpp:
+(WebCore::DragController::startDrag):
+(WebCore::DragController::doImageDrag):
+(WebCore::DragController::doSystemDrag):
+* page/DragController.h:
+
 2017-02-15  Chris Dumez  
 
 Expose Symbol.toPrimitive / valueOf on Location instances


Modified: trunk/Source/WebCore/loader/EmptyClients.cpp (212378 => 212379)

--- trunk/Source/WebCore/loader/EmptyClients.cpp	2017-02-15 18:23:33 UTC (rev 212378)
+++ trunk/Source/WebCore/loader/EmptyClients.cpp	2017-02-15 18:31:00 UTC (rev 212379)
@@ -131,7 +131,7 @@
 void willPerformDragSourceAction(DragSourceAction, const IntPoint&, DataTransfer&) final { }
 DragDestinationAction actionMaskForDrag(const DragData&) final { return DragDestinationActionNone; }
 DragSourceAction dragSourceActionMaskForPoint(const IntPoint&) final { return DragSourceActionNone; }
-void startDrag(DragImageRef, const IntPoint&, const IntPoint&, const FloatPoint&, DataTransfer&, Frame&, bool) final { }
+void startDrag(DragImage, const IntPoint&, const IntPoint&, const FloatPoint&, DataTransfer&, Frame&, DragSourceAction) final { }
 void dragControllerDestroyed() final { }
 };
 


Modified: trunk/Source/WebCore/page/DragClient.h (212378 => 212379)

--- trunk/Source/WebCore/page/DragClient.h	2017-02-15 18:23:33 UTC (rev 212378)
+++ trunk/Source/WebCore/page/DragClient.h	2017-02-15 18:31:00 UTC (rev 212379)
@@ -47,7 +47,7 @@
 virtual DragDestinationAction actionMaskForDrag(const DragData&) = 0;
 virtual DragSourceAction dragSourceActionMaskForPoint(const IntPoint& rootViewPoint) = 0;
 
-virtual void startDrag(DragImageRef, const IntPoint& dragImageOrigin, const IntPoint& eventPos, const FloatPoint& dragImageAnchor, DataTransfer&, Frame&, bool linkDrag = false) = 0;
+virtual void startDrag(DragImage, const IntPoint& dragImageOrigin, const IntPoint& eventPos, const FloatPoint& dragImageAnchor, DataTransfer&, Frame&, DragSourceAction) = 0;
 virtual void dragEnded() { }
 
 #if PLATFORM(COCOA)


Modified: trunk/Source/WebCore/page/DragController.cpp (212378 => 212379)

--- trunk/Source/WebCore/page/DragController.cpp	2017-02-15 18:23:33 UTC (rev 212378)
+++ trunk/Source/WebCore/page/DragController.cpp	2017-02-15 18:31:00 UTC (rev 212379)
@@ -857,7 +857,7 @@
 if (!dragImage)
 return false;
 
-doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, dragImageBounds, dataTransfer, src, false);
+doSy

[webkit-changes] [212320] trunk/Source/WebKit/mac

2017-02-14 Thread andersca
Title: [212320] trunk/Source/WebKit/mac








Revision 212320
Author ander...@apple.com
Date 2017-02-14 13:08:46 -0800 (Tue, 14 Feb 2017)


Log Message
Remove an unused delegate method
https://bugs.webkit.org/show_bug.cgi?id=168328

Reviewed by Wenson Hsieh.

* DefaultDelegates/WebDefaultUIDelegate.m:
(-[WebDefaultUIDelegate webView:shouldBeginDragForElement:dragImage:mouseDownEvent:mouseDraggedEvent:]): Deleted.

Modified Paths

trunk/Source/WebKit/mac/ChangeLog
trunk/Source/WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m




Diff

Modified: trunk/Source/WebKit/mac/ChangeLog (212319 => 212320)

--- trunk/Source/WebKit/mac/ChangeLog	2017-02-14 21:01:55 UTC (rev 212319)
+++ trunk/Source/WebKit/mac/ChangeLog	2017-02-14 21:08:46 UTC (rev 212320)
@@ -1,3 +1,13 @@
+2017-02-14  Anders Carlsson  
+
+Remove an unused delegate method
+https://bugs.webkit.org/show_bug.cgi?id=168328
+
+Reviewed by Wenson Hsieh.
+
+* DefaultDelegates/WebDefaultUIDelegate.m:
+(-[WebDefaultUIDelegate webView:shouldBeginDragForElement:dragImage:mouseDownEvent:mouseDraggedEvent:]): Deleted.
+
 2017-02-14  Alexey Proskuryakov  
 
 WebCore shouldn't export SystemMemory.h


Modified: trunk/Source/WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m (212319 => 212320)

--- trunk/Source/WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m	2017-02-14 21:01:55 UTC (rev 212319)
+++ trunk/Source/WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m	2017-02-14 21:08:46 UTC (rev 212320)
@@ -220,11 +220,6 @@
 
 
 #if !PLATFORM(IOS)
-- (BOOL)webView:(WebView *)webView shouldBeginDragForElement:(NSDictionary *)element dragImage:(NSImage *)dragImage mouseDownEvent:(NSEvent *)mouseDownEvent mouseDraggedEvent:(NSEvent *)mouseDraggedEvent
-{
-return YES;
-}
-
 - (NSUInteger)webView:(WebView *)webView dragDestinationActionMaskForDraggingInfo:(id )draggingInfo
 {
 return WebDragDestinationActionAny;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [212267] trunk/Source/WebCore

2017-02-13 Thread andersca
Title: [212267] trunk/Source/WebCore








Revision 212267
Author ander...@apple.com
Date 2017-02-13 17:44:31 -0800 (Mon, 13 Feb 2017)


Log Message
Simplify DragController::startDrag
https://bugs.webkit.org/show_bug.cgi?id=168240

Reviewed by Tim Horton.

Use early returns instead of assigning to a variable that's returned at the end of the function.

* page/DragController.cpp:
(WebCore::DragController::startDrag):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/DragController.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (212266 => 212267)

--- trunk/Source/WebCore/ChangeLog	2017-02-14 01:32:37 UTC (rev 212266)
+++ trunk/Source/WebCore/ChangeLog	2017-02-14 01:44:31 UTC (rev 212267)
@@ -1,3 +1,15 @@
+2017-02-13  Anders Carlsson  
+
+Simplify DragController::startDrag
+https://bugs.webkit.org/show_bug.cgi?id=168240
+
+Reviewed by Tim Horton.
+
+Use early returns instead of assigning to a variable that's returned at the end of the function.
+
+* page/DragController.cpp:
+(WebCore::DragController::startDrag):
+
 2017-02-13  Said Abou-Hallawa  
 
 The current frame of an image should not deleted if another frame is asynchronously being decoded


Modified: trunk/Source/WebCore/page/DragController.cpp (212266 => 212267)

--- trunk/Source/WebCore/page/DragController.cpp	2017-02-14 01:32:37 UTC (rev 212266)
+++ trunk/Source/WebCore/page/DragController.cpp	2017-02-14 01:44:31 UTC (rev 212267)
@@ -813,8 +813,6 @@
 m_dragOffset = dragImageOffset;
 }
 
-bool startedDrag = true; // optimism - we almost always manage to start the drag
-
 ASSERT(state.source);
 Element& element = *state.source;
 
@@ -823,7 +821,6 @@
 if (state.type == DragSourceActionSelection) {
 if (!dataTransfer.pasteboard().hasData()) {
 // FIXME: This entire block is almost identical to the code in Editor::copy, and the code should be shared.
-
 RefPtr selectionRange = src.selection().toNormalizedRange();
 ASSERT(selectionRange);
 
@@ -861,10 +858,15 @@
 return false;
 
 doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, dragImageBounds, dataTransfer, src, false);
-} else if (!src.document()->securityOrigin().canDisplay(linkURL)) {
+return true;
+}
+
+if (!src.document()->securityOrigin().canDisplay(linkURL)) {
 src.document()->addConsoleMessage(MessageSource::Security, MessageLevel::Error, "Not allowed to drag local resource: " + linkURL.stringCenterEllipsizedToLength());
-startedDrag = false;
-} else if (!imageURL.isEmpty() && image && !image->isNull() && (m_dragSourceAction & DragSourceActionImage)) {
+return false;
+}
+
+if (!imageURL.isEmpty() && image && !image->isNull() && (m_dragSourceAction & DragSourceActionImage)) {
 // We shouldn't be starting a drag for an image that can't provide an extension.
 // This is an early detection for problems encountered later upon drop.
 ASSERT(!image->filenameExtension().isEmpty());
@@ -885,7 +887,10 @@
 // DHTML defined drag image
 doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, { }, dataTransfer, src, false);
 }
-} else if (!linkURL.isEmpty() && (m_dragSourceAction & DragSourceActionLink)) {
+return true;
+}
+
+if (!linkURL.isEmpty() && (m_dragSourceAction & DragSourceActionLink)) {
 if (!dataTransfer.pasteboard().hasData()) {
 // Simplify whitespace so the title put on the dataTransfer resembles what the user sees
 // on the web page. This includes replacing newlines with spaces.
@@ -920,8 +925,12 @@
 dragImage = DragImage { scaleDragImage(dragImage.get(), FloatSize(m_page.deviceScaleFactor(), m_page.deviceScaleFactor())) };
 }
 doSystemDrag(WTFMove(dragImage), dragLoc, mouseDraggedPoint, { }, dataTransfer, src, true);
+
+return true;
+}
+
 #if ENABLE(ATTACHMENT_ELEMENT)
-} else if (!attachmentURL.isEmpty() && (m_dragSourceAction & DragSourceActionAttachment)) {
+if (!attachmentURL.isEmpty() && (m_dragSourceAction & DragSourceActionAttachment)) {
 if (!dataTransfer.pasteboard().hasData()) {
 m_draggingAttachmentURL = attachmentURL;
 selectElement(element);
@@ -936,21 +945,18 @@
 m_dragOffset = IntPoint(dragOrigin.x() - dragLoc.x(), dragOrigin.y() - dragLoc.y());
 }
 doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, { }, dataTransfer, src, false);
+return true;
+}
 #endif
-} else if (state.type == DragSourceActionDHTML) {
-if (dragImage) {
-ASSERT(m_dragSourceAction & DragSourceActionDHTML);
-m_client.willPerformDragSourceAction(DragSourceActionDHTML, dragOrigin, dataTransfer);
-doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, { }, dataTransfer, src, false);
-} else
-   

[webkit-changes] [212253] trunk/Source/WebCore

2017-02-13 Thread andersca
Title: [212253] trunk/Source/WebCore








Revision 212253
Author ander...@apple.com
Date 2017-02-13 15:07:44 -0800 (Mon, 13 Feb 2017)


Log Message
Fix iOS build.

* platform/ios/DragImageIOS.mm:
(WebCore::deleteDragImage):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/ios/DragImageIOS.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (212252 => 212253)

--- trunk/Source/WebCore/ChangeLog	2017-02-13 23:06:26 UTC (rev 212252)
+++ trunk/Source/WebCore/ChangeLog	2017-02-13 23:07:44 UTC (rev 212253)
@@ -1,3 +1,10 @@
+2017-02-13  Anders Carlsson  
+
+Fix iOS build.
+
+* platform/ios/DragImageIOS.mm:
+(WebCore::deleteDragImage):
+
 2017-02-13  Sam Weinig  
 
 Rename MediaQueryExp.h/cpp to MediaQueryExpression.h/cpp


Modified: trunk/Source/WebCore/platform/ios/DragImageIOS.mm (212252 => 212253)

--- trunk/Source/WebCore/platform/ios/DragImageIOS.mm	2017-02-13 23:06:26 UTC (rev 212252)
+++ trunk/Source/WebCore/platform/ios/DragImageIOS.mm	2017-02-13 23:07:44 UTC (rev 212253)
@@ -36,6 +36,12 @@
 
 namespace WebCore {
 
+void deleteDragImage(RetainPtr)
+{
+// Since this is a RetainPtr, there's nothing additional we need to do to
+// delete it. It will be released when it falls out of scope.
+}
+
 // FIXME: fix signature of dragImageSize() to avoid copying the argument.
 IntSize dragImageSize(RetainPtr image)
 {






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [212243] trunk/Source/WebCore

2017-02-13 Thread andersca
Title: [212243] trunk/Source/WebCore








Revision 212243
Author ander...@apple.com
Date 2017-02-13 13:11:36 -0800 (Mon, 13 Feb 2017)


Log Message
Fix Windows build.

* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::setDragImage):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/win/PasteboardWin.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (212242 => 212243)

--- trunk/Source/WebCore/ChangeLog	2017-02-13 21:05:57 UTC (rev 212242)
+++ trunk/Source/WebCore/ChangeLog	2017-02-13 21:11:36 UTC (rev 212243)
@@ -1,3 +1,10 @@
+2017-02-13  Anders Carlsson  
+
+Fix Windows build.
+
+* platform/win/PasteboardWin.cpp:
+(WebCore::Pasteboard::setDragImage):
+
 2017-02-13  Alex Christensen  
 
 Fix Yosemite build after r211765


Modified: trunk/Source/WebCore/platform/win/PasteboardWin.cpp (212242 => 212243)

--- trunk/Source/WebCore/platform/win/PasteboardWin.cpp	2017-02-13 21:05:57 UTC (rev 212242)
+++ trunk/Source/WebCore/platform/win/PasteboardWin.cpp	2017-02-13 21:11:36 UTC (rev 212243)
@@ -409,7 +409,7 @@
 }
 
 #if ENABLE(DRAG_SUPPORT)
-void Pasteboard::setDragImage(DragImageRef, const IntPoint&)
+void Pasteboard::setDragImage(DragImage, const IntPoint&)
 {
 // Do nothing in Windows.
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [212239] trunk/Source/WebCore

2017-02-13 Thread andersca
Title: [212239] trunk/Source/WebCore








Revision 212239
Author ander...@apple.com
Date 2017-02-13 12:31:24 -0800 (Mon, 13 Feb 2017)


Log Message
Add a DragImage class that wraps a DragImageRef
https://bugs.webkit.org/show_bug.cgi?id=168131

Reviewed by Beth Dakin.

This allows us to get rid of the explicit deleteDragImage calls and will make additional cleanup of the
various drag code paths possible. No functionality change.

* dom/DataTransfer.cpp:
(WebCore::DataTransfer::updateDragImage):
* page/DragController.cpp:
(WebCore::DragController::startDrag):
(WebCore::DragController::doImageDrag):
(WebCore::DragController::doSystemDrag):
* page/DragController.h:
* platform/DragImage.cpp:
(WebCore::DragImage::DragImage):
(WebCore::DragImage::operator=):
(WebCore::DragImage::~DragImage):
* platform/DragImage.h:
* platform/Pasteboard.h:
* platform/StaticPasteboard.h:
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::setDragImage):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/DataTransfer.cpp
trunk/Source/WebCore/page/DragController.cpp
trunk/Source/WebCore/page/DragController.h
trunk/Source/WebCore/platform/DragImage.cpp
trunk/Source/WebCore/platform/DragImage.h
trunk/Source/WebCore/platform/Pasteboard.h
trunk/Source/WebCore/platform/StaticPasteboard.h
trunk/Source/WebCore/platform/efl/PasteboardEfl.cpp
trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp
trunk/Source/WebCore/platform/mac/PasteboardMac.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (212238 => 212239)

--- trunk/Source/WebCore/ChangeLog	2017-02-13 20:19:21 UTC (rev 212238)
+++ trunk/Source/WebCore/ChangeLog	2017-02-13 20:31:24 UTC (rev 212239)
@@ -1,3 +1,30 @@
+2017-02-13  Anders Carlsson  
+
+Add a DragImage class that wraps a DragImageRef
+https://bugs.webkit.org/show_bug.cgi?id=168131
+
+Reviewed by Beth Dakin.
+
+This allows us to get rid of the explicit deleteDragImage calls and will make additional cleanup of the
+various drag code paths possible. No functionality change.
+
+* dom/DataTransfer.cpp:
+(WebCore::DataTransfer::updateDragImage):
+* page/DragController.cpp:
+(WebCore::DragController::startDrag):
+(WebCore::DragController::doImageDrag):
+(WebCore::DragController::doSystemDrag):
+* page/DragController.h:
+* platform/DragImage.cpp:
+(WebCore::DragImage::DragImage):
+(WebCore::DragImage::operator=):
+(WebCore::DragImage::~DragImage):
+* platform/DragImage.h:
+* platform/Pasteboard.h:
+* platform/StaticPasteboard.h:
+* platform/mac/PasteboardMac.mm:
+(WebCore::Pasteboard::setDragImage):
+
 2017-02-13  Chris Dumez  
 
 Regression(r211455): ASSERTION FAILED: frameView || pageCacheState() == InPageCache in com.apple.WebCore: WebCore::Document::destroyRenderTree


Modified: trunk/Source/WebCore/dom/DataTransfer.cpp (212238 => 212239)

--- trunk/Source/WebCore/dom/DataTransfer.cpp	2017-02-13 20:19:21 UTC (rev 212238)
+++ trunk/Source/WebCore/dom/DataTransfer.cpp	2017-02-13 20:31:24 UTC (rev 212239)
@@ -283,11 +283,11 @@
 return;
 
 IntPoint computedHotSpot;
-DragImageRef computedImage = createDragImage(computedHotSpot);
+auto computedImage = DragImage { createDragImage(computedHotSpot) };
 if (!computedImage)
 return;
 
-m_pasteboard->setDragImage(computedImage, computedHotSpot);
+m_pasteboard->setDragImage(WTFMove(computedImage), computedHotSpot);
 }
 
 #if !PLATFORM(MAC)


Modified: trunk/Source/WebCore/page/DragController.cpp (212238 => 212239)

--- trunk/Source/WebCore/page/DragController.cpp	2017-02-13 20:19:21 UTC (rev 212238)
+++ trunk/Source/WebCore/page/DragController.cpp	2017-02-13 20:31:24 UTC (rev 212239)
@@ -772,11 +772,13 @@
 else
 sourceContainsHitNode = state.source->containsIncludingShadowDOM(hitTestResult.innerNode());
 
-if (!sourceContainsHitNode)
+if (!sourceContainsHitNode) {
 // The original node being dragged isn't under the drag origin anymore... maybe it was
 // hidden or moved out from under the cursor. Regardless, we don't want to start a drag on
 // something that's not actually under the drag origin.
 return false;
+}
+
 URL linkURL = hitTestResult.absoluteLinkURL();
 URL imageURL = hitTestResult.absoluteImageURL();
 #if ENABLE(ATTACHMENT_ELEMENT)
@@ -789,7 +791,7 @@
 m_draggingImageURL = URL();
 m_sourceDragOperation = srcOp;
 
-DragImageRef dragImage = nullptr;
+DragImage dragImage;
 IntPoint dragLoc(0, 0);
 IntPoint dragImageOffset(0, 0);
 
@@ -797,7 +799,7 @@
 
 DataTransfer& dataTransfer = *state.dataTransfer;
 if (state.type == DragSourceActionDHTML)
-dragImage = dataTransfer.createDragImage(dragImageOffset);
+dragImage = DragImage { dataTransfer.createDragImage(dragImageOffset) };
 if (state.type == DragSourceActionSelection || !image

[webkit-changes] [212156] trunk/Source/WebCore

2017-02-10 Thread andersca
Title: [212156] trunk/Source/WebCore








Revision 212156
Author ander...@apple.com
Date 2017-02-10 15:41:35 -0800 (Fri, 10 Feb 2017)


Log Message
Try to fix the iOS and Windows builds.

* platform/ios/DragImageIOS.mm:
(WebCore::deleteDragImage):
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::setDragImage):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/ios/DragImageIOS.mm
trunk/Source/WebCore/platform/win/PasteboardWin.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (212155 => 212156)

--- trunk/Source/WebCore/ChangeLog	2017-02-10 23:14:39 UTC (rev 212155)
+++ trunk/Source/WebCore/ChangeLog	2017-02-10 23:41:35 UTC (rev 212156)
@@ -1,5 +1,14 @@
 2017-02-10  Anders Carlsson  
 
+Try to fix the iOS and Windows builds.
+
+* platform/ios/DragImageIOS.mm:
+(WebCore::deleteDragImage):
+* platform/win/PasteboardWin.cpp:
+(WebCore::Pasteboard::setDragImage):
+
+2017-02-10  Anders Carlsson  
+
 Add a DragImage class that wraps a DragImageRef
 https://bugs.webkit.org/show_bug.cgi?id=168131
 


Modified: trunk/Source/WebCore/platform/ios/DragImageIOS.mm (212155 => 212156)

--- trunk/Source/WebCore/platform/ios/DragImageIOS.mm	2017-02-10 23:14:39 UTC (rev 212155)
+++ trunk/Source/WebCore/platform/ios/DragImageIOS.mm	2017-02-10 23:41:35 UTC (rev 212156)
@@ -36,6 +36,12 @@
 
 namespace WebCore {
 
+void deleteDragImage(RetainPtr)
+{
+// Since this is a RetainPtr, there's nothing additional we need to do to
+// delete it. It will be released when it falls out of scope.
+}
+
 // FIXME: fix signature of dragImageSize() to avoid copying the argument.
 IntSize dragImageSize(RetainPtr image)
 {


Modified: trunk/Source/WebCore/platform/win/PasteboardWin.cpp (212155 => 212156)

--- trunk/Source/WebCore/platform/win/PasteboardWin.cpp	2017-02-10 23:14:39 UTC (rev 212155)
+++ trunk/Source/WebCore/platform/win/PasteboardWin.cpp	2017-02-10 23:41:35 UTC (rev 212156)
@@ -409,7 +409,7 @@
 }
 
 #if ENABLE(DRAG_SUPPORT)
-void Pasteboard::setDragImage(DragImageRef, const IntPoint&)
+void Pasteboard::setDragImage(DragImage, const IntPoint&)
 {
 // Do nothing in Windows.
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [212154] trunk/Source/WebCore

2017-02-10 Thread andersca
Title: [212154] trunk/Source/WebCore








Revision 212154
Author ander...@apple.com
Date 2017-02-10 15:09:45 -0800 (Fri, 10 Feb 2017)


Log Message
Add a DragImage class that wraps a DragImageRef
https://bugs.webkit.org/show_bug.cgi?id=168131

Reviewed by Beth Dakin.

This allows us to get rid of the explicit deleteDragImage calls and will make additional cleanup of the
various drag code paths possible. No functionality change.

* dom/DataTransfer.cpp:
(WebCore::DataTransfer::updateDragImage):
* page/DragController.cpp:
(WebCore::DragController::startDrag):
(WebCore::DragController::doImageDrag):
(WebCore::DragController::doSystemDrag):
* page/DragController.h:
* platform/DragImage.cpp:
(WebCore::DragImage::DragImage):
(WebCore::DragImage::operator=):
(WebCore::DragImage::~DragImage):
* platform/DragImage.h:
* platform/Pasteboard.h:
* platform/StaticPasteboard.h:
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::setDragImage):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/DataTransfer.cpp
trunk/Source/WebCore/page/DragController.cpp
trunk/Source/WebCore/page/DragController.h
trunk/Source/WebCore/platform/DragImage.cpp
trunk/Source/WebCore/platform/DragImage.h
trunk/Source/WebCore/platform/Pasteboard.h
trunk/Source/WebCore/platform/StaticPasteboard.h
trunk/Source/WebCore/platform/efl/PasteboardEfl.cpp
trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp
trunk/Source/WebCore/platform/mac/PasteboardMac.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (212153 => 212154)

--- trunk/Source/WebCore/ChangeLog	2017-02-10 23:02:36 UTC (rev 212153)
+++ trunk/Source/WebCore/ChangeLog	2017-02-10 23:09:45 UTC (rev 212154)
@@ -1,3 +1,30 @@
+2017-02-10  Anders Carlsson  
+
+Add a DragImage class that wraps a DragImageRef
+https://bugs.webkit.org/show_bug.cgi?id=168131
+
+Reviewed by Beth Dakin.
+
+This allows us to get rid of the explicit deleteDragImage calls and will make additional cleanup of the
+various drag code paths possible. No functionality change.
+
+* dom/DataTransfer.cpp:
+(WebCore::DataTransfer::updateDragImage):
+* page/DragController.cpp:
+(WebCore::DragController::startDrag):
+(WebCore::DragController::doImageDrag):
+(WebCore::DragController::doSystemDrag):
+* page/DragController.h:
+* platform/DragImage.cpp:
+(WebCore::DragImage::DragImage):
+(WebCore::DragImage::operator=):
+(WebCore::DragImage::~DragImage):
+* platform/DragImage.h:
+* platform/Pasteboard.h:
+* platform/StaticPasteboard.h:
+* platform/mac/PasteboardMac.mm:
+(WebCore::Pasteboard::setDragImage):
+
 2017-02-10  Simon Fraser  
 
 Make sure the "inwindow" flag propagates to TiledBackings for masks and reflections


Modified: trunk/Source/WebCore/dom/DataTransfer.cpp (212153 => 212154)

--- trunk/Source/WebCore/dom/DataTransfer.cpp	2017-02-10 23:02:36 UTC (rev 212153)
+++ trunk/Source/WebCore/dom/DataTransfer.cpp	2017-02-10 23:09:45 UTC (rev 212154)
@@ -283,11 +283,11 @@
 return;
 
 IntPoint computedHotSpot;
-DragImageRef computedImage = createDragImage(computedHotSpot);
+auto computedImage = DragImage { createDragImage(computedHotSpot) };
 if (!computedImage)
 return;
 
-m_pasteboard->setDragImage(computedImage, computedHotSpot);
+m_pasteboard->setDragImage(WTFMove(computedImage), computedHotSpot);
 }
 
 #if !PLATFORM(MAC)


Modified: trunk/Source/WebCore/page/DragController.cpp (212153 => 212154)

--- trunk/Source/WebCore/page/DragController.cpp	2017-02-10 23:02:36 UTC (rev 212153)
+++ trunk/Source/WebCore/page/DragController.cpp	2017-02-10 23:09:45 UTC (rev 212154)
@@ -772,11 +772,13 @@
 else
 sourceContainsHitNode = state.source->containsIncludingShadowDOM(hitTestResult.innerNode());
 
-if (!sourceContainsHitNode)
+if (!sourceContainsHitNode) {
 // The original node being dragged isn't under the drag origin anymore... maybe it was
 // hidden or moved out from under the cursor. Regardless, we don't want to start a drag on
 // something that's not actually under the drag origin.
 return false;
+}
+
 URL linkURL = hitTestResult.absoluteLinkURL();
 URL imageURL = hitTestResult.absoluteImageURL();
 #if ENABLE(ATTACHMENT_ELEMENT)
@@ -789,7 +791,7 @@
 m_draggingImageURL = URL();
 m_sourceDragOperation = srcOp;
 
-DragImageRef dragImage = nullptr;
+DragImage dragImage;
 IntPoint dragLoc(0, 0);
 IntPoint dragImageOffset(0, 0);
 
@@ -797,7 +799,7 @@
 
 DataTransfer& dataTransfer = *state.dataTransfer;
 if (state.type == DragSourceActionDHTML)
-dragImage = dataTransfer.createDragImage(dragImageOffset);
+dragImage = DragImage { dataTransfer.createDragImage(dragImageOffset) };
 if (state.type == DragSourceActionSelection || !imageURL.isEmpty() || !linkURL.isEmpty())
 // Selection

[webkit-changes] [211838] trunk/Source/WebKit2

2017-02-07 Thread andersca
Title: [211838] trunk/Source/WebKit2








Revision 211838
Author ander...@apple.com
Date 2017-02-07 14:09:03 -0800 (Tue, 07 Feb 2017)


Log Message
REGRESSION (r211819): [ios-simulator] API tests Coding.WKWebView and Coding.WKWebView_SameConfiguration crashing
https://bugs.webkit.org/show_bug.cgi?id=167947

Reviewed by Tim Horton.

* Platform/spi/ios/UIKitSPI.h:
Add SPI declaration.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
Make sure to call setDrawsBackground here.

(-[WKWebView _populateArchivedSubviews:]):
We don't want to archive the scroll view and the fixed overlay view.

(-[WKWebView setOpaque:]):
Return early if this is called before we have a page (like from -[UIView initWithCoder:]).

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (211837 => 211838)

--- trunk/Source/WebKit2/ChangeLog	2017-02-07 21:56:42 UTC (rev 211837)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-07 22:09:03 UTC (rev 211838)
@@ -1,3 +1,23 @@
+2017-02-07  Anders Carlsson  
+
+REGRESSION (r211819): [ios-simulator] API tests Coding.WKWebView and Coding.WKWebView_SameConfiguration crashing
+https://bugs.webkit.org/show_bug.cgi?id=167947
+
+Reviewed by Tim Horton.
+
+* Platform/spi/ios/UIKitSPI.h:
+Add SPI declaration.
+
+* UIProcess/API/Cocoa/WKWebView.mm:
+(-[WKWebView _initializeWithConfiguration:]):
+Make sure to call setDrawsBackground here.
+
+(-[WKWebView _populateArchivedSubviews:]):
+We don't want to archive the scroll view and the fixed overlay view.
+
+(-[WKWebView setOpaque:]):
+Return early if this is called before we have a page (like from -[UIView initWithCoder:]).
+
 2017-02-07  Alex Christensen  
 
 Revert r166597


Modified: trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h (211837 => 211838)

--- trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h	2017-02-07 21:56:42 UTC (rev 211837)
+++ trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h	2017-02-07 22:09:03 UTC (rev 211838)
@@ -448,6 +448,7 @@
 - (void)setFrameOrigin:(CGPoint)origin;
 - (void)setSize:(CGSize)size;
 @property (nonatomic, assign, setter=_setBackdropMaskViewFlags:) NSInteger _backdropMaskViewFlags;
+- (void)_populateArchivedSubviews:(NSMutableSet *)encodedViews;
 @end
 
 @interface UIWebSelectionView : UIView


Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (211837 => 211838)

--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2017-02-07 21:56:42 UTC (rev 211837)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2017-02-07 22:09:03 UTC (rev 211838)
@@ -503,6 +503,7 @@
 
 _page = [_contentView page];
 _page->setDeviceOrientation(deviceOrientation());
+_page->setDrawsBackground(self.opaque);
 
 [_contentView layer].anchorPoint = CGPointZero;
 [_contentView setFrame:bounds];
@@ -970,6 +971,16 @@
 
 #if PLATFORM(IOS)
 
+- (void)_populateArchivedSubviews:(NSMutableSet *)encodedViews
+{
+[super _populateArchivedSubviews:encodedViews];
+
+if (_scrollView)
+[encodedViews removeObject:_scrollView.get()];
+if (_customContentFixedOverlayView)
+[encodedViews removeObject:_customContentFixedOverlayView.get()];
+}
+
 - (BOOL)_isBackground
 {
 if ([self _isDisplayingPDF])
@@ -1823,6 +1834,9 @@
 if (oldOpaque == opaque)
 return;
 
+if (!_page)
+return;
+
 _page->setDrawsBackground(opaque);
 [self _updateScrollViewBackground];
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [211819] trunk/Source/WebKit2

2017-02-07 Thread andersca
Title: [211819] trunk/Source/WebKit2








Revision 211819
Author ander...@apple.com
Date 2017-02-07 10:42:01 -0800 (Tue, 07 Feb 2017)


Log Message
-[WKWebView encodeWithCoder:] needs to call super
https://bugs.webkit.org/show_bug.cgi?id=167945
rdar://problem/29777668

Reviewed by Geoffrey Garen.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView encodeWithCoder:]):
Call super.

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (211818 => 211819)

--- trunk/Source/WebKit2/ChangeLog	2017-02-07 18:24:49 UTC (rev 211818)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-07 18:42:01 UTC (rev 211819)
@@ -1,3 +1,15 @@
+2017-02-07  Anders Carlsson  
+
+-[WKWebView encodeWithCoder:] needs to call super
+https://bugs.webkit.org/show_bug.cgi?id=167945
+rdar://problem/29777668
+
+Reviewed by Geoffrey Garen.
+
+* UIProcess/API/Cocoa/WKWebView.mm:
+(-[WKWebView encodeWithCoder:]):
+Call super.
+
 2017-02-07  Carlos Garcia Campos  
 
 [Soup] WebKitSoupRequestInputStream can still leave requests unfinished after r211773


Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (211818 => 211819)

--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2017-02-07 18:24:49 UTC (rev 211818)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2017-02-07 18:42:01 UTC (rev 211819)
@@ -620,6 +620,8 @@
 
 - (void)encodeWithCoder:(NSCoder *)coder
 {
+[super encodeWithCoder:coder];
+
 [coder encodeObject:_configuration.get() forKey:@"configuration"];
 
 [coder encodeBool:self.allowsBackForwardNavigationGestures forKey:@"allowsBackForwardNavigationGestures"];






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [211747] trunk/Source/WebKit2

2017-02-06 Thread andersca
Title: [211747] trunk/Source/WebKit2








Revision 211747
Author ander...@apple.com
Date 2017-02-06 13:49:54 -0800 (Mon, 06 Feb 2017)


Log Message
Crash child processes if they receive an invalid message
https://bugs.webkit.org/show_bug.cgi?id=167900

Reviewed by Dan Bernstein.

Previously, some processes would try to gracefully exit, others would just drop messages leading to weird bugs.
Instead, set app-specific crash information to the message that failed to be decoded, and then crash.

* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::didReceiveInvalidMessage): Deleted.
* DatabaseProcess/DatabaseProcess.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::didReceiveInvalidMessage): Deleted.
* NetworkProcess/NetworkProcess.h:
* PluginProcess/PluginProcess.cpp:
(WebKit::PluginProcess::didReceiveInvalidMessage): Deleted.
* PluginProcess/PluginProcess.h:
* Shared/ChildProcess.h:
* Shared/Cocoa/ChildProcessCocoa.mm: Added.
(WebKit::ChildProcess::didReceiveInvalidMessage):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveInvalidMessage): Deleted.
* WebProcess/WebProcess.h:

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp
trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.h
trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp
trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h
trunk/Source/WebKit2/PluginProcess/PluginProcess.cpp
trunk/Source/WebKit2/PluginProcess/PluginProcess.h
trunk/Source/WebKit2/Shared/ChildProcess.cpp
trunk/Source/WebKit2/Shared/ChildProcess.h
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
trunk/Source/WebKit2/WebProcess/WebProcess.cpp
trunk/Source/WebKit2/WebProcess/WebProcess.h


Added Paths

trunk/Source/WebKit2/Shared/Cocoa/ChildProcessCocoa.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (211746 => 211747)

--- trunk/Source/WebKit2/ChangeLog	2017-02-06 21:49:24 UTC (rev 211746)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-06 21:49:54 UTC (rev 211747)
@@ -1,3 +1,30 @@
+2017-02-06  Anders Carlsson  
+
+Crash child processes if they receive an invalid message
+https://bugs.webkit.org/show_bug.cgi?id=167900
+
+Reviewed by Dan Bernstein.
+
+Previously, some processes would try to gracefully exit, others would just drop messages leading to weird bugs.
+Instead, set app-specific crash information to the message that failed to be decoded, and then crash.
+
+* DatabaseProcess/DatabaseProcess.cpp:
+(WebKit::DatabaseProcess::didReceiveInvalidMessage): Deleted.
+* DatabaseProcess/DatabaseProcess.h:
+* NetworkProcess/NetworkProcess.cpp:
+(WebKit::NetworkProcess::didReceiveInvalidMessage): Deleted.
+* NetworkProcess/NetworkProcess.h:
+* PluginProcess/PluginProcess.cpp:
+(WebKit::PluginProcess::didReceiveInvalidMessage): Deleted.
+* PluginProcess/PluginProcess.h:
+* Shared/ChildProcess.h:
+* Shared/Cocoa/ChildProcessCocoa.mm: Added.
+(WebKit::ChildProcess::didReceiveInvalidMessage):
+* WebKit2.xcodeproj/project.pbxproj:
+* WebProcess/WebProcess.cpp:
+(WebKit::WebProcess::didReceiveInvalidMessage): Deleted.
+* WebProcess/WebProcess.h:
+
 2017-02-06  Chris Dumez  
 
 [WK2] Drop legacy WKBundlePageDiagnosticLoggingClient API


Modified: trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp (211746 => 211747)

--- trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp	2017-02-06 21:49:24 UTC (rev 211746)
+++ trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp	2017-02-06 21:49:54 UTC (rev 211747)
@@ -90,11 +90,6 @@
 }
 }
 
-void DatabaseProcess::didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference, IPC::StringReference)
-{
-stopRunLoop();
-}
-
 #if ENABLE(INDEXED_DATABASE)
 IDBServer::IDBServer& DatabaseProcess::idbServer()
 {


Modified: trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.h (211746 => 211747)

--- trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.h	2017-02-06 21:49:24 UTC (rev 211746)
+++ trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.h	2017-02-06 21:49:54 UTC (rev 211747)
@@ -93,7 +93,6 @@
 // IPC::Connection::Client
 void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
 void didClose(IPC::Connection&) override;
-void didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override;
 void didReceiveDatabaseProcessMessage(IPC::Connection&, IPC::Decoder&);
 
 // Message Handlers


Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp (211746 => 211747)

--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp	2017-02-06 21:49:24 UTC (rev 211746)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp	2017-02-06 21:49:54 UTC (rev 211747)
@@ -170,11 +170,6 @@
 stopRunLoop();
 }
 
-void NetworkProcess::didRecei

[webkit-changes] [211736] trunk/Source/WebKit2

2017-02-06 Thread andersca
Title: [211736] trunk/Source/WebKit2








Revision 211736
Author ander...@apple.com
Date 2017-02-06 10:55:56 -0800 (Mon, 06 Feb 2017)


Log Message
Null check the WebKit::RemoteObjectProxy object before calling it
https://bugs.webkit.org/show_bug.cgi?id=167891
rdar://problem/30229358

Reviewed by Tim Horton.

If a _WKRemoteObjectRegistry invocation reply block outlives its underlying WebKit::RemoteObjectProxy object,
we'll crash trying to send an unused reply to it. Work around this crash by adding a null check before calling
sendUnusedReply.

While this fixes the crash it will lead to leaks in the process that holds on to the reply block. A more long term fix
would be to manage the reply block checkers and call sendUnusedReply when invalidating the _WKRemoteObjectRegistry.

* Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
(-[_WKRemoteObjectRegistry _invokeMethod:]):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectRegistry.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (211735 => 211736)

--- trunk/Source/WebKit2/ChangeLog	2017-02-06 18:38:14 UTC (rev 211735)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-06 18:55:56 UTC (rev 211736)
@@ -1,3 +1,21 @@
+2017-02-06  Anders Carlsson  
+
+Null check the WebKit::RemoteObjectProxy object before calling it
+https://bugs.webkit.org/show_bug.cgi?id=167891
+rdar://problem/30229358
+
+Reviewed by Tim Horton.
+
+If a _WKRemoteObjectRegistry invocation reply block outlives its underlying WebKit::RemoteObjectProxy object,
+we'll crash trying to send an unused reply to it. Work around this crash by adding a null check before calling
+sendUnusedReply. 
+
+While this fixes the crash it will lead to leaks in the process that holds on to the reply block. A more long term fix
+would be to manage the reply block checkers and call sendUnusedReply when invalidating the _WKRemoteObjectRegistry.
+
+* Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
+(-[_WKRemoteObjectRegistry _invokeMethod:]):
+
 2017-02-06  Carlos Garcia Campos  
 
 [Soup] Deadlock in NetworkProcess


Modified: trunk/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectRegistry.mm (211735 => 211736)

--- trunk/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectRegistry.mm	2017-02-06 18:38:14 UTC (rev 211735)
+++ trunk/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectRegistry.mm	2017-02-06 18:55:56 UTC (rev 211736)
@@ -223,8 +223,16 @@
 
 ~ReplyBlockCallChecker()
 {
-if (!m_didCallReplyBlock)
-m_remoteObjectRegistry->_remoteObjectRegistry->sendUnusedReply(m_replyID);
+if (m_didCallReplyBlock)
+return;
+
+// FIXME: Instead of not sending anything when the remote object registry is null, we should
+// keep track of all reply block checkers and invalidate them (sending the unused reply message) in
+// -[_WKRemoteObjectRegistry _invalidate].
+if (!m_remoteObjectRegistry->_remoteObjectRegistry)
+return;
+
+m_remoteObjectRegistry->_remoteObjectRegistry->sendUnusedReply(m_replyID);
 }
 
 void didCallReplyBlock() { m_didCallReplyBlock = true; }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [211726] trunk/Source/WebKit2

2017-02-06 Thread andersca
Title: [211726] trunk/Source/WebKit2








Revision 211726
Author ander...@apple.com
Date 2017-02-06 08:54:31 -0800 (Mon, 06 Feb 2017)


Log Message
Guard and unguard ports in a much less intrusive way
https://bugs.webkit.org/show_bug.cgi?id=167813

Reviewed by Sam Weinig.

Instead of adopting mach_port_construct/mach_port_destruct, just guard and unguard the ports where appropriate.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::platformInitialize):
(IPC::Connection::open):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (211725 => 211726)

--- trunk/Source/WebKit2/ChangeLog	2017-02-06 16:21:07 UTC (rev 211725)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-06 16:54:31 UTC (rev 211726)
@@ -1,3 +1,16 @@
+2017-02-03  Anders Carlsson  
+
+Guard and unguard ports in a much less intrusive way
+https://bugs.webkit.org/show_bug.cgi?id=167813
+
+Reviewed by Sam Weinig.
+
+Instead of adopting mach_port_construct/mach_port_destruct, just guard and unguard the ports where appropriate.
+
+* Platform/IPC/mac/ConnectionMac.mm:
+(IPC::Connection::platformInitialize):
+(IPC::Connection::open):
+
 2017-02-06  Miguel Gomez  
 
 [GTK][EFL] Release unused UpdateAtlas when in memory pressure situation


Modified: trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm (211725 => 211726)

--- trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2017-02-06 16:21:07 UTC (rev 211725)
+++ trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2017-02-06 16:54:31 UTC (rev 211726)
@@ -120,6 +120,7 @@
 }
 
 if (m_receivePort) {
+mach_port_unguard(mach_task_self(), m_receivePort, reinterpret_cast(this));
 mach_port_mod_refs(mach_task_self(), m_receivePort, MACH_PORT_RIGHT_RECEIVE, -1);
 m_receivePort = MACH_PORT_NULL;
 }
@@ -170,6 +171,8 @@
 if (m_isServer) {
 m_receivePort = identifier.port;
 m_sendPort = MACH_PORT_NULL;
+
+mach_port_guard(mach_task_self(), m_receivePort, reinterpret_cast(this), true);
 } else {
 m_receivePort = MACH_PORT_NULL;
 m_sendPort = identifier.port;
@@ -191,8 +194,8 @@
 ASSERT(!m_receivePort);
 ASSERT(m_sendPort);
 
-// Create the receive port.
 mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &m_receivePort);
+mach_port_guard(mach_task_self(), m_receivePort, reinterpret_cast(this), true);
 
 #if PLATFORM(MAC)
 mach_port_set_attributes(mach_task_self(), m_receivePort, MACH_PORT_DENAP_RECEIVER, (mach_port_info_t)0, 0);
@@ -218,6 +221,7 @@
 connection->receiveSourceEventHandler();
 });
 dispatch_source_set_cancel_handler(m_receiveSource, [connection, receivePort = m_receivePort] {
+mach_port_unguard(mach_task_self(), receivePort, reinterpret_cast(connection.get()));
 mach_port_mod_refs(mach_task_self(), receivePort, MACH_PORT_RIGHT_RECEIVE, -1);
 });
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [211655] trunk/Source/WebKit2

2017-02-03 Thread andersca
Title: [211655] trunk/Source/WebKit2








Revision 211655
Author ander...@apple.com
Date 2017-02-03 15:08:17 -0800 (Fri, 03 Feb 2017)


Log Message
Revert toString behavior to what we had in the last version we shipped
https://bugs.webkit.org/show_bug.cgi?id=167814
rdar://problem/30344753

Reviewed by Tim Horton.

This is a speculative fix for a crash that we've seen on recent builds. It simply reverts the toString call back to
what we have in the last version of Safari we shipped.

* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
(WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp




Diff

Modified: trunk/Source/WebKit2/ChangeLog (211654 => 211655)

--- trunk/Source/WebKit2/ChangeLog	2017-02-03 22:40:28 UTC (rev 211654)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-03 23:08:17 UTC (rev 211655)
@@ -1,3 +1,17 @@
+2017-02-03  Anders Carlsson  
+
+Revert toString behavior to what we had in the last version we shipped
+https://bugs.webkit.org/show_bug.cgi?id=167814
+rdar://problem/30344753
+
+Reviewed by Tim Horton.
+
+This is a speculative fix for a crash that we've seen on recent builds. It simply reverts the toString call back to
+what we have in the last version of Safari we shipped.
+
+* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
+(WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
+
 2017-02-03  Chris Dumez  
 
 Dismiss HTML form validation popover when pressing Escape key


Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp (211654 => 211655)

--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp	2017-02-03 22:40:28 UTC (rev 211654)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp	2017-02-03 23:08:17 UTC (rev 211655)
@@ -167,7 +167,7 @@
 }
 
 if (value.isString()) {
-NPString npString = createNPString(asString(value)->value(exec).utf8());
+NPString npString = createNPString(value.toString(exec)->value(exec).utf8());
 STRINGN_TO_NPVARIANT(npString.UTF8Characters, npString.UTF8Length, variant);
 return;
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [211648] trunk/Source/WebKit2

2017-02-03 Thread andersca
Title: [211648] trunk/Source/WebKit2








Revision 211648
Author ander...@apple.com
Date 2017-02-03 13:48:23 -0800 (Fri, 03 Feb 2017)


Log Message
Stash away the ports - they will be nulled out before the cancel handlers are called
https://bugs.webkit.org/show_bug.cgi?id=167812

Reviewed by Geoffrey Garen.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::open):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (211647 => 211648)

--- trunk/Source/WebKit2/ChangeLog	2017-02-03 21:17:28 UTC (rev 211647)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-03 21:48:23 UTC (rev 211648)
@@ -1,5 +1,15 @@
 2017-02-03  Anders Carlsson  
 
+Stash away the ports - they will be nulled out before the cancel handlers are called
+https://bugs.webkit.org/show_bug.cgi?id=167812
+
+Reviewed by Geoffrey Garen.
+
+* Platform/IPC/mac/ConnectionMac.mm:
+(IPC::Connection::open):
+
+2017-02-03  Anders Carlsson  
+
 Inline createReceiveSource in its two call sites
 https://bugs.webkit.org/show_bug.cgi?id=167809
 


Modified: trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm (211647 => 211648)

--- trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2017-02-03 21:17:28 UTC (rev 211647)
+++ trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2017-02-03 21:48:23 UTC (rev 211648)
@@ -217,8 +217,8 @@
 dispatch_source_set_event_handler(m_receiveSource, [connection] {
 connection->receiveSourceEventHandler();
 });
-dispatch_source_set_cancel_handler(m_receiveSource, [connection] {
-mach_port_mod_refs(mach_task_self(), connection->m_receivePort, MACH_PORT_RIGHT_RECEIVE, -1);
+dispatch_source_set_cancel_handler(m_receiveSource, [connection, receivePort = m_receivePort] {
+mach_port_mod_refs(mach_task_self(), receivePort, MACH_PORT_RIGHT_RECEIVE, -1);
 });
 
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000
@@ -227,8 +227,8 @@
 dispatch_source_set_event_handler(m_exceptionPortDataAvailableSource, [connection] {
 connection->exceptionSourceEventHandler();
 });
-dispatch_source_set_cancel_handler(m_exceptionPortDataAvailableSource, [connection] {
-mach_port_mod_refs(mach_task_self(), connection->m_exceptionPort, MACH_PORT_RIGHT_RECEIVE, -1);
+dispatch_source_set_cancel_handler(m_exceptionPortDataAvailableSource, [connection, exceptionPort = m_exceptionPort] {
+mach_port_mod_refs(mach_task_self(), exceptionPort, MACH_PORT_RIGHT_RECEIVE, -1);
 });
 
 auto encoder = std::make_unique("IPC", "SetExceptionPort", 0);






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [211644] trunk/Source/WebKit2

2017-02-03 Thread andersca
Title: [211644] trunk/Source/WebKit2








Revision 211644
Author ander...@apple.com
Date 2017-02-03 12:28:40 -0800 (Fri, 03 Feb 2017)


Log Message
Inline createReceiveSource in its two call sites
https://bugs.webkit.org/show_bug.cgi?id=167809

Reviewed by Alex Christensen.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::open):
(IPC::createReceiveSource): Deleted.

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (211643 => 211644)

--- trunk/Source/WebKit2/ChangeLog	2017-02-03 20:07:49 UTC (rev 211643)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-03 20:28:40 UTC (rev 211644)
@@ -1,3 +1,14 @@
+2017-02-03  Anders Carlsson  
+
+Inline createReceiveSource in its two call sites
+https://bugs.webkit.org/show_bug.cgi?id=167809
+
+Reviewed by Alex Christensen.
+
+* Platform/IPC/mac/ConnectionMac.mm:
+(IPC::Connection::open):
+(IPC::createReceiveSource): Deleted.
+
 2017-02-03  Wenson Hsieh  
 
 WKActionSheet should dismiss with animation when done with the sheet


Modified: trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm (211643 => 211644)

--- trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2017-02-03 20:07:49 UTC (rev 211643)
+++ trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2017-02-03 20:28:40 UTC (rev 211644)
@@ -181,19 +181,6 @@
 m_xpcConnection = identifier.xpcConnection;
 }
 
-template
-static dispatch_source_t createReceiveSource(mach_port_t receivePort, WorkQueue& workQueue, Function&& function)
-{
-dispatch_source_t source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MACH_RECV, receivePort, 0, workQueue.dispatchQueue());
-dispatch_source_set_event_handler(source, function);
-
-dispatch_source_set_cancel_handler(source, ^{
-mach_port_mod_refs(mach_task_self(), receivePort, MACH_PORT_RIGHT_RECEIVE, -1);
-});
-
-return source;
-}
-
 bool Connection::open()
 {
 if (m_isServer) {
@@ -225,17 +212,24 @@
 // Change the message queue length for the receive port.
 setMachPortQueueLength(m_receivePort, MACH_PORT_QLIMIT_LARGE);
 
-// Register the data available handler.
 RefPtr connection(this);
-m_receiveSource = createReceiveSource(m_receivePort, m_connectionQueue, [connection] {
+m_receiveSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_MACH_RECV, m_receivePort, 0, m_connectionQueue->dispatchQueue());
+dispatch_source_set_event_handler(m_receiveSource, [connection] {
 connection->receiveSourceEventHandler();
 });
+dispatch_source_set_cancel_handler(m_receiveSource, [connection] {
+mach_port_mod_refs(mach_task_self(), connection->m_receivePort, MACH_PORT_RIGHT_RECEIVE, -1);
+});
 
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000
 if (m_exceptionPort) {
-m_exceptionPortDataAvailableSource = createReceiveSource(m_exceptionPort, m_connectionQueue, [connection] {
+m_exceptionPortDataAvailableSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_MACH_RECV, m_exceptionPort, 0, m_connectionQueue->dispatchQueue());
+dispatch_source_set_event_handler(m_exceptionPortDataAvailableSource, [connection] {
 connection->exceptionSourceEventHandler();
 });
+dispatch_source_set_cancel_handler(m_exceptionPortDataAvailableSource, [connection] {
+mach_port_mod_refs(mach_task_self(), connection->m_exceptionPort, MACH_PORT_RIGHT_RECEIVE, -1);
+});
 
 auto encoder = std::make_unique("IPC", "SetExceptionPort", 0);
 encoder->encode(MachPort(m_exceptionPort, MACH_MSG_TYPE_MAKE_SEND));






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [211568] trunk/Source/WebKit2

2017-02-02 Thread andersca
Title: [211568] trunk/Source/WebKit2








Revision 211568
Author ander...@apple.com
Date 2017-02-02 09:52:44 -0800 (Thu, 02 Feb 2017)


Log Message
 Webkit Nightly on 10.10 broken

Follow-up fix.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::open):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (211567 => 211568)

--- trunk/Source/WebKit2/ChangeLog	2017-02-02 17:46:20 UTC (rev 211567)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-02 17:52:44 UTC (rev 211568)
@@ -2,6 +2,15 @@
 
  Webkit Nightly on 10.10 broken
 
+Follow-up fix.
+
+* Platform/IPC/mac/ConnectionMac.mm:
+(IPC::Connection::open):
+
+2017-02-02  Anders Carlsson  
+
+ Webkit Nightly on 10.10 broken
+
 Try to fix the 10.10 build.
 
 * Platform/IPC/mac/ConnectionMac.mm:


Modified: trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm (211567 => 211568)

--- trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2017-02-02 17:46:20 UTC (rev 211567)
+++ trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2017-02-02 17:52:44 UTC (rev 211568)
@@ -226,7 +226,7 @@
 
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000
 if (m_exceptionPort) {
-m_exceptionPortDataAvailableSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_MACH_RECV, m_exceptionPort, 0, m_connectionQueue.dispatchQueue());
+m_exceptionPortDataAvailableSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_MACH_RECV, m_exceptionPort, 0, m_connectionQueue->dispatchQueue());
 dispatch_source_set_event_handler(m_exceptionPortDataAvailableSource, [connection] {
 connection->exceptionSourceEventHandler();
 });






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [211566] trunk/Source/WebKit2

2017-02-02 Thread andersca
Title: [211566] trunk/Source/WebKit2








Revision 211566
Author ander...@apple.com
Date 2017-02-02 09:39:57 -0800 (Thu, 02 Feb 2017)


Log Message
 Webkit Nightly on 10.10 broken

Try to fix the 10.10 build.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::open):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (211565 => 211566)

--- trunk/Source/WebKit2/ChangeLog	2017-02-02 17:37:16 UTC (rev 211565)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-02 17:39:57 UTC (rev 211566)
@@ -1,3 +1,12 @@
+2017-02-02  Anders Carlsson  
+
+ Webkit Nightly on 10.10 broken
+
+Try to fix the 10.10 build.
+
+* Platform/IPC/mac/ConnectionMac.mm:
+(IPC::Connection::open):
+
 2017-02-01  Anders Carlsson  
 
 Handle m_processLauncher being null in ChildProcessProxy::processIdentifier()


Modified: trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm (211565 => 211566)

--- trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2017-02-02 17:37:16 UTC (rev 211565)
+++ trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2017-02-02 17:39:57 UTC (rev 211566)
@@ -227,10 +227,10 @@
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000
 if (m_exceptionPort) {
 m_exceptionPortDataAvailableSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_MACH_RECV, m_exceptionPort, 0, m_connectionQueue.dispatchQueue());
-dispatch_source_set_event_handler(source, [connection] {
+dispatch_source_set_event_handler(m_exceptionPortDataAvailableSource, [connection] {
 connection->exceptionSourceEventHandler();
 });
-dispatch_source_set_cancel_handler(source, [connection, exceptionPort = connection->m_exceptionPort] {
+dispatch_source_set_cancel_handler(m_exceptionPortDataAvailableSource, [connection, exceptionPort = connection->m_exceptionPort] {
 mach_port_mod_refs(mach_task_self(), exceptionPort, MACH_PORT_RIGHT_RECEIVE, -1);
 });
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [211565] trunk/Source/WebKit2

2017-02-02 Thread andersca
Title: [211565] trunk/Source/WebKit2








Revision 211565
Author ander...@apple.com
Date 2017-02-02 09:37:16 -0800 (Thu, 02 Feb 2017)


Log Message
Handle m_processLauncher being null in ChildProcessProxy::processIdentifier()
https://bugs.webkit.org/show_bug.cgi?id=167713
rdar://problem/28896113

Reviewed by Dan Bernstein.

This can happen if the process has been explicitly terminated.

* UIProcess/ChildProcessProxy.h:
(WebKit::ChildProcessProxy::processIdentifier):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/UIProcess/ChildProcessProxy.h




Diff

Modified: trunk/Source/WebKit2/ChangeLog (211564 => 211565)

--- trunk/Source/WebKit2/ChangeLog	2017-02-02 17:06:25 UTC (rev 211564)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-02 17:37:16 UTC (rev 211565)
@@ -1,3 +1,16 @@
+2017-02-01  Anders Carlsson  
+
+Handle m_processLauncher being null in ChildProcessProxy::processIdentifier()
+https://bugs.webkit.org/show_bug.cgi?id=167713
+rdar://problem/28896113
+
+Reviewed by Dan Bernstein.
+
+This can happen if the process has been explicitly terminated.
+
+* UIProcess/ChildProcessProxy.h:
+(WebKit::ChildProcessProxy::processIdentifier):
+
 2017-02-02  Yongjun Zhang  
 
 In iOS, we should take background assertion when accessing localstorage databases.


Modified: trunk/Source/WebKit2/UIProcess/ChildProcessProxy.h (211564 => 211565)

--- trunk/Source/WebKit2/UIProcess/ChildProcessProxy.h	2017-02-02 17:06:25 UTC (rev 211564)
+++ trunk/Source/WebKit2/UIProcess/ChildProcessProxy.h	2017-02-02 17:37:16 UTC (rev 211565)
@@ -71,7 +71,7 @@
 };
 State state() const;
 
-pid_t processIdentifier() const { return m_processLauncher->processIdentifier(); }
+pid_t processIdentifier() const { return m_processLauncher ? m_processLauncher->processIdentifier() : 0; }
 
 bool canSendMessage() const { return state() != State::Terminated;}
 bool sendMessage(std::unique_ptr, OptionSet);






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [211535] trunk/Source/WebKit2

2017-02-01 Thread andersca
Title: [211535] trunk/Source/WebKit2








Revision 211535
Author ander...@apple.com
Date 2017-02-01 14:52:02 -0800 (Wed, 01 Feb 2017)


Log Message
IPC::Connection receive ports should be guarded
https://bugs.webkit.org/show_bug.cgi?id=167704

Reviewed by Tim Horton.

Guarding receive rights will make sure that they won't be closed accidentally. They are created
with a context pointer and can only be unguarded or destructed with the same context pointer.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::platformInvalidate):
Use mach_port_destruct and pass the connection pointer as the context.

(IPC::Connection::platformInitialize):
Guard the server port with the connection pointer as the context.

(IPC::Connection::open):
Use mach_port_construct to create the port which lets us avoid a call to mach_port_set_attributes and setMachPortQueueLength.
Make the port guarded and use the connection pointer as the context.

(IPC::createReceiveSource):
Get rid of this and just duplicate the five lines of code in two places. For the receive port we want to use mach_port_destruct
in our cancel handler.

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (211534 => 211535)

--- trunk/Source/WebKit2/ChangeLog	2017-02-01 22:41:52 UTC (rev 211534)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-01 22:52:02 UTC (rev 211535)
@@ -1,3 +1,28 @@
+2017-02-01  Anders Carlsson  
+
+IPC::Connection receive ports should be guarded
+https://bugs.webkit.org/show_bug.cgi?id=167704
+
+Reviewed by Tim Horton.
+
+Guarding receive rights will make sure that they won't be closed accidentally. They are created
+with a context pointer and can only be unguarded or destructed with the same context pointer.
+
+* Platform/IPC/mac/ConnectionMac.mm:
+(IPC::Connection::platformInvalidate):
+Use mach_port_destruct and pass the connection pointer as the context.
+
+(IPC::Connection::platformInitialize):
+Guard the server port with the connection pointer as the context.
+
+(IPC::Connection::open):
+Use mach_port_construct to create the port which lets us avoid a call to mach_port_set_attributes and setMachPortQueueLength.
+Make the port guarded and use the connection pointer as the context.
+
+(IPC::createReceiveSource):
+Get rid of this and just duplicate the five lines of code in two places. For the receive port we want to use mach_port_destruct
+in our cancel handler.
+
 2017-02-01  Andreas Kling  
 
 Implement the alwaysRunsAtBackgroundPriority WK2 setting using thread QoS.


Modified: trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm (211534 => 211535)

--- trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2017-02-01 22:41:52 UTC (rev 211534)
+++ trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2017-02-01 22:52:02 UTC (rev 211535)
@@ -120,7 +120,7 @@
 }
 
 if (m_receivePort) {
-mach_port_mod_refs(mach_task_self(), m_receivePort, MACH_PORT_RIGHT_RECEIVE, -1);
+mach_port_destruct(mach_task_self(), m_receivePort, 0, reinterpret_cast(this));
 m_receivePort = MACH_PORT_NULL;
 }
 
@@ -170,6 +170,8 @@
 if (m_isServer) {
 m_receivePort = identifier.port;
 m_sendPort = MACH_PORT_NULL;
+
+mach_port_guard(mach_task_self(), m_receivePort, reinterpret_cast(this), true);
 } else {
 m_receivePort = MACH_PORT_NULL;
 m_sendPort = identifier.port;
@@ -181,19 +183,6 @@
 m_xpcConnection = identifier.xpcConnection;
 }
 
-template
-static dispatch_source_t createReceiveSource(mach_port_t receivePort, WorkQueue& workQueue, Function&& function)
-{
-dispatch_source_t source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MACH_RECV, receivePort, 0, workQueue.dispatchQueue());
-dispatch_source_set_event_handler(source, function);
-
-dispatch_source_set_cancel_handler(source, ^{
-mach_port_mod_refs(mach_task_self(), receivePort, MACH_PORT_RIGHT_RECEIVE, -1);
-});
-
-return source;
-}
-
 bool Connection::open()
 {
 if (m_isServer) {
@@ -205,17 +194,21 @@
 ASSERT(m_sendPort);
 
 // Create the receive port.
-mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &m_receivePort);
+uint32_t flags = MPO_CONTEXT_AS_GUARD | MPO_QLIMIT |  MPO_STRICT | MPO_INSERT_SEND_RIGHT;
 
 #if PLATFORM(MAC)
-mach_port_set_attributes(mach_task_self(), m_receivePort, MACH_PORT_DENAP_RECEIVER, (mach_port_info_t)0, 0);
+flags |= MPO_DENAP_RECEIVER;
 #endif
 
+mach_port_options_t portOptions;
+portOptions.flags = flags;
+portOptions.mpl.mpl_qlimit = MACH_PORT_QLIMIT_LARGE;
+mach_port_construct(mach_task_self(), &portOptions, reinterpret_cast(this), &m_receivePort);
+
 m_isConnected = true;
 
-// Send

[webkit-changes] [211446] trunk

2017-01-31 Thread andersca
Title: [211446] trunk








Revision 211446
Author ander...@apple.com
Date 2017-01-31 14:03:59 -0800 (Tue, 31 Jan 2017)


Log Message
Apple Pay button does nothing on nytimes.com
https://bugs.webkit.org/show_bug.cgi?id=167664
rdar://problem/30273885

Reviewed by Sam Weinig.

Source/WebCore:

Separate line item validation into convertAndValidateTotal and convertAndValidate. The former
works on totals (which require an amount), and the latter works on regular line items that do not require an amount
if the item type is "pending".

* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidateTotal):
(WebCore::convertAndValidate):
Only check the amount if the type is not pending.

(WebCore::ApplePaySession::completeShippingMethodSelection):
(WebCore::ApplePaySession::completeShippingContactSelection):
(WebCore::ApplePaySession::completePaymentMethodSelection):
Call convertAndValidateTotal for totals.

LayoutTests:

Add a new test.

* http/tests/ssl/applepay/ApplePaySession-expected.txt:
* http/tests/ssl/applepay/ApplePaySession.html:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession-expected.txt
trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession.html
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp




Diff

Modified: trunk/LayoutTests/ChangeLog (211445 => 211446)

--- trunk/LayoutTests/ChangeLog	2017-01-31 21:04:27 UTC (rev 211445)
+++ trunk/LayoutTests/ChangeLog	2017-01-31 22:03:59 UTC (rev 211446)
@@ -1,3 +1,16 @@
+2017-01-31  Anders Carlsson  
+
+Apple Pay button does nothing on nytimes.com
+https://bugs.webkit.org/show_bug.cgi?id=167664
+rdar://problem/30273885
+
+Reviewed by Sam Weinig.
+
+Add a new test.
+
+* http/tests/ssl/applepay/ApplePaySession-expected.txt:
+* http/tests/ssl/applepay/ApplePaySession.html:
+
 2017-01-31  Chris Dumez  
 
 Unreviewed, fix layout tests added in r211435.


Modified: trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession-expected.txt (211445 => 211446)

--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession-expected.txt	2017-01-31 21:04:27 UTC (rev 211445)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession-expected.txt	2017-01-31 22:03:59 UTC (rev 211446)
@@ -169,6 +169,9 @@
 SETUP: request = validRequest(); request.lineItems = { };
 PASS new ApplePaySession(2, request) threw exception TypeError: Type error.
 
+SETUP: request = validRequest(); request.lineItems = [{ label: 'label', type: 'pending' }];
+PASS new ApplePaySession(2, request) did not throw exception.
+
 SETUP: request = validRequest(); request.lineItems = [];
 PASS new ApplePaySession(2, request) did not throw exception.
 


Modified: trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession.html (211445 => 211446)

--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession.html	2017-01-31 21:04:27 UTC (rev 211445)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession.html	2017-01-31 22:03:59 UTC (rev 211446)
@@ -112,7 +112,7 @@
 logAndShouldThrow("request = validRequest(); request.lineItems = null;", "new ApplePaySession(2, request)")
 logAndShouldThrow("request = validRequest(); request.lineItems = 7;", "new ApplePaySession(2, request)")
 logAndShouldThrow("request = validRequest(); request.lineItems = { };", "new ApplePaySession(2, request)")
-// FIXME: Should we allow an empty lineItems sequence?
+logAndShouldNotThrow("request = validRequest(); request.lineItems = [{ label: 'label', type: 'pending' }];", "new ApplePaySession(2, request)")
 logAndShouldNotThrow("request = validRequest(); request.lineItems = [];", "new ApplePaySession(2, request)")
 logAndShouldThrow("request = validRequest(); request.lineItems = [''];", "new ApplePaySession(2, request)")
 logAndShouldThrow("request = validRequest(); request.lineItems = [null];", "new ApplePaySession(2, request)")


Modified: trunk/Source/WebCore/ChangeLog (211445 => 211446)

--- trunk/Source/WebCore/ChangeLog	2017-01-31 21:04:27 UTC (rev 211445)
+++ trunk/Source/WebCore/ChangeLog	2017-01-31 22:03:59 UTC (rev 211446)
@@ -1,3 +1,25 @@
+2017-01-31  Anders Carlsson  
+
+Apple Pay button does nothing on nytimes.com
+https://bugs.webkit.org/show_bug.cgi?id=167664
+rdar://problem/30273885
+
+Reviewed by Sam Weinig.
+
+Separate line item validation into convertAndValidateTotal and convertAndValidate. The former
+works on totals (which require an amount), and the latter works on regular line items that do not require an amount
+if the item type is "pending".
+
+* Modules/applepay/ApplePaySession.cpp:
+(WebCore::convertAndValidateTotal):
+(WebCore::convertAndValidate):
+Only check the amount if the type is not pending.
+
+(WebCore::ApplePaySession::completeShippingMethodSelection):
+(WebCore::ApplePaySession::completeShippingConta

[webkit-changes] [211443] trunk/Source/WebKit2

2017-01-31 Thread andersca
Title: [211443] trunk/Source/WebKit2








Revision 211443
Author ander...@apple.com
Date 2017-01-31 12:25:46 -0800 (Tue, 31 Jan 2017)


Log Message
Add more CRASH calls to try to figure out why we're failing to send mach ports over the wire
https://bugs.webkit.org/show_bug.cgi?id=167657

Reviewed by Tim Horton.

* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::openFrontendConnection):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp




Diff

Modified: trunk/Source/WebKit2/ChangeLog (211442 => 211443)

--- trunk/Source/WebKit2/ChangeLog	2017-01-31 19:49:34 UTC (rev 211442)
+++ trunk/Source/WebKit2/ChangeLog	2017-01-31 20:25:46 UTC (rev 211443)
@@ -1,3 +1,13 @@
+2017-01-31  Anders Carlsson  
+
+Add more CRASH calls to try to figure out why we're failing to send mach ports over the wire
+https://bugs.webkit.org/show_bug.cgi?id=167657
+
+Reviewed by Tim Horton.
+
+* WebProcess/WebPage/WebInspector.cpp:
+(WebKit::WebInspector::openFrontendConnection):
+
 2017-01-31  Wenson Hsieh  
 
 Crash when trying to compute global location when the WKContentView does not have a window


Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp (211442 => 211443)

--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp	2017-01-31 19:49:34 UTC (rev 211442)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp	2017-01-31 20:25:46 UTC (rev 211443)
@@ -78,9 +78,12 @@
 IPC::Attachment connectionClientPort(socketPair.client);
 #elif OS(DARWIN)
 mach_port_t listeningPort;
-mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &listeningPort);
-mach_port_insert_right(mach_task_self(), listeningPort, listeningPort, MACH_MSG_TYPE_MAKE_SEND);
+if (mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &listeningPort) != KERN_SUCCESS)
+CRASH();
 
+if (mach_port_insert_right(mach_task_self(), listeningPort, listeningPort, MACH_MSG_TYPE_MAKE_SEND) != KERN_SUCCESS)
+CRASH();
+
 IPC::Connection::Identifier connectionIdentifier(listeningPort);
 IPC::Attachment connectionClientPort(listeningPort, MACH_MSG_TYPE_MOVE_SEND);
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [211390] trunk/Source/WebKit2

2017-01-30 Thread andersca
Title: [211390] trunk/Source/WebKit2








Revision 211390
Author ander...@apple.com
Date 2017-01-30 15:37:57 -0800 (Mon, 30 Jan 2017)


Log Message
Add some more crash reporter information to diagnose a failed mach_msg
https://bugs.webkit.org/show_bug.cgi?id=167610

Reviewed by Dean Jackson.

Include the receive port name as well.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::readFromMachPort):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (211389 => 211390)

--- trunk/Source/WebKit2/ChangeLog	2017-01-30 23:21:57 UTC (rev 211389)
+++ trunk/Source/WebKit2/ChangeLog	2017-01-30 23:37:57 UTC (rev 211390)
@@ -1,3 +1,15 @@
+2017-01-30  Anders Carlsson  
+
+Add some more crash reporter information to diagnose a failed mach_msg
+https://bugs.webkit.org/show_bug.cgi?id=167610
+
+Reviewed by Dean Jackson.
+
+Include the receive port name as well.
+
+* Platform/IPC/mac/ConnectionMac.mm:
+(IPC::readFromMachPort):
+
 2017-01-30  Simon Fraser  
 
 [iOS] position:fixed inside touch-scrollable overflow is mispositioned


Modified: trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm (211389 => 211390)

--- trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2017-01-30 23:21:57 UTC (rev 211389)
+++ trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2017-01-30 23:37:57 UTC (rev 211390)
@@ -498,7 +498,7 @@
 
 if (kr != MACH_MSG_SUCCESS) {
 #if !ASSERT_DISABLED
-WKSetCrashReportApplicationSpecificInformation((CFStringRef)[NSString stringWithFormat:@"Unhandled error code %x from mach_msg", kr]);
+WKSetCrashReportApplicationSpecificInformation((CFStringRef)[NSString stringWithFormat:@"Unhandled error code %x from mach_msg, receive port is %x", kr, machPort]);
 #endif
 ASSERT_NOT_REACHED();
 return 0;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [211223] trunk/Source/WebKit2

2017-01-26 Thread andersca
Title: [211223] trunk/Source/WebKit2








Revision 211223
Author ander...@apple.com
Date 2017-01-26 11:50:14 -0800 (Thu, 26 Jan 2017)


Log Message
Don't use _CFBundleCreateUnique on Yosemite, it's not available there
https://bugs.webkit.org/show_bug.cgi?id=167459
rdar://problem/30181179

Reviewed by Beth Dakin.

* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::NetscapePluginModule::getPluginInfo):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (211222 => 211223)

--- trunk/Source/WebKit2/ChangeLog	2017-01-26 19:36:27 UTC (rev 211222)
+++ trunk/Source/WebKit2/ChangeLog	2017-01-26 19:50:14 UTC (rev 211223)
@@ -1,3 +1,14 @@
+2017-01-26  Anders Carlsson  
+
+Don't use _CFBundleCreateUnique on Yosemite, it's not available there
+https://bugs.webkit.org/show_bug.cgi?id=167459
+rdar://problem/30181179
+
+Reviewed by Beth Dakin.
+
+* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
+(WebKit::NetscapePluginModule::getPluginInfo):
+
 2017-01-26  Alex Christensen  
 
 Add SPI for updating WebsitePolicies


Modified: trunk/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm (211222 => 211223)

--- trunk/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm	2017-01-26 19:36:27 UTC (rev 211222)
+++ trunk/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm	2017-01-26 19:50:14 UTC (rev 211223)
@@ -209,7 +209,12 @@
 RetainPtr bundleURL = adoptCF(CFURLCreateWithFileSystemPath(kCFAllocatorDefault, pluginPath.createCFString().get(), kCFURLPOSIXPathStyle, false));
 
 // Try to initialize the bundle.
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
 RetainPtr bundle = adoptCF(_CFBundleCreateUnique(kCFAllocatorDefault, bundleURL.get()));
+#else
+RetainPtr bundle = adoptCF(CFBundleCreate(kCFAllocatorDefault, bundleURL.get()));
+#endif
+
 if (!bundle)
 return false;
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [211114] trunk/Source/WebCore

2017-01-24 Thread andersca
Title: [24] trunk/Source/WebCore








Revision 24
Author ander...@apple.com
Date 2017-01-24 15:25:38 -0800 (Tue, 24 Jan 2017)


Log Message
When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!)
https://bugs.webkit.org/show_bug.cgi?id=167391
rdar://problem/29857388

Reviewed by Sam Weinig.

* page/Page.cpp:
(WebCore::Page::refreshPlugins):
Remove an unused variable.

* plugins/PluginInfoProvider.cpp:
(WebCore::PluginInfoProvider::refresh):
Make sure to call refreshPlugins(). Instead of reloading subframes, just reload all the main frames with
subframes that contain plug-ins.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/Page.cpp
trunk/Source/WebCore/plugins/PluginInfoProvider.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (23 => 24)

--- trunk/Source/WebCore/ChangeLog	2017-01-24 23:24:35 UTC (rev 23)
+++ trunk/Source/WebCore/ChangeLog	2017-01-24 23:25:38 UTC (rev 24)
@@ -1,3 +1,20 @@
+2017-01-24  Anders Carlsson  
+
+When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!)
+https://bugs.webkit.org/show_bug.cgi?id=167391
+rdar://problem/29857388
+
+Reviewed by Sam Weinig.
+
+* page/Page.cpp:
+(WebCore::Page::refreshPlugins):
+Remove an unused variable.
+
+* plugins/PluginInfoProvider.cpp:
+(WebCore::PluginInfoProvider::refresh):
+Make sure to call refreshPlugins(). Instead of reloading subframes, just reload all the main frames with
+subframes that contain plug-ins.
+
 2017-01-24  Joseph Pecoraro  
 
 Clean up Performance IDL interfaces so they are easier to read


Modified: trunk/Source/WebCore/page/Page.cpp (23 => 24)

--- trunk/Source/WebCore/page/Page.cpp	2017-01-24 23:24:35 UTC (rev 23)
+++ trunk/Source/WebCore/page/Page.cpp	2017-01-24 23:25:38 UTC (rev 24)
@@ -537,8 +537,6 @@
 
 HashSet pluginInfoProviders;
 
-Vector> framesNeedingReload;
-
 for (auto& page : *allPages)
 pluginInfoProviders.add(&page->pluginInfoProvider());
 


Modified: trunk/Source/WebCore/plugins/PluginInfoProvider.cpp (23 => 24)

--- trunk/Source/WebCore/plugins/PluginInfoProvider.cpp	2017-01-24 23:24:35 UTC (rev 23)
+++ trunk/Source/WebCore/plugins/PluginInfoProvider.cpp	2017-01-24 23:25:38 UTC (rev 24)
@@ -39,8 +39,10 @@
 
 void PluginInfoProvider::refresh(bool reloadPages)
 {
-Vector> framesNeedingReload;
+refreshPlugins();
 
+Vector> framesNeedingReload;
+
 for (auto& page : m_pages) {
 page->clearPluginData();
 
@@ -49,7 +51,7 @@
 
 for (Frame* frame = &page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
 if (frame->loader().subframeLoader().containsPlugins())
-framesNeedingReload.append(*frame);
+framesNeedingReload.append(page->mainFrame());
 }
 }
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [211086] trunk

2017-01-24 Thread andersca
Title: [211086] trunk








Revision 211086
Author ander...@apple.com
Date 2017-01-24 09:29:13 -0800 (Tue, 24 Jan 2017)


Log Message
The Score Esports crashes on launch
https://bugs.webkit.org/show_bug.cgi?id=167338
rdar://problem/29948645

Reviewed by Dan Bernstein.

Source/WebKit2:

* Shared/Cocoa/WKObject.mm:
(+[WKObject conformsToProtocol:]):
Add a class method implementation in case an app ends up calling +[WKObject conformsToProtocol:] for some reason.

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/WKObject.mm:
(TestWebKitAPI::TEST):
Add a test.

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Shared/Cocoa/WKObject.mm
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKObject.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (211085 => 211086)

--- trunk/Source/WebKit2/ChangeLog	2017-01-24 17:01:44 UTC (rev 211085)
+++ trunk/Source/WebKit2/ChangeLog	2017-01-24 17:29:13 UTC (rev 211086)
@@ -1,3 +1,15 @@
+2017-01-23  Anders Carlsson  
+
+The Score Esports crashes on launch
+https://bugs.webkit.org/show_bug.cgi?id=167338
+rdar://problem/29948645
+
+Reviewed by Dan Bernstein.
+
+* Shared/Cocoa/WKObject.mm:
+(+[WKObject conformsToProtocol:]):
+Add a class method implementation in case an app ends up calling +[WKObject conformsToProtocol:] for some reason.
+
 2017-01-24  Miguel Gomez  
 
 [Coordinated Graphics] Ensure that we're in AC mode before trying to create GraphicsLayers


Modified: trunk/Source/WebKit2/Shared/Cocoa/WKObject.mm (211085 => 211086)

--- trunk/Source/WebKit2/Shared/Cocoa/WKObject.mm	2017-01-24 17:01:44 UTC (rev 211085)
+++ trunk/Source/WebKit2/Shared/Cocoa/WKObject.mm	2017-01-24 17:29:13 UTC (rev 211086)
@@ -153,6 +153,19 @@
 return [_target respondsToSelector:selector] || (selector && class_respondsToSelector(object_getClass(self), selector));
 }
 
++ (BOOL)conformsToProtocol:(Protocol *)protocol
+{
+if (!protocol)
+return NO;
+
+for (Class cls = self; cls; cls = class_getSuperclass(cls)) {
+if (class_conformsToProtocol(cls, protocol))
+return YES;
+}
+
+return NO;
+}
+
 - (BOOL)conformsToProtocol:(Protocol *)protocol
 {
 initializeTargetIfNeeded(self);


Modified: trunk/Tools/ChangeLog (211085 => 211086)

--- trunk/Tools/ChangeLog	2017-01-24 17:01:44 UTC (rev 211085)
+++ trunk/Tools/ChangeLog	2017-01-24 17:29:13 UTC (rev 211086)
@@ -1,3 +1,15 @@
+2017-01-23  Anders Carlsson  
+
+The Score Esports crashes on launch
+https://bugs.webkit.org/show_bug.cgi?id=167338
+rdar://problem/29948645
+
+Reviewed by Dan Bernstein.
+
+* TestWebKitAPI/Tests/WebKit2Cocoa/WKObject.mm:
+(TestWebKitAPI::TEST):
+Add a test.
+
 2017-01-23  Carlos Garcia Campos  
 
 [GTK] Add API to WebKitWebsiteDataManager to handle website data


Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKObject.mm (211085 => 211086)

--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKObject.mm	2017-01-24 17:01:44 UTC (rev 211085)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKObject.mm	2017-01-24 17:29:13 UTC (rev 211086)
@@ -48,6 +48,14 @@
 ASSERT_EQ((id)0, weakString);
 }
 
+TEST(WebKit2, WKObject_classMethods)
+{
+Class wkObjectClass = NSClassFromString(@"WKObject");
+ASSERT_NE((Class)0, wkObjectClass);
+
+ASSERT_TRUE([wkObjectClass conformsToProtocol:@protocol(NSObject)]);
+}
+
 } // namespace TestWebKitAPI
 
 #endif






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [211052] trunk/Source

2017-01-23 Thread andersca
Title: [211052] trunk/Source








Revision 211052
Author ander...@apple.com
Date 2017-01-23 12:58:35 -0800 (Mon, 23 Jan 2017)


Log Message
When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!)
https://bugs.webkit.org/show_bug.cgi?id=167268
rdar://problem/29857388

Reviewed by Sam Weinig.

Source/WebCore:

* page/Page.cpp:
(WebCore::Page::refreshPlugins):
Call PluginInfoProvider::refresh instead.

(WebCore::Page::clearPluginData):
Add new setter.

* page/Page.h:
Declare new members.

* plugins/PluginInfoProvider.cpp:
(WebCore::PluginInfoProvider::refresh):
Put the logic to clear plug-in data and reload frames here.

* plugins/PluginInfoProvider.h:
Add new members.

Source/WebKit2:

* WebProcess/Plugins/WebPluginInfoProvider.h:
Make refreshPlugins() private.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::refreshPlugins):
Call the newly added PluginInfoProvider::refresh().

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/Page.cpp
trunk/Source/WebCore/page/Page.h
trunk/Source/WebCore/plugins/PluginInfoProvider.cpp
trunk/Source/WebCore/plugins/PluginInfoProvider.h
trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/WebProcess/Plugins/WebPluginInfoProvider.h
trunk/Source/WebKit2/WebProcess/WebProcess.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (211051 => 211052)

--- trunk/Source/WebCore/ChangeLog	2017-01-23 20:55:09 UTC (rev 211051)
+++ trunk/Source/WebCore/ChangeLog	2017-01-23 20:58:35 UTC (rev 211052)
@@ -1,3 +1,28 @@
+2017-01-20  Anders Carlsson  
+
+When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!)
+https://bugs.webkit.org/show_bug.cgi?id=167268
+rdar://problem/29857388
+
+Reviewed by Sam Weinig.
+
+* page/Page.cpp:
+(WebCore::Page::refreshPlugins):
+Call PluginInfoProvider::refresh instead.
+
+(WebCore::Page::clearPluginData):
+Add new setter.
+
+* page/Page.h:
+Declare new members.
+
+* plugins/PluginInfoProvider.cpp:
+(WebCore::PluginInfoProvider::refresh):
+Put the logic to clear plug-in data and reload frames here.
+
+* plugins/PluginInfoProvider.h:
+Add new members.
+
 2017-01-23  Jer Noble  
 
 REGRESSION (r208149): Video details does not apear and missing scrubber in Control Center


Modified: trunk/Source/WebCore/page/Page.cpp (211051 => 211052)

--- trunk/Source/WebCore/page/Page.cpp	2017-01-23 20:55:09 UTC (rev 211051)
+++ trunk/Source/WebCore/page/Page.cpp	2017-01-23 20:58:35 UTC (rev 211052)
@@ -539,24 +539,11 @@
 
 Vector> framesNeedingReload;
 
-for (auto& page : *allPages) {
+for (auto& page : *allPages)
 pluginInfoProviders.add(&page->pluginInfoProvider());
-page->m_pluginData = nullptr;
 
-if (!reload)
-continue;
-
-for (Frame* frame = &page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
-if (frame->loader().subframeLoader().containsPlugins())
-framesNeedingReload.append(*frame);
-}
-}
-
 for (auto& pluginInfoProvider : pluginInfoProviders)
-pluginInfoProvider->refreshPlugins();
-
-for (auto& frame : framesNeedingReload)
-frame->loader().reload();
+pluginInfoProvider->refresh(reload);
 }
 
 PluginData& Page::pluginData()
@@ -566,6 +553,11 @@
 return *m_pluginData;
 }
 
+void Page::clearPluginData()
+{
+m_pluginData = nullptr;
+}
+
 bool Page::showAllPlugins() const
 {
 if (m_showAllPlugins)


Modified: trunk/Source/WebCore/page/Page.h (211051 => 211052)

--- trunk/Source/WebCore/page/Page.h	2017-01-23 20:55:09 UTC (rev 211051)
+++ trunk/Source/WebCore/page/Page.h	2017-01-23 20:58:35 UTC (rev 211052)
@@ -166,6 +166,7 @@
 
 static void refreshPlugins(bool reload);
 WEBCORE_EXPORT PluginData& pluginData();
+void clearPluginData();
 
 WEBCORE_EXPORT void setCanStartMedia(bool);
 bool canStartMedia() const { return m_canStartMedia; }


Modified: trunk/Source/WebCore/plugins/PluginInfoProvider.cpp (211051 => 211052)

--- trunk/Source/WebCore/plugins/PluginInfoProvider.cpp	2017-01-23 20:55:09 UTC (rev 211051)
+++ trunk/Source/WebCore/plugins/PluginInfoProvider.cpp	2017-01-23 20:58:35 UTC (rev 211052)
@@ -26,6 +26,10 @@
 #include "config.h"
 #include "PluginInfoProvider.h"
 
+#include "MainFrame.h"
+#include "Page.h"
+#include "SubframeLoader.h"
+
 namespace WebCore {
 
 PluginInfoProvider::~PluginInfoProvider()
@@ -33,6 +37,26 @@
 ASSERT(m_pages.isEmpty());
 }
 
+void PluginInfoProvider::refresh(bool reloadPages)
+{
+Vector> framesNeedingReload;
+
+for (auto& page : m_pages) {
+page->clearPluginData();
+
+if (!reloadPages)
+continue;
+
+for (Frame* frame = &page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
+if (frame->loader().subframeLoader().contain

[webkit-changes] [210929] trunk/Source/WebKit2

2017-01-19 Thread andersca
Title: [210929] trunk/Source/WebKit2








Revision 210929
Author ander...@apple.com
Date 2017-01-19 10:20:30 -0800 (Thu, 19 Jan 2017)


Log Message
Install WebKit.apinotes with the public headers of WebKit framework
https://bugs.webkit.org/show_bug.cgi?id=167182
rdar://problem/29008989

Reviewed by Sam Weinig.

* Shared/API/Cocoa/WebKit.apinotes: Added.
* WebKit2.xcodeproj/project.pbxproj:

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj


Added Paths

trunk/Source/WebKit2/Shared/API/Cocoa/WebKit.apinotes




Diff

Modified: trunk/Source/WebKit2/ChangeLog (210928 => 210929)

--- trunk/Source/WebKit2/ChangeLog	2017-01-19 17:59:12 UTC (rev 210928)
+++ trunk/Source/WebKit2/ChangeLog	2017-01-19 18:20:30 UTC (rev 210929)
@@ -1,3 +1,14 @@
+2017-01-18  Anders Carlsson  
+
+Install WebKit.apinotes with the public headers of WebKit framework
+https://bugs.webkit.org/show_bug.cgi?id=167182
+rdar://problem/29008989
+
+Reviewed by Sam Weinig.
+
+* Shared/API/Cocoa/WebKit.apinotes: Added.
+* WebKit2.xcodeproj/project.pbxproj:
+
 2017-01-19  Brian Burg  
 
 Web Inspector: move Mac-specific automation commands to a separate implementation file


Added: trunk/Source/WebKit2/Shared/API/Cocoa/WebKit.apinotes (0 => 210929)

--- trunk/Source/WebKit2/Shared/API/Cocoa/WebKit.apinotes	(rev 0)
+++ trunk/Source/WebKit2/Shared/API/Cocoa/WebKit.apinotes	2017-01-19 18:20:30 UTC (rev 210929)
@@ -0,0 +1,202 @@
+---
+Name: WebKit
+Classes:
+- Name: WebFrame
+  Properties:
+  - Name: dataSource
+Nullability: O
+- Name: WebView
+  Methods:
+  - Selector: 'alignCenter:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'alignJustified:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'alignLeft:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'alignRight:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'changeAttributes:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'changeColor:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'changeDocumentBackgroundColor:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'changeFont:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'checkSpelling:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'copy:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'copyFont:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'cut:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'delete:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'goBack:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'goForward:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'makeTextLarger:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'makeTextSmaller:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'makeTextStandardSize:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'moveToBeginningOfSentence:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'moveToBeginningOfSentenceAndModifySelection:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'moveToEndOfSentence:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'moveToEndOfSentenceAndModifySelection:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'overWrite:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'paste:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'pasteAsPlainText:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'pasteAsRichText:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'pasteFont:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'performFindPanelAction:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'reload:'
+MethodKind: Instance
+Nullability:
+- O
+NullabilityOfRet: S
+  - Selector: 'reloadFromOrigin:'
+MethodKind: Instance
+Nullability:
+- O
+Nulla

[webkit-changes] [210892] trunk/Source/WebKit2

2017-01-18 Thread andersca
Title: [210892] trunk/Source/WebKit2








Revision 210892
Author ander...@apple.com
Date 2017-01-18 15:23:06 -0800 (Wed, 18 Jan 2017)


Log Message
Add instrumentation for when we fail to receive a message
https://bugs.webkit.org/show_bug.cgi?id=167179

Reviewed by Alexey Proskuryakov.

This will help us diagnose what the error from mach_msg is.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::readFromMachPort):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (210891 => 210892)

--- trunk/Source/WebKit2/ChangeLog	2017-01-18 22:53:39 UTC (rev 210891)
+++ trunk/Source/WebKit2/ChangeLog	2017-01-18 23:23:06 UTC (rev 210892)
@@ -1,3 +1,15 @@
+2017-01-18  Anders Carlsson  
+
+Add instrumentation for when we fail to receive a message
+https://bugs.webkit.org/show_bug.cgi?id=167179
+
+Reviewed by Alexey Proskuryakov.
+
+This will help us diagnose what the error from mach_msg is.
+
+* Platform/IPC/mac/ConnectionMac.mm:
+(IPC::readFromMachPort):
+
 2017-01-18  Alex Christensen  
 
 Fix CFURLConnection build on Mac


Modified: trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm (210891 => 210892)

--- trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2017-01-18 22:53:39 UTC (rev 210891)
+++ trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2017-01-18 23:23:06 UTC (rev 210892)
@@ -497,6 +497,9 @@
 }
 
 if (kr != MACH_MSG_SUCCESS) {
+#if !ASSERT_DISABLED
+WKSetCrashReportApplicationSpecificInformation((CFStringRef)[NSString stringWithFormat:@"Unhandled error code %x from mach_msg", kr]);
+#endif
 ASSERT_NOT_REACHED();
 return 0;
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [210825] trunk/Source/WebKit2

2017-01-17 Thread andersca
Title: [210825] trunk/Source/WebKit2








Revision 210825
Author ander...@apple.com
Date 2017-01-17 12:57:53 -0800 (Tue, 17 Jan 2017)


Log Message
It's not possible to perform a POST request with HTTPBody content in a WKWebView
https://bugs.webkit.org/show_bug.cgi?id=167131
rdar://problem/20464240

Reviewed by Beth Dakin.

Encode/decode the form data if necessary.

* Shared/LoadParameters.cpp:
(WebKit::LoadParameters::encode):
(WebKit::LoadParameters::decode):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Shared/LoadParameters.cpp




Diff

Modified: trunk/Source/WebKit2/ChangeLog (210824 => 210825)

--- trunk/Source/WebKit2/ChangeLog	2017-01-17 20:25:36 UTC (rev 210824)
+++ trunk/Source/WebKit2/ChangeLog	2017-01-17 20:57:53 UTC (rev 210825)
@@ -1,3 +1,17 @@
+2017-01-17  Anders Carlsson  
+
+It's not possible to perform a POST request with HTTPBody content in a WKWebView
+https://bugs.webkit.org/show_bug.cgi?id=167131
+rdar://problem/20464240
+
+Reviewed by Beth Dakin.
+
+Encode/decode the form data if necessary.
+
+* Shared/LoadParameters.cpp:
+(WebKit::LoadParameters::encode):
+(WebKit::LoadParameters::decode):
+
 2017-01-17  Joseph Pecoraro  
 
 Crash when closing tab with debugger paused


Modified: trunk/Source/WebKit2/Shared/LoadParameters.cpp (210824 => 210825)

--- trunk/Source/WebKit2/Shared/LoadParameters.cpp	2017-01-17 20:25:36 UTC (rev 210824)
+++ trunk/Source/WebKit2/Shared/LoadParameters.cpp	2017-01-17 20:57:53 UTC (rev 210825)
@@ -34,6 +34,11 @@
 {
 encoder << navigationID;
 encoder << request;
+
+encoder << static_cast(request.httpBody());
+if (request.httpBody())
+request.httpBody()->encode(encoder);
+
 encoder << sandboxExtensionHandle;
 encoder << data;
 encoder << string;
@@ -56,6 +61,17 @@
 if (!decoder.decode(data.request))
 return false;
 
+bool hasHTTPBody;
+if (!decoder.decode(hasHTTPBody))
+return false;
+
+if (hasHTTPBody) {
+RefPtr formData = WebCore::FormData::decode(decoder);
+if (!formData)
+return false;
+data.request.setHTTPBody(WTFMove(formData));
+}
+
 if (!decoder.decode(data.sandboxExtensionHandle))
 return false;
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [210603] trunk/Source

2017-01-11 Thread andersca
Title: [210603] trunk/Source








Revision 210603
Author ander...@apple.com
Date 2017-01-11 15:55:37 -0800 (Wed, 11 Jan 2017)


Log Message
navigator.plugins.refresh and WKContextRefreshPlugIns doesn't pick up changes to already-present plug-ins
https://bugs.webkit.org/show_bug.cgi?id=166942
rdar://problem/29839194

Reviewed by Sam Weinig.

Source/WebKit2:

Use _CFBundleCreateUnique so the resulting bundle won't be cached.

* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::NetscapePluginModule::getPluginInfo):

Source/WTF:

* wtf/spi/cf/CFBundleSPI.h:
Add SPI declaration.

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/spi/cf/CFBundleSPI.h
trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm




Diff

Modified: trunk/Source/WTF/ChangeLog (210602 => 210603)

--- trunk/Source/WTF/ChangeLog	2017-01-11 23:07:39 UTC (rev 210602)
+++ trunk/Source/WTF/ChangeLog	2017-01-11 23:55:37 UTC (rev 210603)
@@ -1,3 +1,14 @@
+2017-01-11  Anders Carlsson  
+
+navigator.plugins.refresh and WKContextRefreshPlugIns doesn't pick up changes to already-present plug-ins
+https://bugs.webkit.org/show_bug.cgi?id=166942
+rdar://problem/29839194
+
+Reviewed by Sam Weinig.
+
+* wtf/spi/cf/CFBundleSPI.h:
+Add SPI declaration.
+
 2017-01-06  Gustavo Noronha Silva  
 
 [GTK] Should support key and code properties on keyboard events


Modified: trunk/Source/WTF/wtf/spi/cf/CFBundleSPI.h (210602 => 210603)

--- trunk/Source/WTF/wtf/spi/cf/CFBundleSPI.h	2017-01-11 23:07:39 UTC (rev 210602)
+++ trunk/Source/WTF/wtf/spi/cf/CFBundleSPI.h	2017-01-11 23:55:37 UTC (rev 210603)
@@ -38,6 +38,7 @@
 
 void _CFBundleSetupXPCBootstrap(xpc_object_t bootstrap);
 
+CFBundleRef _CFBundleCreateUnique(CFAllocatorRef, CFURLRef bundleURL);
 Boolean CFBundleGetLocalizationInfoForLocalization(CFStringRef localizationName, SInt32 *languageCode, SInt32 *regionCode, SInt32 *scriptCode, CFStringEncoding *stringEncoding);
 CFStringRef CFBundleCopyLocalizationForLocalizationInfo(SInt32 languageCode, SInt32 regionCode, SInt32 scriptCode, CFStringEncoding stringEncoding);
 


Modified: trunk/Source/WebKit2/ChangeLog (210602 => 210603)

--- trunk/Source/WebKit2/ChangeLog	2017-01-11 23:07:39 UTC (rev 210602)
+++ trunk/Source/WebKit2/ChangeLog	2017-01-11 23:55:37 UTC (rev 210603)
@@ -1,5 +1,18 @@
 2017-01-11  Anders Carlsson  
 
+navigator.plugins.refresh and WKContextRefreshPlugIns doesn't pick up changes to already-present plug-ins
+https://bugs.webkit.org/show_bug.cgi?id=166942
+rdar://problem/29839194
+
+Reviewed by Sam Weinig.
+
+Use _CFBundleCreateUnique so the resulting bundle won't be cached.
+
+* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
+(WebKit::NetscapePluginModule::getPluginInfo):
+
+2017-01-11  Anders Carlsson  
+
 REGRESSION: Crash in com.apple.WebKit: IPC::Connection::sendMessage(std::__1::unique_ptr >) + 27
 https://bugs.webkit.org/show_bug.cgi?id=165854
 rdar://problem/29757269


Modified: trunk/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm (210602 => 210603)

--- trunk/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm	2017-01-11 23:07:39 UTC (rev 210602)
+++ trunk/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm	2017-01-11 23:55:37 UTC (rev 210603)
@@ -32,6 +32,7 @@
 #import "PluginSandboxProfile.h"
 #import 
 #import 
+#import 
 
 using namespace WebCore;
 
@@ -208,7 +209,7 @@
 RetainPtr bundleURL = adoptCF(CFURLCreateWithFileSystemPath(kCFAllocatorDefault, pluginPath.createCFString().get(), kCFURLPOSIXPathStyle, false));
 
 // Try to initialize the bundle.
-RetainPtr bundle = adoptCF(CFBundleCreate(kCFAllocatorDefault, bundleURL.get()));
+RetainPtr bundle = adoptCF(_CFBundleCreateUnique(kCFAllocatorDefault, bundleURL.get()));
 if (!bundle)
 return false;
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [210596] trunk/Source/WebKit2

2017-01-11 Thread andersca
Title: [210596] trunk/Source/WebKit2








Revision 210596
Author ander...@apple.com
Date 2017-01-11 13:28:01 -0800 (Wed, 11 Jan 2017)


Log Message
REGRESSION: Crash in com.apple.WebKit: IPC::Connection::sendMessage(std::__1::unique_ptr >) + 27
https://bugs.webkit.org/show_bug.cgi?id=165854
rdar://problem/29757269

Reviewed by Tim Horton.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendMessage):
Add assertion.

(IPC::Connection::initializeSendSource):
Turns out the event handler can be called spuriously, so guard against that.

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (210595 => 210596)

--- trunk/Source/WebKit2/ChangeLog	2017-01-11 21:07:13 UTC (rev 210595)
+++ trunk/Source/WebKit2/ChangeLog	2017-01-11 21:28:01 UTC (rev 210596)
@@ -1,3 +1,18 @@
+2017-01-11  Anders Carlsson  
+
+REGRESSION: Crash in com.apple.WebKit: IPC::Connection::sendMessage(std::__1::unique_ptr >) + 27
+https://bugs.webkit.org/show_bug.cgi?id=165854
+rdar://problem/29757269
+
+Reviewed by Tim Horton.
+
+* Platform/IPC/mac/ConnectionMac.mm:
+(IPC::Connection::sendMessage):
+Add assertion.
+
+(IPC::Connection::initializeSendSource):
+Turns out the event handler can be called spuriously, so guard against that.
+
 2017-01-11  Chris Dumez  
 
 [iOS][WK2] KeyboardEvent.key always returns an empty string


Modified: trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm (210595 => 210596)

--- trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2017-01-11 21:07:13 UTC (rev 210595)
+++ trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2017-01-11 21:28:01 UTC (rev 210596)
@@ -263,6 +263,7 @@
 
 bool Connection::sendMessage(std::unique_ptr message)
 {
+ASSERT(message);
 ASSERT(!m_pendingOutgoingMachMessage);
 
 // Send the message.
@@ -399,7 +400,9 @@
 }
 
 if (data & DISPATCH_MACH_SEND_POSSIBLE) {
-connection->sendMessage(WTFMove(connection->m_pendingOutgoingMachMessage));
+// FIXME: Figure out why we get spurious DISPATCH_MACH_SEND_POSSIBLE events.
+if (connection->m_pendingOutgoingMachMessage)
+connection->sendMessage(WTFMove(connection->m_pendingOutgoingMachMessage));
 connection->sendOutgoingMessages();
 return;
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [209995] trunk/Source/WebKit2

2016-12-19 Thread andersca
Title: [209995] trunk/Source/WebKit2








Revision 209995
Author ander...@apple.com
Date 2016-12-19 13:27:15 -0800 (Mon, 19 Dec 2016)


Log Message
REGRESSION: Crash in com.apple.WebKit:IPC::Connection::platformCanSendOutgoingMessages() const + 0
https://bugs.webkit.org/show_bug.cgi?id=165817
rdar://problem/29626731

Reviewed by Dan Bernstein.

If the receive right is invalidated before we send the message, the kernel won't be able to create a send right,
and we'll crash due to mach_msg returning MACH_SEND_INVALID_RIGHT.

Fix this by immediately creating a send right, and passing MACH_MSG_TYPE_MOVE_SEND to the attachment constructor.

* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::openFrontendConnection):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp




Diff

Modified: trunk/Source/WebKit2/ChangeLog (209994 => 209995)

--- trunk/Source/WebKit2/ChangeLog	2016-12-19 20:33:57 UTC (rev 209994)
+++ trunk/Source/WebKit2/ChangeLog	2016-12-19 21:27:15 UTC (rev 209995)
@@ -1,3 +1,19 @@
+2016-12-19  Anders Carlsson  
+
+REGRESSION: Crash in com.apple.WebKit:IPC::Connection::platformCanSendOutgoingMessages() const + 0
+https://bugs.webkit.org/show_bug.cgi?id=165817
+rdar://problem/29626731
+
+Reviewed by Dan Bernstein.
+
+If the receive right is invalidated before we send the message, the kernel won't be able to create a send right,
+and we'll crash due to mach_msg returning MACH_SEND_INVALID_RIGHT.
+
+Fix this by immediately creating a send right, and passing MACH_MSG_TYPE_MOVE_SEND to the attachment constructor.
+
+* WebProcess/WebPage/WebInspector.cpp:
+(WebKit::WebInspector::openFrontendConnection):
+
 2016-12-18  Simon Fraser  
 
 Expose a way for MiniBrowser to simulate header and footer banners


Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp (209994 => 209995)

--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp	2016-12-19 20:33:57 UTC (rev 209994)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp	2016-12-19 21:27:15 UTC (rev 209995)
@@ -79,9 +79,11 @@
 #elif OS(DARWIN)
 mach_port_t listeningPort;
 mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &listeningPort);
+mach_port_insert_right(mach_task_self(), listeningPort, listeningPort, MACH_MSG_TYPE_MAKE_SEND);
 
 IPC::Connection::Identifier connectionIdentifier(listeningPort);
-IPC::Attachment connectionClientPort(listeningPort, MACH_MSG_TYPE_MAKE_SEND);
+IPC::Attachment connectionClientPort(listeningPort, MACH_MSG_TYPE_MOVE_SEND);
+
 #else
 notImplemented();
 return;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [209876] trunk/Source/WebKit2

2016-12-15 Thread andersca
Title: [209876] trunk/Source/WebKit2








Revision 209876
Author ander...@apple.com
Date 2016-12-15 14:48:10 -0800 (Thu, 15 Dec 2016)


Log Message
Add more mach_msg logging instrumentation
https://bugs.webkit.org/show_bug.cgi?id=165914

Reviewed by Darin Adler.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendMessage):
(IPC::Connection::sendOutgoingMessage):
* Platform/IPC/mac/MachMessage.h:
(IPC::MachMessage::messageName):
(IPC::MachMessage::setMessageName):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm
trunk/Source/WebKit2/Platform/IPC/mac/MachMessage.h




Diff

Modified: trunk/Source/WebKit2/ChangeLog (209875 => 209876)

--- trunk/Source/WebKit2/ChangeLog	2016-12-15 22:12:21 UTC (rev 209875)
+++ trunk/Source/WebKit2/ChangeLog	2016-12-15 22:48:10 UTC (rev 209876)
@@ -1,3 +1,17 @@
+2016-12-15  Anders Carlsson  
+
+Add more mach_msg logging instrumentation
+https://bugs.webkit.org/show_bug.cgi?id=165914
+
+Reviewed by Darin Adler.
+
+* Platform/IPC/mac/ConnectionMac.mm:
+(IPC::Connection::sendMessage):
+(IPC::Connection::sendOutgoingMessage):
+* Platform/IPC/mac/MachMessage.h:
+(IPC::MachMessage::messageName):
+(IPC::MachMessage::setMessageName):
+
 2016-12-15  Konstantin Tokarev  
 
 Added missing override and final specifiers


Modified: trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm (209875 => 209876)

--- trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2016-12-15 22:12:21 UTC (rev 209875)
+++ trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2016-12-15 22:48:10 UTC (rev 209876)
@@ -283,7 +283,7 @@
 return false;
 
 default:
-WKSetCrashReportApplicationSpecificInformation((CFStringRef)[NSString stringWithFormat:@"Unhandled error code %x", kr]);
+WKSetCrashReportApplicationSpecificInformation((CFStringRef)[NSString stringWithFormat:@"Unhandled error code %x, message '%@'", kr, message->messageName()]);
 CRASH();
 }
 }
@@ -318,6 +318,7 @@
 }
 
 auto message = MachMessage::create(messageSize);
+message->setMessageName((__bridge CFStringRef)[NSString stringWithFormat:@"%s:%s:", encoder->messageReceiverName().toString().data(), encoder->messageName().toString().data()]);
 
 bool isComplex = (numberOfPortDescriptors + numberOfOOLMemoryDescriptors) > 0;
 


Modified: trunk/Source/WebKit2/Platform/IPC/mac/MachMessage.h (209875 => 209876)

--- trunk/Source/WebKit2/Platform/IPC/mac/MachMessage.h	2016-12-15 22:12:21 UTC (rev 209875)
+++ trunk/Source/WebKit2/Platform/IPC/mac/MachMessage.h	2016-12-15 22:48:10 UTC (rev 209876)
@@ -26,6 +26,7 @@
 #pragma once
 
 #include 
+#include 
 
 namespace IPC {
 
@@ -42,9 +43,13 @@
 
 void leakDescriptors();
 
+CFStringRef messageName() const { return m_messageName.get(); }
+void setMessageName(CFStringRef messageName) { m_messageName = messageName; }
+
 private:
 explicit MachMessage(size_t);
 
+RetainPtr m_messageName;
 size_t m_size;
 bool m_shouldFreeDescriptors;
 uint8_t m_buffer[0];






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [209840] trunk/Source/WebKit2

2016-12-14 Thread andersca
Title: [209840] trunk/Source/WebKit2








Revision 209840
Author ander...@apple.com
Date 2016-12-14 16:00:38 -0800 (Wed, 14 Dec 2016)


Log Message
Add WKContextRefreshPlugIns
https://bugs.webkit.org/show_bug.cgi?id=165879
rdar://problem/29602414

Reviewed by Tim Horton.

* UIProcess/API/C/WKContext.cpp:
(WKContextRefreshPlugIns):
* UIProcess/API/C/WKContext.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::refreshPlugins):
* UIProcess/WebProcessPool.h:
* WebProcess/Plugins/WebPluginInfoProvider.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::refreshPlugins):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp
trunk/Source/WebKit2/UIProcess/API/C/WKContext.h
trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp
trunk/Source/WebKit2/UIProcess/WebProcessPool.h
trunk/Source/WebKit2/WebProcess/Plugins/WebPluginInfoProvider.h
trunk/Source/WebKit2/WebProcess/WebProcess.cpp
trunk/Source/WebKit2/WebProcess/WebProcess.h
trunk/Source/WebKit2/WebProcess/WebProcess.messages.in




Diff

Modified: trunk/Source/WebKit2/ChangeLog (209839 => 209840)

--- trunk/Source/WebKit2/ChangeLog	2016-12-14 23:42:51 UTC (rev 209839)
+++ trunk/Source/WebKit2/ChangeLog	2016-12-15 00:00:38 UTC (rev 209840)
@@ -1,3 +1,23 @@
+2016-12-14  Anders Carlsson  
+
+Add WKContextRefreshPlugIns
+https://bugs.webkit.org/show_bug.cgi?id=165879
+rdar://problem/29602414
+
+Reviewed by Tim Horton.
+
+* UIProcess/API/C/WKContext.cpp:
+(WKContextRefreshPlugIns):
+* UIProcess/API/C/WKContext.h:
+* UIProcess/WebProcessPool.cpp:
+(WebKit::WebProcessPool::refreshPlugins):
+* UIProcess/WebProcessPool.h:
+* WebProcess/Plugins/WebPluginInfoProvider.h:
+* WebProcess/WebProcess.cpp:
+(WebKit::WebProcess::refreshPlugins):
+* WebProcess/WebProcess.h:
+* WebProcess/WebProcess.messages.in:
+
 2016-12-14  Tim Horton  
 
 API Test Fullscreen.TopContentInset is asserting on Yosemite


Modified: trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp (209839 => 209840)

--- trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp	2016-12-14 23:42:51 UTC (rev 209839)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp	2016-12-15 00:00:38 UTC (rev 209840)
@@ -353,6 +353,15 @@
 #endif
 }
 
+void WKContextRefreshPlugIns(WKContextRef context)
+{
+#if ENABLE(NETSCAPE_PLUGIN_API)
+toImpl(context)->refreshPlugins();
+#else
+UNUSED_PARAM(context);
+#endif
+}
+
 void WKContextRegisterURLSchemeAsEmptyDocument(WKContextRef contextRef, WKStringRef urlScheme)
 {
 toImpl(contextRef)->registerURLSchemeAsEmptyDocument(toImpl(urlScheme)->string());


Modified: trunk/Source/WebKit2/UIProcess/API/C/WKContext.h (209839 => 209840)

--- trunk/Source/WebKit2/UIProcess/API/C/WKContext.h	2016-12-14 23:42:51 UTC (rev 209839)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKContext.h	2016-12-15 00:00:38 UTC (rev 209840)
@@ -162,6 +162,7 @@
 WK_EXPORT void WKContextSetPlugInAutoStartOriginHashes(WKContextRef context, WKDictionaryRef dictionary);
 WK_EXPORT void WKContextSetPlugInAutoStartOrigins(WKContextRef contextRef, WKArrayRef arrayRef);
 WK_EXPORT void WKContextSetPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime(WKContextRef contextRef, WKDictionaryRef dictionaryRef, double time);
+WK_EXPORT void WKContextRefreshPlugIns(WKContextRef context);
 
 #ifdef __cplusplus
 }


Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (209839 => 209840)

--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp	2016-12-14 23:42:51 UTC (rev 209839)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp	2016-12-15 00:00:38 UTC (rev 209840)
@@ -866,6 +866,13 @@
 
 m_pluginInfoStore.setAdditionalPluginsDirectories(directories);
 }
+
+void WebProcessPool::refreshPlugins()
+{
+m_pluginInfoStore.refresh();
+sendToAllProcesses(Messages::WebProcess::RefreshPlugins());
+}
+
 #endif // ENABLE(NETSCAPE_PLUGIN_API)
 
 pid_t WebProcessPool::networkProcessIdentifier()


Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.h (209839 => 209840)

--- trunk/Source/WebKit2/UIProcess/WebProcessPool.h	2016-12-14 23:42:51 UTC (rev 209839)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.h	2016-12-15 00:00:38 UTC (rev 209840)
@@ -181,6 +181,7 @@
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
 void setAdditionalPluginsDirectory(const String&);
+void refreshPlugins();
 
 PluginInfoStore& pluginInfoStore() { return m_pluginInfoStore; }
 


Modified: trunk/Source/WebKit2/WebProcess/Plugins/WebPluginInfoProvider.h (209839 => 209840)

--- trunk/Source/WebKit2/WebProcess/Plugins/WebPluginInfoProvider.h	2016-12-14 23:42:51 UTC (rev 209839)
+++ trunk/Source/WebKit2/WebProcess/Plugins/WebPluginInfoProvider.h	2016-12-15 00:00:38 UTC (rev 209840)
@@ -42,10 +42,11 @@
 void clearPluginClientPolicies();
 #endif
 
+void refreshPlugins() override;
+
 private:
 WebPl

[webkit-changes] [209831] trunk/Source/WebKit2

2016-12-14 Thread andersca
Title: [209831] trunk/Source/WebKit2








Revision 209831
Author ander...@apple.com
Date 2016-12-14 13:31:26 -0800 (Wed, 14 Dec 2016)


Log Message
Add some instrumentation to try to detect a crash on the bots
https://bugs.webkit.org/show_bug.cgi?id=165866

Reviewed by Sam Weinig.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendMessage):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (209830 => 209831)

--- trunk/Source/WebKit2/ChangeLog	2016-12-14 21:29:14 UTC (rev 209830)
+++ trunk/Source/WebKit2/ChangeLog	2016-12-14 21:31:26 UTC (rev 209831)
@@ -1,3 +1,13 @@
+2016-12-14  Anders Carlsson  
+
+Add some instrumentation to try to detect a crash on the bots
+https://bugs.webkit.org/show_bug.cgi?id=165866
+
+Reviewed by Sam Weinig.
+
+* Platform/IPC/mac/ConnectionMac.mm:
+(IPC::Connection::sendMessage):
+
 2016-12-14  Dave Hyatt  
 
 [CSS Parser] Implement deferred parsing of properties, @media, @supports and @keyframes


Modified: trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm (209830 => 209831)

--- trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2016-12-14 21:29:14 UTC (rev 209830)
+++ trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2016-12-14 21:31:26 UTC (rev 209831)
@@ -32,6 +32,7 @@
 #include "MachPort.h"
 #include "MachUtilities.h"
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -282,6 +283,7 @@
 return false;
 
 default:
+WKSetCrashReportApplicationSpecificInformation((CFStringRef)[NSString stringWithFormat:@"Unhandled error code %x", kr]);
 CRASH();
 }
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [209635] trunk/Source/WebKit2

2016-12-09 Thread andersca
Title: [209635] trunk/Source/WebKit2








Revision 209635
Author ander...@apple.com
Date 2016-12-09 15:30:43 -0800 (Fri, 09 Dec 2016)


Log Message
Once we can send Mach messages again, make sure to send any pending outgoing messages
https://bugs.webkit.org/show_bug.cgi?id=165693

Reviewed by Brady Eidson.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::initializeSendSource):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (209634 => 209635)

--- trunk/Source/WebKit2/ChangeLog	2016-12-09 23:22:31 UTC (rev 209634)
+++ trunk/Source/WebKit2/ChangeLog	2016-12-09 23:30:43 UTC (rev 209635)
@@ -1,3 +1,13 @@
+2016-12-09  Anders Carlsson  
+
+Once we can send Mach messages again, make sure to send any pending outgoing messages
+https://bugs.webkit.org/show_bug.cgi?id=165693
+
+Reviewed by Brady Eidson.
+
+* Platform/IPC/mac/ConnectionMac.mm:
+(IPC::Connection::initializeSendSource):
+
 2016-12-09  Beth Dakin  
 
 Password fields should not show the emoji button in TouchBar


Modified: trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm (209634 => 209635)

--- trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2016-12-09 23:22:31 UTC (rev 209634)
+++ trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2016-12-09 23:30:43 UTC (rev 209635)
@@ -397,6 +397,7 @@
 
 if (data & DISPATCH_MACH_SEND_POSSIBLE) {
 connection->sendMessage(WTFMove(connection->m_pendingOutgoingMachMessage));
+connection->sendOutgoingMessages();
 return;
 }
 });






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [209581] trunk/Source/WebKit2

2016-12-08 Thread andersca
Title: [209581] trunk/Source/WebKit2








Revision 209581
Author ander...@apple.com
Date 2016-12-08 16:44:05 -0800 (Thu, 08 Dec 2016)


Log Message
Attempt to fix the iOS build.

* Platform/IPC/mac/MachMessage.cpp:

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Platform/IPC/mac/MachMessage.cpp




Diff

Modified: trunk/Source/WebKit2/ChangeLog (209580 => 209581)

--- trunk/Source/WebKit2/ChangeLog	2016-12-09 00:36:13 UTC (rev 209580)
+++ trunk/Source/WebKit2/ChangeLog	2016-12-09 00:44:05 UTC (rev 209581)
@@ -1,5 +1,11 @@
 2016-12-08  Anders Carlsson  
 
+Attempt to fix the iOS build.
+
+* Platform/IPC/mac/MachMessage.cpp:
+
+2016-12-08  Anders Carlsson  
+
 Defer sending Mach messages if the queue is full
 https://bugs.webkit.org/show_bug.cgi?id=165622
 rdar://problem/29518036


Modified: trunk/Source/WebKit2/Platform/IPC/mac/MachMessage.cpp (209580 => 209581)

--- trunk/Source/WebKit2/Platform/IPC/mac/MachMessage.cpp	2016-12-09 00:36:13 UTC (rev 209580)
+++ trunk/Source/WebKit2/Platform/IPC/mac/MachMessage.cpp	2016-12-09 00:44:05 UTC (rev 209581)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "MachMessage.h"
 
+#include 
+
 namespace IPC {
 
 std::unique_ptr MachMessage::create(size_t size)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [209575] trunk/Source

2016-12-08 Thread andersca
Title: [209575] trunk/Source








Revision 209575
Author ander...@apple.com
Date 2016-12-08 14:53:58 -0800 (Thu, 08 Dec 2016)


Log Message
Defer sending Mach messages if the queue is full
https://bugs.webkit.org/show_bug.cgi?id=165622
rdar://problem/29518036

Reviewed by Brady Eidson.

Source/WebKit2:

* Platform/IPC/Connection.cpp:
Include MachMessage.h so the Connection destructor can do its thing.

* Platform/IPC/Connection.h:
Add new members.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::platformInvalidate):
Null out the pending outgoing mach message.

(IPC::Connection::sendMessage):
New helper that will send a Mach message. If we time out, store the message in m_pendingOutgoingMachMessage.
When our send source will be triggered we'll try to send the message again.

(IPC::Connection::platformCanSendOutgoingMessages):
We can only send messages if we don't have a pending outgoing message.

(IPC::Connection::sendOutgoingMessage):
Call the newly added sendMessage function.

(IPC::Connection::initializeSendSource):
Add the DISPATCH_MACH_SEND_POSSIBLE mask (and DISPATCH_MACH_SEND_DEAD which was previously implicit).
In our event handler, check for DISPATCH_MACH_SEND_POSSIBLE and try to send the pending outgoing message again.

* Platform/IPC/mac/MachMessage.cpp:
(IPC::MachMessage::create):
Rename length to size.

(IPC::MachMessage::MachMessage):
Initialize m_shouldFreeDescriptors.

(IPC::MachMessage::~MachMessage):
Call mach_msg_destroy, which will free the descriptors.

(IPC::MachMessage::leakDescriptors):
Set m_shouldFreeDescriptors to false.

* Platform/IPC/mac/MachMessage.h:
(IPC::MachMessage::size):
(IPC::MachMessage::length): Deleted.

Source/WTF:

Add new SPI.

* wtf/spi/darwin/XPCSPI.h:

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/spi/darwin/XPCSPI.h
trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Platform/IPC/Connection.cpp
trunk/Source/WebKit2/Platform/IPC/Connection.h
trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm
trunk/Source/WebKit2/Platform/IPC/mac/MachMessage.cpp
trunk/Source/WebKit2/Platform/IPC/mac/MachMessage.h




Diff

Modified: trunk/Source/WTF/ChangeLog (209574 => 209575)

--- trunk/Source/WTF/ChangeLog	2016-12-08 22:52:37 UTC (rev 209574)
+++ trunk/Source/WTF/ChangeLog	2016-12-08 22:53:58 UTC (rev 209575)
@@ -1,3 +1,15 @@
+2016-12-08  Anders Carlsson  
+
+Defer sending Mach messages if the queue is full
+https://bugs.webkit.org/show_bug.cgi?id=165622
+rdar://problem/29518036
+
+Reviewed by Brady Eidson.
+
+Add new SPI.
+
+* wtf/spi/darwin/XPCSPI.h:
+
 2016-12-06  Filip Pizlo  
 
 Concurrent GC should be stable enough to land enabled on X86_64


Modified: trunk/Source/WTF/wtf/spi/darwin/XPCSPI.h (209574 => 209575)

--- trunk/Source/WTF/wtf/spi/darwin/XPCSPI.h	2016-12-08 22:52:37 UTC (rev 209574)
+++ trunk/Source/WTF/wtf/spi/darwin/XPCSPI.h	2016-12-08 22:53:58 UTC (rev 209575)
@@ -23,8 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef XPCSPI_h
-#define XPCSPI_h
+#pragma once
 
 #include 
 #include 
@@ -77,6 +76,10 @@
 
 #if USE(APPLE_INTERNAL_SDK)
 #include 
+#else
+enum {
+DISPATCH_MACH_SEND_POSSIBLE = 0x8,
+};
 #endif
 
 WTF_EXTERN_C_BEGIN
@@ -157,5 +160,3 @@
 #endif
 
 WTF_EXTERN_C_END
-
-#endif // XPCSPI_h


Modified: trunk/Source/WebKit2/ChangeLog (209574 => 209575)

--- trunk/Source/WebKit2/ChangeLog	2016-12-08 22:52:37 UTC (rev 209574)
+++ trunk/Source/WebKit2/ChangeLog	2016-12-08 22:53:58 UTC (rev 209575)
@@ -1,3 +1,52 @@
+2016-12-08  Anders Carlsson  
+
+Defer sending Mach messages if the queue is full
+https://bugs.webkit.org/show_bug.cgi?id=165622
+rdar://problem/29518036
+
+Reviewed by Brady Eidson.
+
+* Platform/IPC/Connection.cpp:
+Include MachMessage.h so the Connection destructor can do its thing.
+
+* Platform/IPC/Connection.h:
+Add new members.
+
+* Platform/IPC/mac/ConnectionMac.mm:
+(IPC::Connection::platformInvalidate):
+Null out the pending outgoing mach message.
+
+(IPC::Connection::sendMessage):
+New helper that will send a Mach message. If we time out, store the message in m_pendingOutgoingMachMessage.
+When our send source will be triggered we'll try to send the message again.
+
+(IPC::Connection::platformCanSendOutgoingMessages):
+We can only send messages if we don't have a pending outgoing message.
+
+(IPC::Connection::sendOutgoingMessage):
+Call the newly added sendMessage function.
+
+(IPC::Connection::initializeSendSource):
+Add the DISPATCH_MACH_SEND_POSSIBLE mask (and DISPATCH_MACH_SEND_DEAD which was previously implicit).
+In our event handler, check for DISPATCH_MACH_SEND_POSSIBLE and try to send the pending outgoing message again.
+
+* Platform/IPC/mac/MachMessage.cpp:
+(IPC::MachMessage::create):
+Rename lengt

[webkit-changes] [209483] trunk/Source/WebKit2

2016-12-07 Thread andersca
Title: [209483] trunk/Source/WebKit2








Revision 209483
Author ander...@apple.com
Date 2016-12-07 14:44:19 -0800 (Wed, 07 Dec 2016)


Log Message
Fix build.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::open):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (209482 => 209483)

--- trunk/Source/WebKit2/ChangeLog	2016-12-07 22:36:46 UTC (rev 209482)
+++ trunk/Source/WebKit2/ChangeLog	2016-12-07 22:44:19 UTC (rev 209483)
@@ -1,5 +1,12 @@
 2016-12-07  Anders Carlsson  
 
+Fix build.
+
+* Platform/IPC/mac/ConnectionMac.mm:
+(IPC::Connection::open):
+
+2016-12-07  Anders Carlsson  
+
 Rename the connection sources to better indicate what data direction they are used for
 https://bugs.webkit.org/show_bug.cgi?id=165548
 


Modified: trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm (209482 => 209483)

--- trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2016-12-07 22:36:46 UTC (rev 209482)
+++ trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2016-12-07 22:44:19 UTC (rev 209483)
@@ -231,7 +231,7 @@
 
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000
 if (m_exceptionPort) {
-m_exceptionPortDataAvailableSource = createDataAvailableSource(m_exceptionPort, m_connectionQueue, [connection] {
+m_exceptionPortDataAvailableSource = createReceiveSource(m_exceptionPort, m_connectionQueue, [connection] {
 connection->exceptionSourceEventHandler();
 });
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [209481] trunk/Source/WebKit2

2016-12-07 Thread andersca
Title: [209481] trunk/Source/WebKit2








Revision 209481
Author ander...@apple.com
Date 2016-12-07 14:30:58 -0800 (Wed, 07 Dec 2016)


Log Message
Rename the connection sources to better indicate what data direction they are used for
https://bugs.webkit.org/show_bug.cgi?id=165548

Reviewed by Tim Horton.

* Platform/IPC/Connection.h:
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::platformInvalidate):
(IPC::Connection::platformInitialize):
(IPC::createReceiveSource):
(IPC::Connection::initializeSendSource):
(IPC::Connection::receiveSourceEventHandler):
(IPC::createDataAvailableSource): Deleted.
(IPC::Connection::initializeDeadNameSource): Deleted.
Rename m_deadNameSource to m_sendSource, and m_receivePortDataAvailableSource to m_receiveSource.

(IPC::Connection::open):
Initialize the send source before we attempt to send a first message.

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Platform/IPC/Connection.h
trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (209480 => 209481)

--- trunk/Source/WebKit2/ChangeLog	2016-12-07 22:28:58 UTC (rev 209480)
+++ trunk/Source/WebKit2/ChangeLog	2016-12-07 22:30:58 UTC (rev 209481)
@@ -1,3 +1,24 @@
+2016-12-07  Anders Carlsson  
+
+Rename the connection sources to better indicate what data direction they are used for
+https://bugs.webkit.org/show_bug.cgi?id=165548
+
+Reviewed by Tim Horton.
+
+* Platform/IPC/Connection.h:
+* Platform/IPC/mac/ConnectionMac.mm:
+(IPC::Connection::platformInvalidate):
+(IPC::Connection::platformInitialize):
+(IPC::createReceiveSource):
+(IPC::Connection::initializeSendSource):
+(IPC::Connection::receiveSourceEventHandler):
+(IPC::createDataAvailableSource): Deleted.
+(IPC::Connection::initializeDeadNameSource): Deleted.
+Rename m_deadNameSource to m_sendSource, and m_receivePortDataAvailableSource to m_receiveSource.
+
+(IPC::Connection::open):
+Initialize the send source before we attempt to send a first message.
+
 2016-12-07  Simon Fraser  
 
 Fix use of enum in a WK2 C SPI header.


Modified: trunk/Source/WebKit2/Platform/IPC/Connection.h (209480 => 209481)

--- trunk/Source/WebKit2/Platform/IPC/Connection.h	2016-12-07 22:28:58 UTC (rev 209480)
+++ trunk/Source/WebKit2/Platform/IPC/Connection.h	2016-12-07 22:30:58 UTC (rev 209481)
@@ -312,13 +312,13 @@
 #elif OS(DARWIN)
 // Called on the connection queue.
 void receiveSourceEventHandler();
-void initializeDeadNameSource();
+void initializeSendSource();
 
 mach_port_t m_sendPort;
-dispatch_source_t m_deadNameSource;
+dispatch_source_t m_sendSource;
 
 mach_port_t m_receivePort;
-dispatch_source_t m_receivePortDataAvailableSource;
+dispatch_source_t m_receiveSource;
 
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000
 void exceptionSourceEventHandler();


Modified: trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm (209480 => 209481)

--- trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2016-12-07 22:28:58 UTC (rev 209480)
+++ trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2016-12-07 22:30:58 UTC (rev 209481)
@@ -132,14 +132,14 @@
 ASSERT(m_receivePort);
 
 // Unregister our ports.
-dispatch_source_cancel(m_deadNameSource);
-dispatch_release(m_deadNameSource);
-m_deadNameSource = 0;
+dispatch_source_cancel(m_sendSource);
+dispatch_release(m_sendSource);
+m_sendSource = 0;
 m_sendPort = MACH_PORT_NULL;
 
-dispatch_source_cancel(m_receivePortDataAvailableSource);
-dispatch_release(m_receivePortDataAvailableSource);
-m_receivePortDataAvailableSource = 0;
+dispatch_source_cancel(m_receiveSource);
+dispatch_release(m_receiveSource);
+m_receiveSource = 0;
 m_receivePort = MACH_PORT_NULL;
 
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000
@@ -173,14 +173,14 @@
 m_sendPort = identifier.port;
 }
 
-m_deadNameSource = nullptr;
-m_receivePortDataAvailableSource = nullptr;
+m_sendSource = nullptr;
+m_receiveSource = nullptr;
 
 m_xpcConnection = identifier.xpcConnection;
 }
 
 template
-static dispatch_source_t createDataAvailableSource(mach_port_t receivePort, WorkQueue& workQueue, Function&& function)
+static dispatch_source_t createReceiveSource(mach_port_t receivePort, WorkQueue& workQueue, Function&& function)
 {
 dispatch_source_t source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MACH_RECV, receivePort, 0, workQueue.dispatchQueue());
 dispatch_source_set_event_handler(source, function);
@@ -215,9 +215,9 @@
 auto encoder = std::make_unique("IPC", "InitializeConnection", 0);
 encoder->encode(MachPort(m_receivePort, MACH_MSG_TYPE_MAKE_SEND));
 
+initializeSendSource();
+
 sendMessage(WTFMove(encoder), { });
-
-initializeDeadNameSource();
 }
 
  

[webkit-changes] [209418] trunk/Source/WebKit2

2016-12-06 Thread andersca
Title: [209418] trunk/Source/WebKit2








Revision 209418
Author ander...@apple.com
Date 2016-12-06 13:59:51 -0800 (Tue, 06 Dec 2016)


Log Message
Add a new MachMessage class and use it for sending outgoing messages
https://bugs.webkit.org/show_bug.cgi?id=165484

Reviewed by Sam Weinig.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendOutgoingMessage):
Instead of trying to randomly use memory from the stack as well as using mmap for the message data for out of line messages
(which makes no sense at all, since the body data is already mmapped), just always create a MachMessage object and use it.

(IPC::machMessageSize): Deleted.
This has been moved to MachMessage::messageSize().

* Platform/IPC/mac/MachMessage.cpp: Added.
(IPC::MachMessage::create):
Allocate extra memory to store the actual buffer.

(IPC::MachMessage::MachMessage):
Initialize variables. m_size isn't really used right now, but will be in a subsequent patch.

(IPC::MachMessage::header):
Return the header.

* Platform/IPC/mac/MachMessage.h: Added.
(IPC::MachMessage::length):

* WebKit2.xcodeproj/project.pbxproj:
Add new files.

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj


Added Paths

trunk/Source/WebKit2/Platform/IPC/mac/MachMessage.cpp
trunk/Source/WebKit2/Platform/IPC/mac/MachMessage.h




Diff

Modified: trunk/Source/WebKit2/ChangeLog (209417 => 209418)

--- trunk/Source/WebKit2/ChangeLog	2016-12-06 21:52:18 UTC (rev 209417)
+++ trunk/Source/WebKit2/ChangeLog	2016-12-06 21:59:51 UTC (rev 209418)
@@ -1,3 +1,34 @@
+2016-12-06  Anders Carlsson  
+
+Add a new MachMessage class and use it for sending outgoing messages
+https://bugs.webkit.org/show_bug.cgi?id=165484
+
+Reviewed by Sam Weinig.
+
+* Platform/IPC/mac/ConnectionMac.mm:
+(IPC::Connection::sendOutgoingMessage):
+Instead of trying to randomly use memory from the stack as well as using mmap for the message data for out of line messages
+(which makes no sense at all, since the body data is already mmapped), just always create a MachMessage object and use it.
+
+(IPC::machMessageSize): Deleted.
+This has been moved to MachMessage::messageSize().
+
+* Platform/IPC/mac/MachMessage.cpp: Added.
+(IPC::MachMessage::create):
+Allocate extra memory to store the actual buffer.
+
+(IPC::MachMessage::MachMessage):
+Initialize variables. m_size isn't really used right now, but will be in a subsequent patch.
+
+(IPC::MachMessage::header):
+Return the header.
+
+* Platform/IPC/mac/MachMessage.h: Added.
+(IPC::MachMessage::length):
+
+* WebKit2.xcodeproj/project.pbxproj:
+Add new files.
+
 2016-12-06  Simon Fraser  
 
 Enable visual viewports by default on Mac, and iOS Wk2


Modified: trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm (209417 => 209418)

--- trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2016-12-06 21:52:18 UTC (rev 209417)
+++ trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2016-12-06 21:59:51 UTC (rev 209418)
@@ -28,6 +28,7 @@
 
 #include "DataReference.h"
 #include "ImportanceAssertion.h"
+#include "MachMessage.h"
 #include "MachPort.h"
 #include "MachUtilities.h"
 #include 
@@ -258,19 +259,6 @@
 return true;
 }
 
-static inline size_t machMessageSize(size_t bodySize, size_t numberOfPortDescriptors = 0, size_t numberOfOOLMemoryDescriptors = 0)
-{
-size_t size = sizeof(mach_msg_header_t) + bodySize;
-if (numberOfPortDescriptors || numberOfOOLMemoryDescriptors) {
-size += sizeof(mach_msg_body_t);
-if (numberOfPortDescriptors)
-size += (numberOfPortDescriptors * sizeof(mach_msg_port_descriptor_t));
-if (numberOfOOLMemoryDescriptors)
-size += (numberOfOOLMemoryDescriptors * sizeof(mach_msg_ool_descriptor_t));
-}
-return round_msg(size);
-}
-
 bool Connection::platformCanSendOutgoingMessages() const
 {
 return true;
@@ -288,7 +276,7 @@
 numberOfPortDescriptors++;
 }
 
-size_t messageSize = machMessageSize(encoder->bufferSize(), numberOfPortDescriptors, numberOfOOLMemoryDescriptors);
+size_t messageSize = MachMessage::messageSize(encoder->bufferSize(), numberOfPortDescriptors, numberOfOOLMemoryDescriptors);
 
 bool messageBodyIsOOL = false;
 if (messageSize > inlineMessageMaxSize) {
@@ -295,20 +283,14 @@
 messageBodyIsOOL = true;
 
 numberOfOOLMemoryDescriptors++;
-messageSize = machMessageSize(0, numberOfPortDescriptors, numberOfOOLMemoryDescriptors);
+messageSize = MachMessage::messageSize(0, numberOfPortDescriptors, numberOfOOLMemoryDescriptors);
 }
 
-char stackBuffer[inlineMessageMaxSize];
-char* buffer = &stackBuffer[0];
-if (messageSize > inlineMessageMaxSize) {
-buffer = (char*)mmap(0, 

[webkit-changes] [209407] trunk/Source/WebKit2

2016-12-06 Thread andersca
Title: [209407] trunk/Source/WebKit2








Revision 209407
Author ander...@apple.com
Date 2016-12-06 11:20:19 -0800 (Tue, 06 Dec 2016)


Log Message
Don't memcpy out of line data
https://bugs.webkit.org/show_bug.cgi?id=165434

Reviewed by Sam Weinig.

Change the Decoder constructor to take a buffer deallocator parameter. If the buffer deallocator is null, the
data will be copied as before. Otherwise, the memory will be adopted by the Decoder object, and will be deallocated
by invoking the data deallocator.

* Platform/IPC/Decoder.cpp:
(IPC::copyBuffer):
Add a new helper.

(IPC::Decoder::Decoder):
Copy the buffer if the deallocator is null.

(IPC::Decoder::~Decoder):
Invoke the deallocator or call fastFree if it is null.

(IPC::Decoder::unwrapForTesting):
Update constructor.

(IPC::roundUpToAlignment):
(IPC::Decoder::alignBufferPosition):
(IPC::Decoder::decodeVariableLengthByteArray):
(IPC::decodeValueFromBuffer):
Change all these to deal with const pointers.

* Platform/IPC/Decoder.h:
Add new members.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::createMessageDecoder):
When we have out of line data, pass a deallocator that calls vm_deallocate, instead of copying the data
and then immediately throwing the original away.

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Platform/IPC/Decoder.cpp
trunk/Source/WebKit2/Platform/IPC/Decoder.h
trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (209406 => 209407)

--- trunk/Source/WebKit2/ChangeLog	2016-12-06 19:07:56 UTC (rev 209406)
+++ trunk/Source/WebKit2/ChangeLog	2016-12-06 19:20:19 UTC (rev 209407)
@@ -1,3 +1,41 @@
+2016-12-05  Anders Carlsson  
+
+Don't memcpy out of line data
+https://bugs.webkit.org/show_bug.cgi?id=165434
+
+Reviewed by Sam Weinig.
+
+Change the Decoder constructor to take a buffer deallocator parameter. If the buffer deallocator is null, the
+data will be copied as before. Otherwise, the memory will be adopted by the Decoder object, and will be deallocated
+by invoking the data deallocator.
+
+* Platform/IPC/Decoder.cpp:
+(IPC::copyBuffer):
+Add a new helper.
+
+(IPC::Decoder::Decoder):
+Copy the buffer if the deallocator is null.
+
+(IPC::Decoder::~Decoder):
+Invoke the deallocator or call fastFree if it is null.
+
+(IPC::Decoder::unwrapForTesting):
+Update constructor.
+
+(IPC::roundUpToAlignment):
+(IPC::Decoder::alignBufferPosition):
+(IPC::Decoder::decodeVariableLengthByteArray):
+(IPC::decodeValueFromBuffer):
+Change all these to deal with const pointers.
+
+* Platform/IPC/Decoder.h:
+Add new members.
+
+* Platform/IPC/mac/ConnectionMac.mm:
+(IPC::createMessageDecoder):
+When we have out of line data, pass a deallocator that calls vm_deallocate, instead of copying the data
+and then immediately throwing the original away.
+
 2016-12-06  Tim Horton  
 
 Almost half-second stall scrolling apple.com because of synchronous getPositionInformation


Modified: trunk/Source/WebKit2/Platform/IPC/Decoder.cpp (209406 => 209407)

--- trunk/Source/WebKit2/Platform/IPC/Decoder.cpp	2016-12-06 19:07:56 UTC (rev 209406)
+++ trunk/Source/WebKit2/Platform/IPC/Decoder.cpp	2016-12-06 19:20:19 UTC (rev 209407)
@@ -36,12 +36,23 @@
 
 namespace IPC {
 
-Decoder::Decoder(const DataReference& buffer, Vector attachments)
+static const uint8_t* copyBuffer(const uint8_t* buffer, size_t bufferSize)
 {
-initialize(buffer.data(), buffer.size());
+auto bufferCopy = static_cast(fastMalloc(bufferSize));
+memcpy(bufferCopy, buffer, bufferSize);
 
-m_attachments = WTFMove(attachments);
+return bufferCopy;
+}
 
+Decoder::Decoder(const uint8_t* buffer, size_t bufferSize, void (*bufferDeallocator)(const uint8_t*, size_t), Vector attachments)
+: m_buffer { bufferDeallocator ? buffer : copyBuffer(buffer, bufferSize) }
+, m_bufferPos { m_buffer }
+, m_bufferEnd { m_buffer + bufferSize }
+, m_bufferDeallocator { bufferDeallocator }
+, m_attachments { WTFMove(attachments) }
+{
+ASSERT(!(reinterpret_cast(m_buffer) % alignof(uint64_t)));
+
 if (!decode(m_messageFlags))
 return;
 
@@ -58,7 +69,12 @@
 Decoder::~Decoder()
 {
 ASSERT(m_buffer);
-fastFree(m_buffer);
+
+if (m_bufferDeallocator)
+m_bufferDeallocator(m_buffer, m_bufferEnd - m_buffer);
+else
+fastFree(const_cast(m_buffer));
+
 // FIXME: We need to dispose of the mach ports in cases of failure.
 
 #if HAVE(QOS_CLASSES)
@@ -103,10 +119,10 @@
 if (!decoder.decode(wrappedMessage))
 return nullptr;
 
-return std::make_unique(wrappedMessage, WTFMove(attachments));
+return std::make_unique(wrappedMessage.data(), wrappedMessage.size(), nullptr, WTFMove(attachments));
 }
 
-static inline uint8_t* roundUpToAlignment(uint8_t* pt

[webkit-changes] [208914] trunk/Source/WebCore

2016-11-18 Thread andersca
Title: [208914] trunk/Source/WebCore








Revision 208914
Author ander...@apple.com
Date 2016-11-18 18:45:25 -0800 (Fri, 18 Nov 2016)


Log Message
Rename the 'other' Apple Pay Button type to 'donate'
https://bugs.webkit.org/show_bug.cgi?id=164978

Reviewed by Dean Jackson.

* DerivedSources.make:
* WebCorePrefix.h:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
* css/CSSValueKeywords.in:
* css/parser/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* rendering/RenderThemeCocoa.mm:
(WebCore::toPKPaymentButtonType):
* rendering/style/RenderStyleConstants.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/DerivedSources.make
trunk/Source/WebCore/WebCorePrefix.h
trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h
trunk/Source/WebCore/css/CSSValueKeywords.in
trunk/Source/WebCore/css/parser/CSSParser.cpp
trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp
trunk/Source/WebCore/rendering/RenderThemeCocoa.mm
trunk/Source/WebCore/rendering/style/RenderStyleConstants.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (208913 => 208914)

--- trunk/Source/WebCore/ChangeLog	2016-11-19 01:46:01 UTC (rev 208913)
+++ trunk/Source/WebCore/ChangeLog	2016-11-19 02:45:25 UTC (rev 208914)
@@ -1,3 +1,24 @@
+2016-11-18  Anders Carlsson  
+
+Rename the 'other' Apple Pay Button type to 'donate'
+https://bugs.webkit.org/show_bug.cgi?id=164978
+
+Reviewed by Dean Jackson.
+
+* DerivedSources.make:
+* WebCorePrefix.h:
+* css/CSSPrimitiveValueMappings.h:
+(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+(WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
+* css/CSSValueKeywords.in:
+* css/parser/CSSParser.cpp:
+(WebCore::isValidKeywordPropertyAndValue):
+* css/parser/CSSParserFastPaths.cpp:
+(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
+* rendering/RenderThemeCocoa.mm:
+(WebCore::toPKPaymentButtonType):
+* rendering/style/RenderStyleConstants.h:
+
 2016-11-18  Myles C. Maxfield  
 
 [WebGL2] Implement texStorage2D()


Modified: trunk/Source/WebCore/DerivedSources.make (208913 => 208914)

--- trunk/Source/WebCore/DerivedSources.make	2016-11-19 01:46:01 UTC (rev 208913)
+++ trunk/Source/WebCore/DerivedSources.make	2016-11-19 02:45:25 UTC (rev 208914)
@@ -833,8 +833,6 @@
 
 -include WebCoreDerivedSourcesAdditions.make
 
--include ApplePayWebCoreDerivedSourcesAdditions.make
-
 JS_BINDING_IDLS += $(ADDITIONAL_BINDING_IDLS)
 
 all : $(ADDITIONAL_BINDING_IDLS:%.idl=JS%.h)


Modified: trunk/Source/WebCore/WebCorePrefix.h (208913 => 208914)

--- trunk/Source/WebCore/WebCorePrefix.h	2016-11-19 01:46:01 UTC (rev 208913)
+++ trunk/Source/WebCore/WebCorePrefix.h	2016-11-19 02:45:25 UTC (rev 208914)
@@ -175,10 +175,6 @@
 #define delete ("if you use new/delete make sure to include config.h at the top of the file"()) 
 #endif
 
-#if USE(APPLE_INTERNAL_SDK) && __has_include()
-#include 
-#endif
-
 /* When C++ exceptions are disabled, the C++ library defines |try| and |catch|
  * to allow C++ code that expects exceptions to build. These definitions
  * interfere with Objective-C++ uses of Objective-C exception handlers, which


Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (208913 => 208914)

--- trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h	2016-11-19 01:46:01 UTC (rev 208913)
+++ trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h	2016-11-19 02:45:25 UTC (rev 208914)
@@ -5488,8 +5488,8 @@
 case ApplePayButtonType::SetUp:
 m_value.valueID = CSSValueSetUp;
 break;
-case ApplePayButtonType::Other:
-m_value.valueID = CSSValueOther;
+case ApplePayButtonType::Donate:
+m_value.valueID = CSSValueDonate;
 break;
 
 default:
@@ -5508,8 +5508,8 @@
 return ApplePayButtonType::Buy;
 case CSSValueSetUp:
 return ApplePayButtonType::SetUp;
-case CSSValueOther:
-return ApplePayButtonType::Other;
+case CSSValueDonate:
+return ApplePayButtonType::Donate;
 default:
 break;
 }


Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (208913 => 208914)

--- trunk/Source/WebCore/css/CSSValueKeywords.in	2016-11-19 01:46:01 UTC (rev 208913)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in	2016-11-19 02:45:25 UTC (rev 208914)
@@ -1292,7 +1292,7 @@
 plain
 buy
 set-up
-other
+donate
 #endif
 
 // font-synthesis


Modified: trunk/Source/WebCore/css/parser/CSSParser.cpp (208913 => 208914)

--- trunk/Source/WebCore/css/parser/CSSParser.cpp	2016-11-19 01:46:01 UTC (rev 208913)
+++ trunk/Source/WebCore/css/parser/CSSParser.cpp	2016-11-19 02:45:25 UTC (rev 208914)
@@ -1057,8 +1057,8 @@
 if (valueID == CSSValueWhite || valueID == CSSValueWhiteOutli

[webkit-changes] [208504] trunk/Source/WebCore

2016-11-09 Thread andersca
Title: [208504] trunk/Source/WebCore








Revision 208504
Author ander...@apple.com
Date 2016-11-09 15:51:28 -0800 (Wed, 09 Nov 2016)


Log Message
Fix STP build.

* WebCorePrefix.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/WebCorePrefix.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (208503 => 208504)

--- trunk/Source/WebCore/ChangeLog	2016-11-09 23:41:14 UTC (rev 208503)
+++ trunk/Source/WebCore/ChangeLog	2016-11-09 23:51:28 UTC (rev 208504)
@@ -1,3 +1,9 @@
+2016-11-09  Anders Carlsson  
+
+Fix STP build.
+
+* WebCorePrefix.h:
+
 2016-11-09  Simon Fraser  
 
 Implement visual-viewport based position:fixed handling for Mac async scrolling


Modified: trunk/Source/WebCore/WebCorePrefix.h (208503 => 208504)

--- trunk/Source/WebCore/WebCorePrefix.h	2016-11-09 23:41:14 UTC (rev 208503)
+++ trunk/Source/WebCore/WebCorePrefix.h	2016-11-09 23:51:28 UTC (rev 208504)
@@ -175,7 +175,7 @@
 #define delete ("if you use new/delete make sure to include config.h at the top of the file"()) 
 #endif
 
-#if USE(APPLE_INTERNAL_SDK)
+#if USE(APPLE_INTERNAL_SDK) && __has_include()
 #include 
 #endif
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [208392] trunk/Source/WebCore

2016-11-04 Thread andersca
Title: [208392] trunk/Source/WebCore








Revision 208392
Author ander...@apple.com
Date 2016-11-04 12:16:31 -0700 (Fri, 04 Nov 2016)


Log Message
Add new 'other' Apple Pay button style
https://bugs.webkit.org/show_bug.cgi?id=164384
rdar://problem/28302528

Reviewed by Dean Jackson.

* DerivedSources.make:
* WebCorePrefix.h:
Add extension points.

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
Add ApplePayButtonType::Other.

(WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
Add CSSValueOther.

* css/CSSValueKeywords.in:
Add other.

* css/parser/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
Add CSSValueOther.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
Add CSSValueOther.

* rendering/RenderThemeCocoa.mm:
(WebCore::toPKPaymentButtonType):
Handle ApplePayButtonType::Other.

* rendering/style/RenderStyleConstants.h:
Add ApplePayButtonType::Other.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/DerivedSources.make
trunk/Source/WebCore/WebCorePrefix.h
trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h
trunk/Source/WebCore/css/CSSValueKeywords.in
trunk/Source/WebCore/css/parser/CSSParser.cpp
trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp
trunk/Source/WebCore/rendering/RenderThemeCocoa.mm
trunk/Source/WebCore/rendering/style/RenderStyleConstants.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (208391 => 208392)

--- trunk/Source/WebCore/ChangeLog	2016-11-04 19:16:21 UTC (rev 208391)
+++ trunk/Source/WebCore/ChangeLog	2016-11-04 19:16:31 UTC (rev 208392)
@@ -1,3 +1,40 @@
+2016-11-03  Anders Carlsson  
+
+Add new 'other' Apple Pay button style
+https://bugs.webkit.org/show_bug.cgi?id=164384
+rdar://problem/28302528
+
+Reviewed by Dean Jackson.
+
+* DerivedSources.make:
+* WebCorePrefix.h:
+Add extension points.
+
+* css/CSSPrimitiveValueMappings.h:
+(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+Add ApplePayButtonType::Other.
+
+(WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
+Add CSSValueOther.
+
+* css/CSSValueKeywords.in:
+Add other.
+
+* css/parser/CSSParser.cpp:
+(WebCore::isValidKeywordPropertyAndValue):
+Add CSSValueOther.
+
+* css/parser/CSSParserFastPaths.cpp:
+(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
+Add CSSValueOther.
+
+* rendering/RenderThemeCocoa.mm:
+(WebCore::toPKPaymentButtonType):
+Handle ApplePayButtonType::Other.
+
+* rendering/style/RenderStyleConstants.h:
+Add ApplePayButtonType::Other.
+
 2016-11-04  Antti Koivisto  
 
 slotted() pseudo does not work with ID selector


Modified: trunk/Source/WebCore/DerivedSources.make (208391 => 208392)

--- trunk/Source/WebCore/DerivedSources.make	2016-11-04 19:16:21 UTC (rev 208391)
+++ trunk/Source/WebCore/DerivedSources.make	2016-11-04 19:16:31 UTC (rev 208392)
@@ -815,6 +815,8 @@
 
 -include WebCoreDerivedSourcesAdditions.make
 
+-include ApplePayWebCoreDerivedSourcesAdditions.make
+
 JS_BINDING_IDLS += $(ADDITIONAL_BINDING_IDLS)
 
 all : $(ADDITIONAL_BINDING_IDLS:%.idl=JS%.h)
@@ -919,6 +921,7 @@
 WEBCORE_CSS_PROPERTY_NAMES := $(WebCore)/css/CSSPropertyNames.in
 WEBCORE_CSS_VALUE_KEYWORDS := $(WebCore)/css/CSSValueKeywords.in
 WEBCORE_CSS_VALUE_KEYWORDS := $(WEBCORE_CSS_VALUE_KEYWORDS) $(WebCore)/css/SVGCSSValueKeywords.in
+WEBCORE_CSS_VALUE_KEYWORDS_DEFINES := $(FEATURE_DEFINES) $(ADDITIONAL_CSS_VALUE_KEYWORDS_DEFINES)
 
 CSSPropertyNames.h CSSPropertyNames.cpp StyleBuilder.cpp StylePropertyShorthandFunctions.h StylePropertyShorthandFunctions.cpp : makeprop.intermediate
 .INTERMEDIATE : makeprop.intermediate
@@ -930,7 +933,7 @@
 .INTERMEDIATE : makevalues.intermediate
 makevalues.intermediate : $(WEBCORE_CSS_VALUE_KEYWORDS) css/makevalues.pl bindings/scripts/preprocessor.pm $(PLATFORM_FEATURE_DEFINES)
 	$(PERL) -pe '' $(WEBCORE_CSS_VALUE_KEYWORDS) > CSSValueKeywords.in
-	$(PERL) "$(WebCore)/css/makevalues.pl" --defines "$(FEATURE_DEFINES)"
+	$(PERL) "$(WebCore)/css/makevalues.pl" --defines "$(WEBCORE_CSS_VALUE_KEYWORDS_DEFINES)"
 
 # 
 


Modified: trunk/Source/WebCore/WebCorePrefix.h (208391 => 208392)

--- trunk/Source/WebCore/WebCorePrefix.h	2016-11-04 19:16:21 UTC (rev 208391)
+++ trunk/Source/WebCore/WebCorePrefix.h	2016-11-04 19:16:31 UTC (rev 208392)
@@ -172,6 +172,10 @@
 #define delete ("if you use new/delete make sure to include config.h at the top of the file"()) 
 #endif
 
+#if USE(APPLE_INTERNAL_SDK)
+#include 
+#endif
+
 /* When C++ exceptions are disabled, the C++ library defines |try| and |catch|
  * to allow C++ code that expects exceptions to build. These definitions
  * interfere with Objective-C++ uses of Objective-C exception handlers, which


Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (208391 => 208392)

--- trun

[webkit-changes] [207774] trunk/Source/WebCore

2016-10-24 Thread andersca
Title: [207774] trunk/Source/WebCore








Revision 207774
Author ander...@apple.com
Date 2016-10-24 13:42:48 -0700 (Mon, 24 Oct 2016)


Log Message
Fix build with newer versions of clang
https://bugs.webkit.org/show_bug.cgi?id=163908
rdar://problem/28852016

Reviewed by Tim Horton.

Use the macros that names the soft-linked functions in such a way that they won't conflict with actual functions.

* platform/ios/PlatformScreenIOS.mm:
(WebCore::screenIsMonochrome):
(WebCore::screenHasInvertedColors):
(WebCore::screenSize):
(WebCore::availableScreenSize):
(WebCore::screenScaleFactor):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/ios/PlatformScreenIOS.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (207773 => 207774)

--- trunk/Source/WebCore/ChangeLog	2016-10-24 20:25:02 UTC (rev 207773)
+++ trunk/Source/WebCore/ChangeLog	2016-10-24 20:42:48 UTC (rev 207774)
@@ -1,3 +1,20 @@
+2016-10-24  Anders Carlsson  
+
+Fix build with newer versions of clang
+https://bugs.webkit.org/show_bug.cgi?id=163908
+rdar://problem/28852016
+
+Reviewed by Tim Horton.
+
+Use the macros that names the soft-linked functions in such a way that they won't conflict with actual functions.
+
+* platform/ios/PlatformScreenIOS.mm:
+(WebCore::screenIsMonochrome):
+(WebCore::screenHasInvertedColors):
+(WebCore::screenSize):
+(WebCore::availableScreenSize):
+(WebCore::screenScaleFactor):
+
 2016-10-24  Joseph Pecoraro  
 
 Remove unnecessary unused variable stubs


Modified: trunk/Source/WebCore/platform/ios/PlatformScreenIOS.mm (207773 => 207774)

--- trunk/Source/WebCore/platform/ios/PlatformScreenIOS.mm	2016-10-24 20:25:02 UTC (rev 207773)
+++ trunk/Source/WebCore/platform/ios/PlatformScreenIOS.mm	2016-10-24 20:42:48 UTC (rev 207774)
@@ -39,11 +39,11 @@
 #import "WebCoreSystemInterface.h"
 #import "Widget.h"
 
-SOFT_LINK_FRAMEWORK(UIKit)
-SOFT_LINK_CLASS(UIKit, UIApplication)
-SOFT_LINK_CLASS(UIKit, UIScreen)
-SOFT_LINK(UIKit, UIAccessibilityIsGrayscaleEnabled, BOOL, (void), ())
-SOFT_LINK(UIKit, UIAccessibilityIsInvertColorsEnabled, BOOL, (void), ())
+SOFT_LINK_FRAMEWORK_FOR_SOURCE(WebCore, UIKit)
+SOFT_LINK_CLASS_FOR_SOURCE(WebCore, UIKit, UIApplication)
+SOFT_LINK_CLASS_FOR_SOURCE(WebCore, UIKit, UIScreen)
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, UIKit, UIAccessibilityIsGrayscaleEnabled, BOOL, (void), ())
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, UIKit, UIAccessibilityIsInvertColorsEnabled, BOOL, (void), ())
 
 namespace WebCore {
 
@@ -61,12 +61,12 @@
 
 bool screenIsMonochrome(Widget*)
 {
-return UIAccessibilityIsGrayscaleEnabled();
+return softLinkUIKitUIAccessibilityIsGrayscaleEnabled();
 }
 
 bool screenHasInvertedColors()
 {
-return UIAccessibilityIsInvertColorsEnabled();
+return softLinkUIKitUIAccessibilityIsInvertColorsEnabled();
 }
 
 bool screenSupportsExtendedColor(Widget*)
@@ -131,28 +131,28 @@
 
 FloatSize screenSize()
 {
-if (deviceHasIPadCapability() && [[getUIApplicationClass() sharedApplication] _isClassic])
+if (deviceHasIPadCapability() && [[get_UIKit_UIApplicationClass() sharedApplication] _isClassic])
 return { 320, 480 };
-return FloatSize([[getUIScreenClass() mainScreen] _referenceBounds].size);
+return FloatSize([[get_UIKit_UIScreenClass() mainScreen] _referenceBounds].size);
 }
 
 FloatSize availableScreenSize()
 {
-if (deviceHasIPadCapability() && [[getUIApplicationClass() sharedApplication] _isClassic])
+if (deviceHasIPadCapability() && [[get_UIKit_UIApplicationClass() sharedApplication] _isClassic])
 return { 320, 480 };
-return FloatSize([getUIScreenClass() mainScreen].bounds.size);
+return FloatSize([get_UIKit_UIScreenClass() mainScreen].bounds.size);
 }
 
 float screenScaleFactor(UIScreen *screen)
 {
 if (!screen)
-screen = [getUIScreenClass() mainScreen];
+screen = [get_UIKit_UIScreenClass() mainScreen];
 
 CGFloat scale = screen.scale;
 
 // We can remove this clamping once  is fixed.
 const CGFloat maximumClassicScreenScaleFactor = 2;
-if ([[getUIApplicationClass() sharedApplication] _isClassic])
+if ([[get_UIKit_UIApplicationClass() sharedApplication] _isClassic])
 return std::min(scale, maximumClassicScreenScaleFactor);
 
 return scale;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [207580] trunk/Source/WebCore

2016-10-19 Thread andersca
Title: [207580] trunk/Source/WebCore








Revision 207580
Author ander...@apple.com
Date 2016-10-19 17:31:56 -0700 (Wed, 19 Oct 2016)


Log Message
Remove m_redirectURLs from HistoryItem
https://bugs.webkit.org/show_bug.cgi?id=163704

Reviewed by Dan Bernstein.

* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
(WebCore::HistoryItem::reset):
* history/HistoryItem.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/history/HistoryItem.cpp
trunk/Source/WebCore/history/HistoryItem.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (207579 => 207580)

--- trunk/Source/WebCore/ChangeLog	2016-10-19 23:55:30 UTC (rev 207579)
+++ trunk/Source/WebCore/ChangeLog	2016-10-20 00:31:56 UTC (rev 207580)
@@ -1,3 +1,15 @@
+2016-10-19  Anders Carlsson  
+
+Remove m_redirectURLs from HistoryItem
+https://bugs.webkit.org/show_bug.cgi?id=163704
+
+Reviewed by Dan Bernstein.
+
+* history/HistoryItem.cpp:
+(WebCore::HistoryItem::HistoryItem):
+(WebCore::HistoryItem::reset):
+* history/HistoryItem.h:
+
 2016-10-19  Joone Hur  
 
 Add a plain space instead of   between text nodes


Modified: trunk/Source/WebCore/history/HistoryItem.cpp (207579 => 207580)

--- trunk/Source/WebCore/history/HistoryItem.cpp	2016-10-19 23:55:30 UTC (rev 207579)
+++ trunk/Source/WebCore/history/HistoryItem.cpp	2016-10-20 00:31:56 UTC (rev 207580)
@@ -129,9 +129,6 @@
 m_children.reserveInitialCapacity(size);
 for (unsigned i = 0; i < size; ++i)
 m_children.uncheckedAppend(item.m_children[i]->copy());
-
-if (item.m_redirectURLs)
-m_redirectURLs = std::make_unique>(*item.m_redirectURLs);
 }
 
 Ref HistoryItem::copy() const
@@ -153,8 +150,6 @@
 m_lastVisitWasFailure = false;
 m_isTargetItem = false;
 
-m_redirectURLs = nullptr;
-
 m_itemSequenceNumber = generateSequenceNumber();
 
 m_stateObject = nullptr;


Modified: trunk/Source/WebCore/history/HistoryItem.h (207579 => 207580)

--- trunk/Source/WebCore/history/HistoryItem.h	2016-10-19 23:55:30 UTC (rev 207579)
+++ trunk/Source/WebCore/history/HistoryItem.h	2016-10-20 00:31:56 UTC (rev 207580)
@@ -227,8 +227,6 @@
 bool m_isTargetItem;
 bool m_wasRestoredFromSession { false };
 
-std::unique_ptr> m_redirectURLs;
-
 // If two HistoryItems have the same item sequence number, then they are
 // clones of one another.  Traversing history from one such HistoryItem to
 // another is a no-op.  HistoryItem clones are created for parent and






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [207508] trunk/Tools

2016-10-18 Thread andersca
Title: [207508] trunk/Tools








Revision 207508
Author ander...@apple.com
Date 2016-10-18 17:21:50 -0700 (Tue, 18 Oct 2016)


Log Message
Add an beforeunload alert to the WebKitLegacy MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=163634

Reviewed by Sam Weinig.

* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:]):

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/MiniBrowser/mac/WK1BrowserWindowController.m




Diff

Modified: trunk/Tools/ChangeLog (207507 => 207508)

--- trunk/Tools/ChangeLog	2016-10-19 00:20:53 UTC (rev 207507)
+++ trunk/Tools/ChangeLog	2016-10-19 00:21:50 UTC (rev 207508)
@@ -1,3 +1,13 @@
+2016-10-18  Anders Carlsson  
+
+Add an beforeunload alert to the WebKitLegacy MiniBrowser
+https://bugs.webkit.org/show_bug.cgi?id=163634
+
+Reviewed by Sam Weinig.
+
+* MiniBrowser/mac/WK1BrowserWindowController.m:
+(-[WK1BrowserWindowController webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:]):
+
 2016-10-18  Commit Queue  
 
 Unreviewed, rolling out r207443.


Modified: trunk/Tools/MiniBrowser/mac/WK1BrowserWindowController.m (207507 => 207508)

--- trunk/Tools/MiniBrowser/mac/WK1BrowserWindowController.m	2016-10-19 00:20:53 UTC (rev 207507)
+++ trunk/Tools/MiniBrowser/mac/WK1BrowserWindowController.m	2016-10-19 00:21:50 UTC (rev 207508)
@@ -371,4 +371,21 @@
 [alert release];
 }
 
+- (BOOL)webView:(WebView *)sender runBeforeUnloadConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame
+{
+NSAlert *alert = [[NSAlert alloc] init];
+
+alert.messageText = [NSString stringWithFormat:@"_javascript_ before unload dialog from %@.", frame.dataSource.request.URL.absoluteString];
+alert.informativeText = message;
+
+[alert addButtonWithTitle:@"Leave Page"];
+[alert addButtonWithTitle:@"Stay On Page"];
+
+NSModalResponse response = [alert runModal];
+
+[alert release];
+
+return response == NSAlertFirstButtonReturn;
+}
+
 @end






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [207495] trunk/Source/WebKit/win

2016-10-18 Thread andersca
Title: [207495] trunk/Source/WebKit/win








Revision 207495
Author ander...@apple.com
Date 2016-10-18 15:57:34 -0700 (Tue, 18 Oct 2016)


Log Message
Try to fix the Windows build.

* WebHistoryItem.cpp:
(WebHistoryItem::redirectURLs):

Modified Paths

trunk/Source/WebKit/win/ChangeLog
trunk/Source/WebKit/win/WebHistoryItem.cpp




Diff

Modified: trunk/Source/WebKit/win/ChangeLog (207494 => 207495)

--- trunk/Source/WebKit/win/ChangeLog	2016-10-18 22:33:35 UTC (rev 207494)
+++ trunk/Source/WebKit/win/ChangeLog	2016-10-18 22:57:34 UTC (rev 207495)
@@ -1,5 +1,12 @@
 2016-10-18  Anders Carlsson  
 
+Try to fix the Windows build.
+
+* WebHistoryItem.cpp:
+(WebHistoryItem::redirectURLs):
+
+2016-10-18  Anders Carlsson  
+
 Move some history specific HistoryItem code to WebHistoryItem
 https://bugs.webkit.org/show_bug.cgi?id=163567
 


Modified: trunk/Source/WebKit/win/WebHistoryItem.cpp (207494 => 207495)

--- trunk/Source/WebKit/win/WebHistoryItem.cpp	2016-10-18 22:33:35 UTC (rev 207494)
+++ trunk/Source/WebKit/win/WebHistoryItem.cpp	2016-10-18 22:57:34 UTC (rev 207495)
@@ -332,23 +332,10 @@
 return E_NOTIMPL;
 }
 
+// FIXME: This function should be removed from the IWebHistoryItem interface.
 HRESULT WebHistoryItem::redirectURLs(_COM_Outptr_opt_ IEnumVARIANT** urls)
 {
-if (!urls) {
-ASSERT_NOT_REACHED();
-return E_POINTER;
-}
-
-Vector* urlVector = m_historyItem->redirectURLs();
-if (!urlVector) {
-*urls = 0;
-return S_OK;
-}
-
-COMPtr > > enumVariant(AdoptCOM, COMEnumVariant >::createInstance(*urlVector));
-*urls = enumVariant.leakRef();
-
-return S_OK;
+return E_NOTIMPL;
 }
 
 // FIXME: This function should be removed from the IWebHistoryItem interface.






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [207493] trunk/Source

2016-10-18 Thread andersca
Title: [207493] trunk/Source








Revision 207493
Author ander...@apple.com
Date 2016-10-18 15:28:31 -0700 (Tue, 18 Oct 2016)


Log Message
Get rid of more WebHistoryItem cruft
https://bugs.webkit.org/show_bug.cgi?id=163623

Reviewed by Tim Horton.

Source/WebCore:

* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
* history/HistoryItem.h:
(WebCore::HistoryItem::setViewportArguments):
(WebCore::HistoryItem::bookmarkID): Deleted.
(WebCore::HistoryItem::setBookmarkID): Deleted.
(WebCore::HistoryItem::sharedLinkUniqueIdentifier): Deleted.
(WebCore::HistoryItem::setSharedLinkUniqueIdentifier): Deleted.

Source/WebKit/mac:

* History/WebHistoryItem.mm:
(-[WebHistoryItem initFromDictionaryRepresentation:]):
* History/WebHistoryItemPrivate.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/history/HistoryItem.cpp
trunk/Source/WebCore/history/HistoryItem.h
trunk/Source/WebKit/mac/ChangeLog
trunk/Source/WebKit/mac/History/WebHistoryItem.mm
trunk/Source/WebKit/mac/History/WebHistoryItemPrivate.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (207492 => 207493)

--- trunk/Source/WebCore/ChangeLog	2016-10-18 22:22:55 UTC (rev 207492)
+++ trunk/Source/WebCore/ChangeLog	2016-10-18 22:28:31 UTC (rev 207493)
@@ -1,3 +1,19 @@
+2016-10-18  Anders Carlsson  
+
+Get rid of more WebHistoryItem cruft
+https://bugs.webkit.org/show_bug.cgi?id=163623
+
+Reviewed by Tim Horton.
+
+* history/HistoryItem.cpp:
+(WebCore::HistoryItem::HistoryItem):
+* history/HistoryItem.h:
+(WebCore::HistoryItem::setViewportArguments):
+(WebCore::HistoryItem::bookmarkID): Deleted.
+(WebCore::HistoryItem::setBookmarkID): Deleted.
+(WebCore::HistoryItem::sharedLinkUniqueIdentifier): Deleted.
+(WebCore::HistoryItem::setSharedLinkUniqueIdentifier): Deleted.
+
 2016-10-18  Dave Hyatt  
 
 Fix Windows build.


Modified: trunk/Source/WebCore/history/HistoryItem.cpp (207492 => 207493)

--- trunk/Source/WebCore/history/HistoryItem.cpp	2016-10-18 22:22:55 UTC (rev 207492)
+++ trunk/Source/WebCore/history/HistoryItem.cpp	2016-10-18 22:28:31 UTC (rev 207493)
@@ -120,8 +120,6 @@
 , m_obscuredInset(item.m_obscuredInset)
 , m_scale(item.m_scale)
 , m_scaleIsInitial(item.m_scaleIsInitial)
-, m_bookmarkID(item.m_bookmarkID)
-, m_sharedLinkUniqueIdentifier(item.m_sharedLinkUniqueIdentifier)
 #endif
 {
 if (item.m_formData)


Modified: trunk/Source/WebCore/history/HistoryItem.h (207492 => 207493)

--- trunk/Source/WebCore/history/HistoryItem.h	2016-10-18 22:22:55 UTC (rev 207492)
+++ trunk/Source/WebCore/history/HistoryItem.h	2016-10-18 22:28:31 UTC (rev 207493)
@@ -192,11 +192,6 @@
 
 const ViewportArguments& viewportArguments() const { return m_viewportArguments; }
 void setViewportArguments(const ViewportArguments& viewportArguments) { m_viewportArguments = viewportArguments; }
-
-uint32_t bookmarkID() const { return m_bookmarkID; }
-void setBookmarkID(uint32_t bookmarkID) { m_bookmarkID = bookmarkID; }
-String sharedLinkUniqueIdentifier() const { return m_sharedLinkUniqueIdentifier; }
-void setSharedLinkUniqueIdentifier(const String& sharedLinkUniqueidentifier) { m_sharedLinkUniqueIdentifier = sharedLinkUniqueidentifier; }
 #endif
 
 void notifyChanged();
@@ -265,9 +260,6 @@
 float m_scale { 0 }; // Note that UIWebView looks for a non-zero value, so this has to start as 0.
 bool m_scaleIsInitial { false };
 ViewportArguments m_viewportArguments;
-
-uint32_t m_bookmarkID { 0 };
-String m_sharedLinkUniqueIdentifier;
 #endif
 
 #if PLATFORM(COCOA)


Modified: trunk/Source/WebKit/mac/ChangeLog (207492 => 207493)

--- trunk/Source/WebKit/mac/ChangeLog	2016-10-18 22:22:55 UTC (rev 207492)
+++ trunk/Source/WebKit/mac/ChangeLog	2016-10-18 22:28:31 UTC (rev 207493)
@@ -1,3 +1,14 @@
+2016-10-18  Anders Carlsson  
+
+Get rid of more WebHistoryItem cruft
+https://bugs.webkit.org/show_bug.cgi?id=163623
+
+Reviewed by Tim Horton.
+
+* History/WebHistoryItem.mm:
+(-[WebHistoryItem initFromDictionaryRepresentation:]):
+* History/WebHistoryItemPrivate.h:
+
 2016-10-18  Wenson Hsieh  
 
 Showing and hiding candidates list is very distracting after selecting word


Modified: trunk/Source/WebKit/mac/History/WebHistoryItem.mm (207492 => 207493)

--- trunk/Source/WebKit/mac/History/WebHistoryItem.mm	2016-10-18 22:22:55 UTC (rev 207492)
+++ trunk/Source/WebKit/mac/History/WebHistoryItem.mm	2016-10-18 22:28:31 UTC (rev 207493)
@@ -71,9 +71,6 @@
 static NSString *scaleIsInitialKey = @"scaleIsInitial";
 static NSString *scrollPointXKey = @"scrollPointX";
 static NSString *scrollPointYKey = @"scrollPointY";
-
-static NSString * const bookmarkIDKey = @"bookmarkID";
-static NSString * const sharedLinkUniqueIdentifierKey = @"sharedLinkUniqueIdentifier";
 #endif
 
 // Private keys used in the WebHistoryItem's dictionary representation.

[webkit-changes] [207482] trunk/Source

2016-10-18 Thread andersca
Title: [207482] trunk/Source








Revision 207482
Author ander...@apple.com
Date 2016-10-18 13:22:58 -0700 (Tue, 18 Oct 2016)


Log Message
Move some history specific HistoryItem code to WebHistoryItem
https://bugs.webkit.org/show_bug.cgi?id=163567

Reviewed by Tim Horton.

Source/WebCore:

* history/HistoryItem.cpp:
(WebCore::HistoryItem::addRedirectURL): Deleted.
(WebCore::HistoryItem::redirectURLs): Deleted.
(WebCore::HistoryItem::setRedirectURLs): Deleted.
* history/HistoryItem.h:

Source/WebKit/mac:

* History/HistoryPropertyList.mm:
(HistoryPropertyListWriter::writeHistoryItem):
* History/WebHistory.mm:
(-[WebHistory _visitedURL:withTitle:method:wasFailure:]):
* History/WebHistoryItem.mm:
(-[WebHistoryItem initFromDictionaryRepresentation:]):
* History/WebHistoryItemInternal.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(addRedirectURL):
(WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):

Source/WebKit/win:

Remove these, they aren't used.

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):
* WebHistory.cpp:
(WebHistory::visitedURL):
* WebHistoryItem.cpp:
(WebHistoryItem::initFromDictionaryRepresentation):
(WebHistoryItem::dictionaryRepresentation):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/history/HistoryItem.cpp
trunk/Source/WebCore/history/HistoryItem.h
trunk/Source/WebKit/mac/ChangeLog
trunk/Source/WebKit/mac/History/HistoryPropertyList.mm
trunk/Source/WebKit/mac/History/WebHistory.mm
trunk/Source/WebKit/mac/History/WebHistoryItem.mm
trunk/Source/WebKit/mac/History/WebHistoryItemInternal.h
trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
trunk/Source/WebKit/win/ChangeLog
trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
trunk/Source/WebKit/win/WebHistory.cpp
trunk/Source/WebKit/win/WebHistoryItem.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (207481 => 207482)

--- trunk/Source/WebCore/ChangeLog	2016-10-18 20:21:02 UTC (rev 207481)
+++ trunk/Source/WebCore/ChangeLog	2016-10-18 20:22:58 UTC (rev 207482)
@@ -1,3 +1,16 @@
+2016-10-17  Anders Carlsson  
+
+Move some history specific HistoryItem code to WebHistoryItem
+https://bugs.webkit.org/show_bug.cgi?id=163567
+
+Reviewed by Tim Horton.
+
+* history/HistoryItem.cpp:
+(WebCore::HistoryItem::addRedirectURL): Deleted.
+(WebCore::HistoryItem::redirectURLs): Deleted.
+(WebCore::HistoryItem::setRedirectURLs): Deleted.
+* history/HistoryItem.h:
+
 2016-10-18  Dave Hyatt  
 
 [CSS Parser] Get all the properties turned on


Modified: trunk/Source/WebCore/history/HistoryItem.cpp (207481 => 207482)

--- trunk/Source/WebCore/history/HistoryItem.cpp	2016-10-18 20:21:02 UTC (rev 207481)
+++ trunk/Source/WebCore/history/HistoryItem.cpp	2016-10-18 20:22:58 UTC (rev 207482)
@@ -479,27 +479,6 @@
 return equalIgnoringFragmentIdentifier(url(), document.url());
 }
 
-void HistoryItem::addRedirectURL(const String& url)
-{
-if (!m_redirectURLs)
-m_redirectURLs = std::make_unique>();
-
-// Our API allows us to store all the URLs in the redirect chain, but for
-// now we only have a use for the final URL.
-(*m_redirectURLs).resize(1);
-(*m_redirectURLs)[0] = url;
-}
-
-Vector* HistoryItem::redirectURLs() const
-{
-return m_redirectURLs.get();
-}
-
-void HistoryItem::setRedirectURLs(std::unique_ptr> redirectURLs)
-{
-m_redirectURLs = WTFMove(redirectURLs);
-}
-
 void HistoryItem::notifyChanged()
 {
 notifyHistoryItemChanged(this);


Modified: trunk/Source/WebCore/history/HistoryItem.h (207481 => 207482)

--- trunk/Source/WebCore/history/HistoryItem.h	2016-10-18 20:21:02 UTC (rev 207481)
+++ trunk/Source/WebCore/history/HistoryItem.h	2016-10-18 20:22:58 UTC (rev 207482)
@@ -148,10 +148,6 @@
 bool shouldDoSameDocumentNavigationTo(HistoryItem& otherItem) const;
 bool hasSameFrames(HistoryItem& otherItem) const;
 
-WEBCORE_EXPORT void addRedirectURL(const String&);
-WEBCORE_EXPORT Vector* redirectURLs() const;
-WEBCORE_EXPORT void setRedirectURLs(std::unique_ptr>);
-
 bool isCurrentDocument(Document&) const;
 
 #if PLATFORM(COCOA)


Modified: trunk/Source/WebKit/mac/ChangeLog (207481 => 207482)

--- trunk/Source/WebKit/mac/ChangeLog	2016-10-18 20:21:02 UTC (rev 207481)
+++ trunk/Source/WebKit/mac/ChangeLog	2016-10-18 20:22:58 UTC (rev 207482)
@@ -1,3 +1,21 @@
+2016-10-17  Anders Carlsson  
+
+Move some history specific HistoryItem code to WebHistoryItem
+https://bugs.webkit.org/show_bug.cgi?id=163567
+
+Reviewed by Tim Horton.
+
+* History/HistoryPropertyList.mm:
+(HistoryPropertyListWriter::writeHistoryItem):
+* History/WebHistory.mm:
+(-[WebHistory _visitedURL:withTitle:method:wasFailure:]):
+* History/WebHistoryItem.mm:
+(-[WebHistoryItem initFromDictionaryRepresentation:]):
+* History/WebHistoryItemInternal.h:
+* WebCoreSup

  1   2   3   4   5   6   7   8   9   10   >