OLD | NEW |
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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 } | 162 } |
163 | 163 |
164 void WebURLRequest::setHTTPHeaderField(const WebString& name, const WebString& v
alue) | 164 void WebURLRequest::setHTTPHeaderField(const WebString& name, const WebString& v
alue) |
165 { | 165 { |
166 RELEASE_ASSERT(!equalIgnoringCase(name, "referer")); | 166 RELEASE_ASSERT(!equalIgnoringCase(name, "referer")); |
167 m_private->m_resourceRequest->setHTTPHeaderField(name, value); | 167 m_private->m_resourceRequest->setHTTPHeaderField(name, value); |
168 } | 168 } |
169 | 169 |
170 void WebURLRequest::setHTTPReferrer(const WebString& referrer, WebReferrerPolicy
referrerPolicy) | 170 void WebURLRequest::setHTTPReferrer(const WebString& referrer, WebReferrerPolicy
referrerPolicy) |
171 { | 171 { |
172 if (referrer.isEmpty()) | 172 m_private->m_resourceRequest->setHTTPReferrer(Referrer(referrer, static_cast
<ReferrerPolicy>(referrerPolicy))); |
173 m_private->m_resourceRequest->clearHTTPReferrer(); | |
174 else | |
175 m_private->m_resourceRequest->setHTTPReferrer(Referrer(referrer, static_
cast<ReferrerPolicy>(referrerPolicy))); | |
176 } | 173 } |
177 | 174 |
178 void WebURLRequest::addHTTPHeaderField(const WebString& name, const WebString& v
alue) | 175 void WebURLRequest::addHTTPHeaderField(const WebString& name, const WebString& v
alue) |
179 { | 176 { |
180 m_private->m_resourceRequest->addHTTPHeaderField(name, value); | 177 m_private->m_resourceRequest->addHTTPHeaderField(name, value); |
181 } | 178 } |
182 | 179 |
183 void WebURLRequest::clearHTTPHeaderField(const WebString& name) | 180 void WebURLRequest::clearHTTPHeaderField(const WebString& name) |
184 { | 181 { |
185 m_private->m_resourceRequest->clearHTTPHeaderField(name); | 182 m_private->m_resourceRequest->clearHTTPHeaderField(name); |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 // Subclasses may call this directly so a self-assignment check is needed | 375 // Subclasses may call this directly so a self-assignment check is needed |
379 // here as well as in the public assign method. | 376 // here as well as in the public assign method. |
380 if (m_private == p) | 377 if (m_private == p) |
381 return; | 378 return; |
382 if (m_private) | 379 if (m_private) |
383 m_private->dispose(); | 380 m_private->dispose(); |
384 m_private = p; | 381 m_private = p; |
385 } | 382 } |
386 | 383 |
387 } // namespace blink | 384 } // namespace blink |
OLD | NEW |