Bug 40602

Summary: Use an array for extensions in MimeClassInfo
Product: WebKit Reporter: Anders Carlsson <andersca>
Component: New BugsAssignee: Anders Carlsson <andersca>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, eric, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Attachments:
Description Flags
Patch darin: review+

Anders Carlsson
Reported 2010-06-14 18:14:36 PDT
Use an array for extensions in MimeClassInfo
Attachments
Patch (8.38 KB, patch)
2010-06-14 18:16 PDT, Anders Carlsson
darin: review+
Anders Carlsson
Comment 1 2010-06-14 18:16:47 PDT
Anders Carlsson
Comment 2 2010-06-14 18:17:11 PDT
Please don't review this yet, I'd like to run it through the EWS bots.
Darin Adler
Comment 3 2010-06-14 18:20:39 PDT
Comment on attachment 58737 [details] Patch > + const Vector<String> &extensions = mimeClassInfo().extensions; The "&" here is in the wrong place. > + StringBuilder builder; > + for (size_t i = 0; i < extensions.size(); ++i) { > + if (i) > + builder.append(','); > + builder.append(extensions[i]); > + } > + return builder.toString(); Would Vector<UChar> do a better job? I never know which to use. > + NSArray *extensions = [plugin extensionsForMIMEType:MIME]; > + NSUInteger count = [extensions count]; > + for (NSUInteger i = 0; i < count; ++i) { > + NSString *extension = [extensions objectAtIndex:i]; > + mime.extensions.append(extension); > + } This is a lot like toStringVector in WebView.mm and WebEditorClient::getGuessesForWord in WebEditorClient.mm. I wish we had shared code to make NSArray of NSString into Vector<String> and vice versa. r=me
Anders Carlsson
Comment 4 2010-06-14 18:27:06 PDT
(In reply to comment #3) > (From update of attachment 58737 [details]) > > + const Vector<String> &extensions = mimeClassInfo().extensions; > > The "&" here is in the wrong place. > Fixed. > > Would Vector<UChar> do a better job? I never know which to use. I don't think it matters; this code is not performance sensitive. > This is a lot like toStringVector in WebView.mm and WebEditorClient::getGuessesForWord in WebEditorClient.mm. I wish we had shared code to make NSArray of NSString into Vector<String> and vice versa. I agree. However, in this case I think that it would be better to convert WebKit over to using WebCore types for its plug-in database. > > r=me Thanks!
Anders Carlsson
Comment 5 2010-06-14 18:30:40 PDT
WebKit Review Bot
Comment 6 2010-06-14 18:43:45 PDT
http://trac.webkit.org/changeset/61168 might have broken Chromium Linux Release
Note You need to log in before you can comment on or make changes to this bug.