[webkit-changes] cvs commit: WebKit ChangeLog

Tim tomernic at opensource.apple.com
Tue Nov 29 14:35:11 PST 2005


tomernic    05/11/29 14:35:11

  Modified:    WebView.subproj WebFrameView.m
               .        ChangeLog
  Log:
          Reviewed by John Sullivan, Eric Seidel
  
  	<rdar://problem/4340787> Safari sometimes creates 2 instances of plug-ins
  
          * WebView.subproj/WebFrameView.m:
          (-[WebFrameView _makeDocumentViewForDataSource:]):
  	Instead of creating a new WebDocumentView, use the WebDataSource's representation if it is a WebDocumentView
  	of the appropriate class.  Right now, this can only happen when the loading document is a standalone WebKit
  	plugin, because WebPluginDocumentView is both the WebDocumentView and the WebDocumentRepresentation for that
  	kind of page load.
  
  	I have verified that this does not affect other kinds of page loads; in all other cases, the representation
  	class is distinct from the document view class.
  
  	I talked with Chris Blumenberg about this change (he knows this code), and he agreed that this is the right
  	approach.
  
  Revision  Changes    Path
  1.189     +13 -1     WebKit/WebView.subproj/WebFrameView.m
  
  Index: WebFrameView.m
  ===================================================================
  RCS file: /cvs/root/WebKit/WebView.subproj/WebFrameView.m,v
  retrieving revision 1.188
  retrieving revision 1.189
  diff -u -r1.188 -r1.189
  --- WebFrameView.m	20 Sep 2005 08:33:04 -0000	1.188
  +++ WebFrameView.m	29 Nov 2005 22:34:55 -0000	1.189
  @@ -203,7 +203,19 @@
   -(NSView <WebDocumentView> *)_makeDocumentViewForDataSource:(WebDataSource *)dataSource
   {    
       Class viewClass = [[self class] _viewClassForMIMEType:[[dataSource response] MIMEType]];
  -    NSView <WebDocumentView> *documentView = viewClass ? [[viewClass alloc] init] : nil;
  +    NSView <WebDocumentView> *documentView;
  +    if (viewClass) {
  +        // If the dataSource's representation has already been created, and it is also the
  +        // same class as the desired documentView, then use it as the documentView instead
  +        // of creating another one (Radar 4340787).
  +        id <WebDocumentRepresentation> dataSourceRepresentation = [dataSource representation];
  +        if (dataSourceRepresentation && [dataSourceRepresentation class] == viewClass)
  +            documentView = (NSView <WebDocumentView> *)[dataSourceRepresentation retain];
  +        else
  +            documentView = [[viewClass alloc] init];
  +    } else
  +        documentView = nil;
  +    
       [self _setDocumentView:documentView];
       [documentView release];
       
  
  
  
  1.3377    +19 -0     WebKit/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebKit/ChangeLog,v
  retrieving revision 1.3376
  retrieving revision 1.3377
  diff -u -r1.3376 -r1.3377
  --- ChangeLog	28 Nov 2005 22:39:56 -0000	1.3376
  +++ ChangeLog	29 Nov 2005 22:34:57 -0000	1.3377
  @@ -1,3 +1,22 @@
  +2005-11-29  Tim Omernick  <timo at apple.com>
  +
  +        Reviewed by John Sullivan, Eric Seidel
  +
  +	<rdar://problem/4340787> Safari & Dashcode create 2 instances of the QC plug-in
  +	
  +        * WebView.subproj/WebFrameView.m:
  +        (-[WebFrameView _makeDocumentViewForDataSource:]):
  +	Instead of creating a new WebDocumentView, use the WebDataSource's representation if it is a WebDocumentView
  +	of the appropriate class.  Right now, this can only happen when the loading document is a standalone WebKit
  +	plugin, because WebPluginDocumentView is both the WebDocumentView and the WebDocumentRepresentation for that
  +	kind of page load.
  +	
  +	I have verified that this does not affect other kinds of page loads; in all other cases, the representation
  +	class is distinct from the document view class.
  +
  +	I talked with Chris Blumenberg about this change (he knows this code), and he agreed that this is the right
  +	approach.
  +
   2005-11-28  Alexey Proskuryakov  <ap at nypop.com>
   
           Reviewed by Darin. Committed by Maciej.
  
  
  



More information about the webkit-changes mailing list