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

Side by Side Diff: third_party/WebKit/Source/platform/mhtml/MHTMLParser.cpp

Issue 2671933002: Migrate WTF::HashMap::add() to ::insert() (Closed)
Patch Set: rebase, add TODOs Created 3 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 unified diff | Download patch
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 break; // Empty line means end of key/value section. 103 break; // Empty line means end of key/value section.
104 if (line[0] == '\t') { 104 if (line[0] == '\t') {
105 value.append(line.substring(1)); 105 value.append(line.substring(1));
106 continue; 106 continue;
107 } 107 }
108 // New key/value, store the previous one if any. 108 // New key/value, store the previous one if any.
109 if (!key.isEmpty()) { 109 if (!key.isEmpty()) {
110 if (keyValuePairs.find(key) != keyValuePairs.end()) 110 if (keyValuePairs.find(key) != keyValuePairs.end())
111 DVLOG(1) << "Key duplicate found in MIME header. Key is '" << key 111 DVLOG(1) << "Key duplicate found in MIME header. Key is '" << key
112 << "', previous value replaced."; 112 << "', previous value replaced.";
113 keyValuePairs.add(key, value.toString().stripWhiteSpace()); 113 keyValuePairs.insert(key, value.toString().stripWhiteSpace());
114 key = String(); 114 key = String();
115 value.clear(); 115 value.clear();
116 } 116 }
117 size_t semiColonIndex = line.find(':'); 117 size_t semiColonIndex = line.find(':');
118 if (semiColonIndex == kNotFound) { 118 if (semiColonIndex == kNotFound) {
119 // This is not a key value pair, ignore. 119 // This is not a key value pair, ignore.
120 continue; 120 continue;
121 } 121 }
122 key = line.substring(0, semiColonIndex).lower().stripWhiteSpace(); 122 key = line.substring(0, semiColonIndex).lower().stripWhiteSpace();
123 value.append(line.substring(semiColonIndex + 1)); 123 value.append(line.substring(semiColonIndex + 1));
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 if (!contentID.startsWith('<') || !contentID.endsWith('>')) 379 if (!contentID.startsWith('<') || !contentID.endsWith('>'))
380 return KURL(); 380 return KURL();
381 381
382 StringBuilder uriBuilder; 382 StringBuilder uriBuilder;
383 uriBuilder.append("cid:"); 383 uriBuilder.append("cid:");
384 uriBuilder.append(contentID, 1, contentID.length() - 2); 384 uriBuilder.append(contentID, 1, contentID.length() - 2);
385 return KURL(KURL(), uriBuilder.toString()); 385 return KURL(KURL(), uriBuilder.toString());
386 } 386 }
387 387
388 } // namespace blink 388 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698