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

Side by Side Diff: Source/platform/network/ResourceRequest.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) 2003, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2009, 2012 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 233
234 void ResourceRequest::setPriority(ResourceLoadPriority priority) 234 void ResourceRequest::setPriority(ResourceLoadPriority priority)
235 { 235 {
236 m_priority = priority; 236 m_priority = priority;
237 } 237 }
238 238
239 void ResourceRequest::addHTTPHeaderField(const AtomicString& name, const AtomicS tring& value) 239 void ResourceRequest::addHTTPHeaderField(const AtomicString& name, const AtomicS tring& value)
240 { 240 {
241 HTTPHeaderMap::AddResult result = m_httpHeaderFields.add(name, value); 241 HTTPHeaderMap::AddResult result = m_httpHeaderFields.add(name, value);
242 if (!result.isNewEntry) 242 if (!result.isNewEntry)
243 result.iterator->value = result.iterator->value + ',' + value; 243 result.storedValue->value = result.storedValue->value + ',' + value;
244 } 244 }
245 245
246 void ResourceRequest::addHTTPHeaderFields(const HTTPHeaderMap& headerFields) 246 void ResourceRequest::addHTTPHeaderFields(const HTTPHeaderMap& headerFields)
247 { 247 {
248 HTTPHeaderMap::const_iterator end = headerFields.end(); 248 HTTPHeaderMap::const_iterator end = headerFields.end();
249 for (HTTPHeaderMap::const_iterator it = headerFields.begin(); it != end; ++i t) 249 for (HTTPHeaderMap::const_iterator it = headerFields.begin(); it != end; ++i t)
250 addHTTPHeaderField(it->key, it->value); 250 addHTTPHeaderField(it->key, it->value);
251 } 251 }
252 252
253 void ResourceRequest::clearHTTPHeaderField(const AtomicString& name) 253 void ResourceRequest::clearHTTPHeaderField(const AtomicString& name)
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 // This is used by the loader to control the number of issued parallel load requ ests. 349 // This is used by the loader to control the number of issued parallel load requ ests.
350 unsigned initializeMaximumHTTPConnectionCountPerHost() 350 unsigned initializeMaximumHTTPConnectionCountPerHost()
351 { 351 {
352 // The chromium network stack already handles limiting the number of 352 // The chromium network stack already handles limiting the number of
353 // parallel requests per host, so there's no need to do it here. Therefore, 353 // parallel requests per host, so there's no need to do it here. Therefore,
354 // this is set to a high value that should never be hit in practice. 354 // this is set to a high value that should never be hit in practice.
355 return 10000; 355 return 10000;
356 } 356 }
357 357
358 } 358 }
OLDNEW
« no previous file with comments | « Source/platform/graphics/ImageDecodingStore.cpp ('k') | Source/platform/network/ResourceResponse.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698