Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1451)

Unified Diff: third_party/WebKit/WebCore/platform/network/HTTPParsers.cpp

Issue 39293: WebKit merge 41447:41498 [third_party/WebKit] (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: remove CRLF Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/WebCore/platform/network/HTTPParsers.cpp
===================================================================
--- third_party/WebKit/WebCore/platform/network/HTTPParsers.cpp (revision 11154)
+++ third_party/WebKit/WebCore/platform/network/HTTPParsers.cpp (working copy)
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
* Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -131,18 +132,18 @@
String extractMIMETypeFromMediaType(const String& mediaType)
{
- String mimeType;
+ Vector<UChar, 64> mimeType;
unsigned length = mediaType.length();
+ mimeType.reserveCapacity(length);
for (unsigned offset = 0; offset < length; offset++) {
UChar c = mediaType[offset];
if (c == ';')
break;
else if (isSpaceOrNewline(c)) // FIXME: This seems wrong, " " is an invalid MIME type character according to RFC 2045. bug 8644
continue;
- // FIXME: This is a very slow way to build a string, given WebCore::String's implementation.
- mimeType += String(&c, 1);
+ mimeType.append(c);
}
- return mimeType;
+ return String(mimeType.data(), mimeType.size());
}
String extractCharsetFromMediaType(const String& mediaType)

Powered by Google App Engine
This is Rietveld 408576698