Title: [152608] trunk/Source/WebKit/mac
Revision
152608
Author
[email protected]
Date
2013-07-12 16:59:16 -0700 (Fri, 12 Jul 2013)

Log Message

Remove some dead stores pointed out by the clang static analyzer.
https://bugs.webkit.org/show_bug.cgi?id=118608

Reviewed by Anders Carlsson.

* Plugins/Hosted/NetscapePluginHostManager.mm:
(WebKit::NetscapePluginHostManager::instantiatePlugin):
kr is never read after this point, so there is no reason to assign to it.

* Plugins/WebBasePluginPackage.mm:
(-[WebBasePluginPackage getPluginInfoFromPLists]):
The extensions array is only used in the while loop. Move the declaration to the first place
it is used in the while loop. Since it is always reassigned at that location, and since it
is never read after the subsequent for loop, the assignment to an array containing the empty
string is never used. Remove it.
Similarly, the value of the description is always overwritten before used to assign to
mimeClassInfo.desc or to pluginInfo.desc, so the code to assign it to the empty string is
never used. Remove it.

* WebView/WebTextCompletionController.mm:
(-[WebTextCompletionController _placePopupWindow:]):
maxWidth is never read (and never was since it was added in r7311) after it is used on the
line above to set windowFrame.size.width.

Modified Paths

Diff

Modified: trunk/Source/WebKit/mac/ChangeLog (152607 => 152608)


--- trunk/Source/WebKit/mac/ChangeLog	2013-07-12 23:35:15 UTC (rev 152607)
+++ trunk/Source/WebKit/mac/ChangeLog	2013-07-12 23:59:16 UTC (rev 152608)
@@ -1,3 +1,29 @@
+2013-07-12  Jessie Berlin  <[email protected]>
+
+        Remove some dead stores pointed out by the clang static analyzer.
+        https://bugs.webkit.org/show_bug.cgi?id=118608
+
+        Reviewed by Anders Carlsson.
+
+        * Plugins/Hosted/NetscapePluginHostManager.mm:
+        (WebKit::NetscapePluginHostManager::instantiatePlugin):
+        kr is never read after this point, so there is no reason to assign to it.
+
+        * Plugins/WebBasePluginPackage.mm:
+        (-[WebBasePluginPackage getPluginInfoFromPLists]):
+        The extensions array is only used in the while loop. Move the declaration to the first place
+        it is used in the while loop. Since it is always reassigned at that location, and since it
+        is never read after the subsequent for loop, the assignment to an array containing the empty
+        string is never used. Remove it.
+        Similarly, the value of the description is always overwritten before used to assign to
+        mimeClassInfo.desc or to pluginInfo.desc, so the code to assign it to the empty string is
+        never used. Remove it.
+
+        * WebView/WebTextCompletionController.mm:
+        (-[WebTextCompletionController _placePopupWindow:]):
+        maxWidth is never read (and never was since it was added in r7311) after it is used on the
+        line above to set windowFrame.size.width.
+
 2013-07-11  Dan Bernstein  <[email protected]>
 
         [mac] No API for getting the page visibility state of a WebView

Modified: trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm (152607 => 152608)


--- trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm	2013-07-12 23:35:15 UTC (rev 152607)
+++ trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm	2013-07-12 23:59:16 UTC (rev 152608)
@@ -264,7 +264,7 @@
         // Create a new instance.
         instance = NetscapePluginInstanceProxy::create(hostProxy, pluginView, fullFrame);
         requestID = instance->nextRequestID();
-        kr = _WKPHInstantiatePlugin(hostProxy->port(), requestID, (uint8_t*)[data bytes], [data length], instance->pluginID());
+        _WKPHInstantiatePlugin(hostProxy->port(), requestID, (uint8_t*)[data bytes], [data length], instance->pluginID());
     }
 
     std::auto_ptr<NetscapePluginInstanceProxy::InstantiatePluginReply> reply = instance->waitForReply<NetscapePluginInstanceProxy::InstantiatePluginReply>(requestID);

Modified: trunk/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm (152607 => 152608)


--- trunk/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm	2013-07-12 23:35:15 UTC (rev 152607)
+++ trunk/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm	2013-07-12 23:59:16 UTC (rev 152608)
@@ -212,8 +212,7 @@
 
     NSEnumerator *keyEnumerator = [MIMETypes keyEnumerator];
     NSDictionary *MIMEDictionary;
-    NSString *MIME, *description;
-    NSArray *extensions;
+    NSString *MIME;
 
     while ((MIME = [keyEnumerator nextObject]) != nil) {
         MIMEDictionary = [MIMETypes objectForKey:MIME];
@@ -225,7 +224,7 @@
 
         MimeClassInfo mimeClassInfo;
         
-        extensions = [[MIMEDictionary objectForKey:WebPluginExtensionsKey] _web_lowercaseStrings];
+        NSArray *extensions = [[MIMEDictionary objectForKey:WebPluginExtensionsKey] _web_lowercaseStrings];
         for (NSUInteger i = 0; i < [extensions count]; ++i) {
             // The DivX plug-in lists multiple extensions in a comma separated string instead of using
             // multiple array elements in the property list. Work around this here by splitting the
@@ -236,17 +235,11 @@
                 mimeClassInfo.extensions.append(extension);
         }
 
-        if ([extensions count] == 0)
-            extensions = [NSArray arrayWithObject:@""];
-
         mimeClassInfo.type = String(MIME).lower();
 
-        description = [MIMEDictionary objectForKey:WebPluginTypeDescriptionKey];
-        mimeClassInfo.desc = description;
+        mimeClassInfo.desc = [MIMEDictionary objectForKey:WebPluginTypeDescriptionKey];
 
         pluginInfo.mimes.append(mimeClassInfo);
-        if (!description)
-            description = @"";
     }
 
     NSString *filename = [(NSString *)path lastPathComponent];
@@ -257,7 +250,7 @@
         theName = filename;
     pluginInfo.name = theName;
 
-    description = [self _objectForInfoDictionaryKey:WebPluginDescriptionKey];
+    NSString *description = [self _objectForInfoDictionaryKey:WebPluginDescriptionKey];
     if (!description)
         description = filename;
     pluginInfo.desc = description;

Modified: trunk/Source/WebKit/mac/WebView/WebTextCompletionController.mm (152607 => 152608)


--- trunk/Source/WebKit/mac/WebView/WebTextCompletionController.mm	2013-07-12 23:35:15 UTC (rev 152607)
+++ trunk/Source/WebKit/mac/WebView/WebTextCompletionController.mm	2013-07-12 23:59:16 UTC (rev 152608)
@@ -148,7 +148,6 @@
         maxWidth = ceilf([NSWindow frameRectForContentRect:NSMakeRect(0.0f, 0.0f, maxWidth, 100.0f) styleMask:NSBorderlessWindowMask].size.width);
         maxWidth += 5.0f;
         windowFrame.size.width = std::max(maxWidth, windowFrame.size.width);
-        maxWidth = std::min<CGFloat>(400, windowFrame.size.width);
     }
     [_popupWindow setFrame:windowFrame display:NO];
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to