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

Side by Side Diff: Source/platform/network/ResourceResponse.cpp

Issue 138643003: Simpler return value of HashTable::add/HashMap:add and others (Closed)
Patch Set: Daily master update (now with base url?) Created 6 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) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 304
305 m_httpHeaderFields.set(name, value); 305 m_httpHeaderFields.set(name, value);
306 } 306 }
307 307
308 void ResourceResponse::addHTTPHeaderField(const AtomicString& name, const Atomic String& value) 308 void ResourceResponse::addHTTPHeaderField(const AtomicString& name, const Atomic String& value)
309 { 309 {
310 updateHeaderParsedState(name); 310 updateHeaderParsedState(name);
311 311
312 HTTPHeaderMap::AddResult result = m_httpHeaderFields.add(name, value); 312 HTTPHeaderMap::AddResult result = m_httpHeaderFields.add(name, value);
313 if (!result.isNewEntry) 313 if (!result.isNewEntry)
314 result.iterator->value = result.iterator->value + ", " + value; 314 result.storedValue->value = result.storedValue->value + ", " + value;
315 } 315 }
316 316
317 void ResourceResponse::clearHTTPHeaderField(const AtomicString& name) 317 void ResourceResponse::clearHTTPHeaderField(const AtomicString& name)
318 { 318 {
319 m_httpHeaderFields.remove(name); 319 m_httpHeaderFields.remove(name);
320 } 320 }
321 321
322 const HTTPHeaderMap& ResourceResponse::httpHeaderFields() const 322 const HTTPHeaderMap& ResourceResponse::httpHeaderFields() const
323 { 323 {
324 return m_httpHeaderFields; 324 return m_httpHeaderFields;
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 pos += nextCommaPosition - pos + 1; 674 pos += nextCommaPosition - pos + 1;
675 } else { 675 } else {
676 // Add last directive to map with empty string as value 676 // Add last directive to map with empty string as value
677 result.append(pair<String, String>(trimToNextSeparator(safeHeader.su bstring(pos, max - pos).stripWhiteSpace()), "")); 677 result.append(pair<String, String>(trimToNextSeparator(safeHeader.su bstring(pos, max - pos).stripWhiteSpace()), ""));
678 return; 678 return;
679 } 679 }
680 } 680 }
681 } 681 }
682 682
683 } 683 }
OLDNEW
« no previous file with comments | « Source/platform/network/ResourceRequest.cpp ('k') | Source/platform/network/WebSocketHandshakeRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698