Title: [158053] branches/safari-537.73-branch/Source/WebKit2

Diff

Modified: branches/safari-537.73-branch/Source/WebKit2/ChangeLog (158052 => 158053)


--- branches/safari-537.73-branch/Source/WebKit2/ChangeLog	2013-10-25 21:32:27 UTC (rev 158052)
+++ branches/safari-537.73-branch/Source/WebKit2/ChangeLog	2013-10-25 21:51:21 UTC (rev 158053)
@@ -1,3 +1,29 @@
+2013-10-25  Lucas Forschler  <[email protected]>
+
+        Merge r155153
+
+    2013-09-05  Alexey Proskuryakov  <[email protected]>
+
+            WKFullScreenWindowController extends lifetime of WKView, deleting it at a wrong time
+            https://bugs.webkit.org/show_bug.cgi?id=120792
+            <rdar://problem/14884666>
+
+            Reviewed by Jer Noble.
+
+            * UIProcess/API/mac/WKView.mm: (-[WKView fullScreenWindowController]):
+            Use a newly minted initializer for the controller.
+
+            * UIProcess/mac/WKFullScreenWindowController.h: Removed unused web view accessors.
+            Changed the class to take web view at initialization time.
+
+            * UIProcess/mac/WKFullScreenWindowController.mm:
+            (-[WKFullScreenWindowController initWithWindow:webView:]): Initialize the controller
+            inone step.
+            (-[WKFullScreenWindowController dealloc]): WebView is now a raw pointer, no need
+            to zero it.
+            (-[WKFullScreenWindowController close]): Make sure to not leave a dangling WKView
+            pointer (this method is indirectly but inevitably called when WKView is deallocated).
+
 2013-10-24  Lucas Forschler  <[email protected]>
 
         Merge r154647

Modified: branches/safari-537.73-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm (158052 => 158053)


--- branches/safari-537.73-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm	2013-10-25 21:32:27 UTC (rev 158052)
+++ branches/safari-537.73-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm	2013-10-25 21:51:21 UTC (rev 158053)
@@ -3001,10 +3001,9 @@
 
 - (WKFullScreenWindowController*)fullScreenWindowController
 {
-    if (!_data->_fullScreenWindowController) {
-        _data->_fullScreenWindowController = adoptNS([[WKFullScreenWindowController alloc] initWithWindow:[self createFullScreenWindow]]);
-        [_data->_fullScreenWindowController.get() setWebView:self];
-    }
+    if (!_data->_fullScreenWindowController)
+        _data->_fullScreenWindowController = adoptNS([[WKFullScreenWindowController alloc] initWithWindow:[self createFullScreenWindow] webView:self]);
+
     return _data->_fullScreenWindowController.get();
 }
 

Modified: branches/safari-537.73-branch/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h (158052 => 158053)


--- branches/safari-537.73-branch/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h	2013-10-25 21:32:27 UTC (rev 158052)
+++ branches/safari-537.73-branch/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h	2013-10-25 21:51:21 UTC (rev 158053)
@@ -46,7 +46,7 @@
 
 @interface WKFullScreenWindowController : NSWindowController<NSWindowDelegate> {
 @private
-    WKView *_webView;
+    WKView *_webView; // Cannot be retained, see <rdar://problem/14884666>.
     RetainPtr<WebCoreFullScreenPlaceholderView> _webViewPlaceholder;
     RetainPtr<WebWindowScaleAnimation> _scaleAnimation;
     RetainPtr<WebWindowFadeAnimation> _fadeAnimation;
@@ -60,8 +60,7 @@
     double _savedScale;
 }
 
-- (WKView*)webView;
-- (void)setWebView:(WKView*)webView;
+- (id)initWithWindow:(NSWindow *)window webView:(WKView *)webView;
 
 - (WebCoreFullScreenPlaceholderView*)webViewPlaceholder;
 

Modified: branches/safari-537.73-branch/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm (158052 => 158053)


--- branches/safari-537.73-branch/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2013-10-25 21:32:27 UTC (rev 158052)
+++ branches/safari-537.73-branch/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2013-10-25 21:51:21 UTC (rev 158053)
@@ -89,7 +89,7 @@
 
 #pragma mark -
 #pragma mark Initialization
-- (id)initWithWindow:(NSWindow *)window
+- (id)initWithWindow:(NSWindow *)window webView:(WKView *)webView
 {
     self = [super initWithWindow:window];
     if (!self)
@@ -97,13 +97,13 @@
     [window setDelegate:self];
     [window setCollectionBehavior:([window collectionBehavior] | NSWindowCollectionBehaviorFullScreenPrimary)];
     [self windowDidLoad];
+    _webView = webView;
     
     return self;
 }
 
 - (void)dealloc
 {
-    [self setWebView:nil];
     [[self window] setDelegate:nil];
     
     [NSObject cancelPreviousPerformRequestsWithTarget:self];
@@ -122,18 +122,6 @@
 #pragma mark -
 #pragma mark Accessors
 
-- (WKView*)webView
-{
-    return _webView;
-}
-
-- (void)setWebView:(WKView *)webView
-{
-    [webView retain];
-    [_webView release];
-    _webView = webView;
-}
-
 - (BOOL)isFullScreen
 {
     return _fullScreenState == WaitingToEnterFullScreen
@@ -443,6 +431,8 @@
     if (_fullScreenState == ExitingFullScreen)
         [self finishedExitFullScreenAnimation:YES];
 
+    _webView = nil;
+
     [super close];
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to