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

Side by Side Diff: Source/core/platform/network/MIMEHeader.cpp

Issue 23464095: WTF::notFound looks too much like a local variable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 // New key/value, store the previous one if any. 60 // New key/value, store the previous one if any.
61 if (!key.isEmpty()) { 61 if (!key.isEmpty()) {
62 if (keyValuePairs.find(key) != keyValuePairs.end()) 62 if (keyValuePairs.find(key) != keyValuePairs.end())
63 LOG_ERROR("Key duplicate found in MIME header. Key is '%s', prev ious value replaced.", key.ascii().data()); 63 LOG_ERROR("Key duplicate found in MIME header. Key is '%s', prev ious value replaced.", key.ascii().data());
64 keyValuePairs.add(key, value.toString().stripWhiteSpace()); 64 keyValuePairs.add(key, value.toString().stripWhiteSpace());
65 key = String(); 65 key = String();
66 value.clear(); 66 value.clear();
67 } 67 }
68 size_t semiColonIndex = line.find(':'); 68 size_t semiColonIndex = line.find(':');
69 if (semiColonIndex == notFound) { 69 if (semiColonIndex == kNotFound) {
70 // This is not a key value pair, ignore. 70 // This is not a key value pair, ignore.
71 continue; 71 continue;
72 } 72 }
73 key = line.substring(0, semiColonIndex).lower().stripWhiteSpace(); 73 key = line.substring(0, semiColonIndex).lower().stripWhiteSpace();
74 value.append(line.substring(semiColonIndex + 1)); 74 value.append(line.substring(semiColonIndex + 1));
75 } 75 }
76 // Store the last property if there is one. 76 // Store the last property if there is one.
77 if (!key.isEmpty()) 77 if (!key.isEmpty())
78 keyValuePairs.set(key, value.toString().stripWhiteSpace()); 78 keyValuePairs.set(key, value.toString().stripWhiteSpace());
79 return keyValuePairs; 79 return keyValuePairs;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 LOG_ERROR("Unknown encoding '%s' found in MIME header.", text.ascii().data() ); 129 LOG_ERROR("Unknown encoding '%s' found in MIME header.", text.ascii().data() );
130 return Unknown; 130 return Unknown;
131 } 131 }
132 132
133 MIMEHeader::MIMEHeader() 133 MIMEHeader::MIMEHeader()
134 : m_contentTransferEncoding(Unknown) 134 : m_contentTransferEncoding(Unknown)
135 { 135 {
136 } 136 }
137 137
138 } 138 }
OLDNEW
« no previous file with comments | « Source/core/platform/network/HTTPParsers.cpp ('k') | Source/core/platform/network/ParsedContentType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698