Changeset 85051 in webkit
- Timestamp:
- Apr 27, 2011 8:10:12 AM (13 years ago)
- Location:
- trunk/Source/WebKit/mac
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/mac/ChangeLog
r84991 r85051 1 2011-04-27 Yury Semikhatsky <yurys@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector 6 https://bugs.webkit.org/show_bug.cgi?id=44230 7 8 Use RetainPtr access inspected view from the inspector one to avoid inspected view being deleted before 9 inspector is closed. 10 11 * WebCoreSupport/WebInspectorClient.mm: store reference to inspected view in RetainPtr. Despite the removed 12 comment in initWithInspectedWebView this doesn't introduce cyclic reference since there are no retaining 13 pointers to the WebInspectorWindowController from the inspected page or from the WebInspectorClient. 14 There is only one reference to it from WebInspectorFrontendClient which is held by the inspector 15 front-end page. 16 17 Drive-by fix: removed several unused methods which are currently implemented in mac/WebInspector/WebInspector.mm 18 (-[WebInspectorWindowController initWithInspectedWebView:]): 19 (-[WebInspectorWindowController close]): 20 (-[WebInspectorWindowController showWindow:]): 21 (-[WebInspectorWindowController setAttachedWindowHeight:]): 22 (-[WebInspectorWindowController destroyInspectorView:]): 23 1 24 2011-04-26 Sam Weinig <sam@webkit.org> 2 25 -
trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
r85036 r85051 50 50 @interface WebInspectorWindowController : NSWindowController <NSWindowDelegate> { 51 51 @private 52 WebView *_inspectedWebView;52 RetainPtr<WebView> _inspectedWebView; 53 53 WebView *_webView; 54 54 WebInspectorFrontendClient* _frontendClient; … … 264 264 return nil; 265 265 266 // Don't retain to avoid a circular reference.267 266 _inspectedWebView = webView; 268 267 return self; … … 324 323 325 324 if (_attachedToInspectedWebView) { 326 if ([_inspectedWebView _isClosed])325 if ([_inspectedWebView.get() _isClosed]) 327 326 return; 328 327 329 328 [_webView removeFromSuperview]; 330 329 331 WebFrameView *frameView = [[_inspectedWebView mainFrame] frameView];330 WebFrameView *frameView = [[_inspectedWebView.get() mainFrame] frameView]; 332 331 NSRect frameViewRect = [frameView frame]; 333 332 … … 340 339 [frameView setFrame:frameViewRect]; 341 340 342 [_inspectedWebView displayIfNeeded];341 [_inspectedWebView.get() displayIfNeeded]; 343 342 } else 344 343 [super close]; … … 361 360 362 361 if (_shouldAttach) { 363 WebFrameView *frameView = [[_inspectedWebView mainFrame] frameView];362 WebFrameView *frameView = [[_inspectedWebView.get() mainFrame] frameView]; 364 363 365 364 [_webView removeFromSuperview]; 366 [_inspectedWebView addSubview:_webView positioned:NSWindowBelow relativeTo:(NSView *)frameView];365 [_inspectedWebView.get() addSubview:_webView positioned:NSWindowBelow relativeTo:(NSView *)frameView]; 367 366 368 367 [_webView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable | NSViewMaxYMargin)]; … … 432 431 return; 433 432 434 WebFrameView *frameView = [[_inspectedWebView mainFrame] frameView];433 WebFrameView *frameView = [[_inspectedWebView.get() mainFrame] frameView]; 435 434 NSRect frameViewRect = [frameView frame]; 436 435 … … 457 456 458 457 if (notifyInspectorController) { 459 if (Page* inspectedPage = [_inspectedWebView page])458 if (Page* inspectedPage = [_inspectedWebView.get() page]) 460 459 inspectedPage->inspectorController()->disconnectFrontend(); 461 460 … … 474 473 } 475 474 476 // MARK: -477 478 // These methods can be used by UI elements such as menu items and toolbar buttons when the inspector is the key window.479 480 // This method is really only implemented to keep any UI elements enabled.481 - (void)showWebInspector:(id)sender482 {483 [[_inspectedWebView inspector] show:sender];484 }485 486 - (void)showErrorConsole:(id)sender487 {488 [[_inspectedWebView inspector] showConsole:sender];489 }490 491 - (void)toggleDebuggingJavaScript:(id)sender492 {493 [[_inspectedWebView inspector] toggleDebuggingJavaScript:sender];494 }495 496 - (void)toggleProfilingJavaScript:(id)sender497 {498 [[_inspectedWebView inspector] toggleProfilingJavaScript:sender];499 }500 501 - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item502 {503 BOOL isMenuItem = [(id)item isKindOfClass:[NSMenuItem class]];504 if ([item action] == @selector(toggleDebuggingJavaScript:) && isMenuItem) {505 NSMenuItem *menuItem = (NSMenuItem *)item;506 if ([[_inspectedWebView inspector] isDebuggingJavaScript])507 [menuItem setTitle:UI_STRING_INTERNAL("Stop Debugging JavaScript", "title for Stop Debugging JavaScript menu item")];508 else509 [menuItem setTitle:UI_STRING_INTERNAL("Start Debugging JavaScript", "title for Start Debugging JavaScript menu item")];510 } else if ([item action] == @selector(toggleProfilingJavaScript:) && isMenuItem) {511 NSMenuItem *menuItem = (NSMenuItem *)item;512 if ([[_inspectedWebView inspector] isProfilingJavaScript])513 [menuItem setTitle:UI_STRING_INTERNAL("Stop Profiling JavaScript", "title for Stop Profiling JavaScript menu item")];514 else515 [menuItem setTitle:UI_STRING_INTERNAL("Start Profiling JavaScript", "title for Start Profiling JavaScript menu item")];516 }517 518 return YES;519 }520 521 475 @end
Note: See TracChangeset
for help on using the changeset viewer.