Commit d40e29d9 authored by mitz@apple.com's avatar mitz@apple.com

[Cocoa] WKBrowsingContextController's policy client implementation...

[Cocoa] WKBrowsingContextController's policy client implementation over-releases WKURLRequests and WKURLResponses
https://bugs.webkit.org/show_bug.cgi?id=124386

Reviewed by Sam Weinig.

* UIProcess/API/mac/WKBrowsingContextController.mm:
(setUpPagePolicyClient): Changed to release the Cocoa objects we copy out of the WK objects
passed into the client callbacks, but not the WK objects themselves, which are not owned by
the callbacks.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159322 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7c1eb76c
2013-11-14 Dan Bernstein <mitz@apple.com>
[Cocoa] WKBrowsingContextController's policy client implementation over-releases WKURLRequests and WKURLResponses
https://bugs.webkit.org/show_bug.cgi?id=124386
Reviewed by Sam Weinig.
* UIProcess/API/mac/WKBrowsingContextController.mm:
(setUpPagePolicyClient): Changed to release the Cocoa objects we copy out of the WK objects
passed into the client callbacks, but not the WK objects themselves, which are not owned by
the callbacks.
2013-11-14 Andy Estes <aestes@apple.com>
Replace calls to deprecated CFPropertyList functions in WebKit2
......
......@@ -631,7 +631,7 @@ static void setUpPagePolicyClient(WKBrowsingContextController *browsingContext,
WKActionNavigationTypeKey: @(navigationType),
WKActionModifierFlagsKey: @(modifiers),
WKActionMouseButtonKey: @(mouseButton),
WKActionURLRequestKey: autoreleased(request)
WKActionURLRequestKey: adoptNS(WKURLRequestCopyNSURLRequest(request)).get()
};
[browsingContext.policyDelegate browsingContextController:browsingContext decidePolicyForNavigationAction:actionDictionary decisionHandler:makePolicyDecisionBlock(listener)];
......@@ -648,7 +648,7 @@ static void setUpPagePolicyClient(WKBrowsingContextController *browsingContext,
WKActionNavigationTypeKey: @(navigationType),
WKActionModifierFlagsKey: @(modifiers),
WKActionMouseButtonKey: @(mouseButton),
WKActionURLRequestKey: autoreleased(request),
WKActionURLRequestKey: adoptNS(WKURLRequestCopyNSURLRequest(request)).get(),
WKActionFrameNameKey: toImpl(frameName)->wrapper()
};
......@@ -663,8 +663,8 @@ static void setUpPagePolicyClient(WKBrowsingContextController *browsingContext,
if ([browsingContext.policyDelegate respondsToSelector:@selector(browsingContextController:decidePolicyForResponseAction:decisionHandler:)]) {
NSDictionary *actionDictionary = @{
WKActionIsMainFrameKey: @(WKFrameIsMainFrame(frame)),
WKActionURLRequestKey: autoreleased(request),
WKActionURLResponseKey: autoreleased(response)
WKActionURLRequestKey: adoptNS(WKURLRequestCopyNSURLRequest(request)).get(),
WKActionURLResponseKey: adoptNS(WKURLResponseCopyNSURLResponse(response)).get()
};
[browsingContext.policyDelegate browsingContextController:browsingContext decidePolicyForResponseAction:actionDictionary decisionHandler:makePolicyDecisionBlock(listener)];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment