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

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

Issue 102103002: Have HashMap<KeyType, AtomicString>::get() return a const reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use AtomicString::ConstructFromLiteral Created 7 years 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
« no previous file with comments | « Source/platform/network/HTTPHeaderMap.h ('k') | Source/platform/network/ResourceRequest.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 void HTTPHeaderMap::adopt(PassOwnPtr<CrossThreadHTTPHeaderMapData> data) 59 void HTTPHeaderMap::adopt(PassOwnPtr<CrossThreadHTTPHeaderMapData> data)
60 { 60 {
61 clear(); 61 clear();
62 size_t dataSize = data->size(); 62 size_t dataSize = data->size();
63 for (size_t index = 0; index < dataSize; ++index) { 63 for (size_t index = 0; index < dataSize; ++index) {
64 pair<String, String>& header = (*data)[index]; 64 pair<String, String>& header = (*data)[index];
65 set(AtomicString(header.first), AtomicString(header.second)); 65 set(AtomicString(header.first), AtomicString(header.second));
66 } 66 }
67 } 67 }
68 68
69 AtomicString HTTPHeaderMap::get(const AtomicString& name) const 69 const AtomicString& HTTPHeaderMap::get(const AtomicString& name) const
70 { 70 {
71 return HashMap<AtomicString, AtomicString, CaseFoldingHash>::get(name); 71 return HashMap<AtomicString, AtomicString, CaseFoldingHash>::get(name);
72 } 72 }
73 73
74 HTTPHeaderMap::AddResult HTTPHeaderMap::add(const AtomicString& name, const Atom icString& value) 74 HTTPHeaderMap::AddResult HTTPHeaderMap::add(const AtomicString& name, const Atom icString& value)
75 { 75 {
76 return HashMap<AtomicString, AtomicString, CaseFoldingHash>::add(name, value ); 76 return HashMap<AtomicString, AtomicString, CaseFoldingHash>::add(name, value );
77 } 77 }
78 78
79 // Adapter that allows the HashMap to take C strings as keys. 79 // Adapter that allows the HashMap to take C strings as keys.
(...skipping 26 matching lines...) Expand all
106 { 106 {
107 return find<CaseFoldingCStringTranslator>(name) != end(); 107 return find<CaseFoldingCStringTranslator>(name) != end();
108 } 108 }
109 109
110 HTTPHeaderMap::AddResult HTTPHeaderMap::add(const char* name, const AtomicString & value) 110 HTTPHeaderMap::AddResult HTTPHeaderMap::add(const char* name, const AtomicString & value)
111 { 111 {
112 return HashMap<AtomicString, AtomicString, CaseFoldingHash>::add<CaseFolding CStringTranslator>(name, value); 112 return HashMap<AtomicString, AtomicString, CaseFoldingHash>::add<CaseFolding CStringTranslator>(name, value);
113 } 113 }
114 114
115 } // namespace WebCore 115 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/platform/network/HTTPHeaderMap.h ('k') | Source/platform/network/ResourceRequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698