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

Side by Side Diff: Source/web/AssociatedURLLoader.cpp

Issue 256743005: Add removeAll method to sets and maps and use them (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Moved implementation of removeAll to HashTable.h and shared it. Also added it to LinkedHashSet Created 6 years, 8 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
« no previous file with comments | « Source/platform/fonts/FontCache.cpp ('k') | Source/wtf/HashMap.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) 2010, 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2010, 2011, 2012 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 const HTTPHeaderSet& HTTPResponseHeaderValidator::blockedHeaders() 105 const HTTPHeaderSet& HTTPResponseHeaderValidator::blockedHeaders()
106 { 106 {
107 // Remove exposed headers from the blocked set. 107 // Remove exposed headers from the blocked set.
108 if (!m_exposedHeaders.isEmpty()) { 108 if (!m_exposedHeaders.isEmpty()) {
109 // Don't allow Set-Cookie headers to be exposed. 109 // Don't allow Set-Cookie headers to be exposed.
110 m_exposedHeaders.remove("set-cookie"); 110 m_exposedHeaders.remove("set-cookie");
111 m_exposedHeaders.remove("set-cookie2"); 111 m_exposedHeaders.remove("set-cookie2");
112 // Block Access-Control-Expose-Header itself. It could be exposed later. 112 // Block Access-Control-Expose-Header itself. It could be exposed later.
113 m_blockedHeaders.add("access-control-expose-headers"); 113 m_blockedHeaders.add("access-control-expose-headers");
114 HTTPHeaderSet::const_iterator end = m_exposedHeaders.end(); 114 m_blockedHeaders.removeAll(m_exposedHeaders);
115 for (HTTPHeaderSet::const_iterator it = m_exposedHeaders.begin(); it != end; ++it)
116 m_blockedHeaders.remove(*it);
117 } 115 }
118 116
119 return m_blockedHeaders; 117 return m_blockedHeaders;
120 } 118 }
121 119
122 } 120 }
123 121
124 // This class bridges the interface differences between WebCore and WebKit loade r clients. 122 // This class bridges the interface differences between WebCore and WebKit loade r clients.
125 // It forwards its ThreadableLoaderClient notifications to a WebURLLoaderClient. 123 // It forwards its ThreadableLoaderClient notifications to a WebURLLoaderClient.
126 class AssociatedURLLoader::ClientAdapter FINAL : public DocumentThreadableLoader Client { 124 class AssociatedURLLoader::ClientAdapter FINAL : public DocumentThreadableLoader Client {
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 m_loader->cancel(); 366 m_loader->cancel();
369 } 367 }
370 368
371 void AssociatedURLLoader::setDefersLoading(bool defersLoading) 369 void AssociatedURLLoader::setDefersLoading(bool defersLoading)
372 { 370 {
373 if (m_loader) 371 if (m_loader)
374 m_loader->setDefersLoading(defersLoading); 372 m_loader->setDefersLoading(defersLoading);
375 } 373 }
376 374
377 } // namespace blink 375 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/fonts/FontCache.cpp ('k') | Source/wtf/HashMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698