| 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 201 |
| 202 void WebURLRequest::visitHTTPHeaderFields(WebHTTPHeaderVisitor* visitor) const | 202 void WebURLRequest::visitHTTPHeaderFields(WebHTTPHeaderVisitor* visitor) const |
| 203 { | 203 { |
| 204 const HTTPHeaderMap& map = m_private->m_resourceRequest->httpHeaderFields(); | 204 const HTTPHeaderMap& map = m_private->m_resourceRequest->httpHeaderFields(); |
| 205 for (HTTPHeaderMap::const_iterator it = map.begin(); it != map.end(); ++it) | 205 for (HTTPHeaderMap::const_iterator it = map.begin(); it != map.end(); ++it) |
| 206 visitor->visitHeader(it->key, it->value); | 206 visitor->visitHeader(it->key, it->value); |
| 207 } | 207 } |
| 208 | 208 |
| 209 WebHTTPBody WebURLRequest::httpBody() const | 209 WebHTTPBody WebURLRequest::httpBody() const |
| 210 { | 210 { |
| 211 // TODO(mkwst): This is wrong, as it means that we're producing the body |
| 212 // before any ServiceWorker has a chance to operate, which means we're |
| 213 // revealing data to the SW that we ought to be hiding. Baby steps. |
| 214 // https://crbug.com/599597 |
| 215 if (m_private->m_resourceRequest->attachedCredential()) |
| 216 return WebHTTPBody(m_private->m_resourceRequest->attachedCredential()); |
| 211 return WebHTTPBody(m_private->m_resourceRequest->httpBody()); | 217 return WebHTTPBody(m_private->m_resourceRequest->httpBody()); |
| 212 } | 218 } |
| 213 | 219 |
| 214 void WebURLRequest::setHTTPBody(const WebHTTPBody& httpBody) | 220 void WebURLRequest::setHTTPBody(const WebHTTPBody& httpBody) |
| 215 { | 221 { |
| 216 m_private->m_resourceRequest->setHTTPBody(httpBody); | 222 m_private->m_resourceRequest->setHTTPBody(httpBody); |
| 217 } | 223 } |
| 218 | 224 |
| 225 WebHTTPBody WebURLRequest::attachedCredential() const |
| 226 { |
| 227 return WebHTTPBody(m_private->m_resourceRequest->attachedCredential()); |
| 228 } |
| 229 |
| 230 void WebURLRequest::setAttachedCredential(const WebHTTPBody& attachedCredential) |
| 231 { |
| 232 m_private->m_resourceRequest->setAttachedCredential(attachedCredential); |
| 233 } |
| 234 |
| 219 bool WebURLRequest::reportUploadProgress() const | 235 bool WebURLRequest::reportUploadProgress() const |
| 220 { | 236 { |
| 221 return m_private->m_resourceRequest->reportUploadProgress(); | 237 return m_private->m_resourceRequest->reportUploadProgress(); |
| 222 } | 238 } |
| 223 | 239 |
| 224 void WebURLRequest::setReportUploadProgress(bool reportUploadProgress) | 240 void WebURLRequest::setReportUploadProgress(bool reportUploadProgress) |
| 225 { | 241 { |
| 226 m_private->m_resourceRequest->setReportUploadProgress(reportUploadProgress); | 242 m_private->m_resourceRequest->setReportUploadProgress(reportUploadProgress); |
| 227 } | 243 } |
| 228 | 244 |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 // Subclasses may call this directly so a self-assignment check is needed | 486 // Subclasses may call this directly so a self-assignment check is needed |
| 471 // here as well as in the public assign method. | 487 // here as well as in the public assign method. |
| 472 if (m_private == p) | 488 if (m_private == p) |
| 473 return; | 489 return; |
| 474 if (m_private) | 490 if (m_private) |
| 475 m_private->dispose(); | 491 m_private->dispose(); |
| 476 m_private = p; | 492 m_private = p; |
| 477 } | 493 } |
| 478 | 494 |
| 479 } // namespace blink | 495 } // namespace blink |
| OLD | NEW |