| OLD | NEW |
| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 setCachePolicy(data->m_cachePolicy); | 44 setCachePolicy(data->m_cachePolicy); |
| 45 setTimeoutInterval(data->m_timeoutInterval); | 45 setTimeoutInterval(data->m_timeoutInterval); |
| 46 setFirstPartyForCookies(data->m_firstPartyForCookies); | 46 setFirstPartyForCookies(data->m_firstPartyForCookies); |
| 47 setRequestorOrigin(data->m_requestorOrigin); | 47 setRequestorOrigin(data->m_requestorOrigin); |
| 48 setHTTPMethod(AtomicString(data->m_httpMethod)); | 48 setHTTPMethod(AtomicString(data->m_httpMethod)); |
| 49 setPriority(data->m_priority, data->m_intraPriorityValue); | 49 setPriority(data->m_priority, data->m_intraPriorityValue); |
| 50 | 50 |
| 51 m_httpHeaderFields.adopt(data->m_httpHeaders.release()); | 51 m_httpHeaderFields.adopt(data->m_httpHeaders.release()); |
| 52 | 52 |
| 53 setHTTPBody(data->m_httpBody); | 53 setHTTPBody(data->m_httpBody); |
| 54 setAttachedCredentialBody(data->m_attachedCredentialBody); |
| 54 setAllowStoredCredentials(data->m_allowStoredCredentials); | 55 setAllowStoredCredentials(data->m_allowStoredCredentials); |
| 55 setReportUploadProgress(data->m_reportUploadProgress); | 56 setReportUploadProgress(data->m_reportUploadProgress); |
| 56 setHasUserGesture(data->m_hasUserGesture); | 57 setHasUserGesture(data->m_hasUserGesture); |
| 57 setDownloadToFile(data->m_downloadToFile); | 58 setDownloadToFile(data->m_downloadToFile); |
| 58 setUseStreamOnResponse(data->m_useStreamOnResponse); | 59 setUseStreamOnResponse(data->m_useStreamOnResponse); |
| 59 setSkipServiceWorker(data->m_skipServiceWorker); | 60 setSkipServiceWorker(data->m_skipServiceWorker); |
| 60 setShouldResetAppCache(data->m_shouldResetAppCache); | 61 setShouldResetAppCache(data->m_shouldResetAppCache); |
| 61 setRequestorID(data->m_requestorID); | 62 setRequestorID(data->m_requestorID); |
| 62 setRequestorProcessID(data->m_requestorProcessID); | 63 setRequestorProcessID(data->m_requestorProcessID); |
| 63 setAppCacheHostID(data->m_appCacheHostID); | 64 setAppCacheHostID(data->m_appCacheHostID); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 84 data->m_timeoutInterval = timeoutInterval(); | 85 data->m_timeoutInterval = timeoutInterval(); |
| 85 data->m_firstPartyForCookies = firstPartyForCookies().copy(); | 86 data->m_firstPartyForCookies = firstPartyForCookies().copy(); |
| 86 data->m_requestorOrigin = requestorOrigin() ? requestorOrigin()->isolatedCop
y() : nullptr; | 87 data->m_requestorOrigin = requestorOrigin() ? requestorOrigin()->isolatedCop
y() : nullptr; |
| 87 data->m_httpMethod = httpMethod().getString().isolatedCopy(); | 88 data->m_httpMethod = httpMethod().getString().isolatedCopy(); |
| 88 data->m_httpHeaders = httpHeaderFields().copyData(); | 89 data->m_httpHeaders = httpHeaderFields().copyData(); |
| 89 data->m_priority = priority(); | 90 data->m_priority = priority(); |
| 90 data->m_intraPriorityValue = m_intraPriorityValue; | 91 data->m_intraPriorityValue = m_intraPriorityValue; |
| 91 | 92 |
| 92 if (m_httpBody) | 93 if (m_httpBody) |
| 93 data->m_httpBody = m_httpBody->deepCopy(); | 94 data->m_httpBody = m_httpBody->deepCopy(); |
| 95 if (m_attachedCredentialBody) |
| 96 data->m_attachedCredentialBody = m_attachedCredentialBody->deepCopy(); |
| 94 data->m_allowStoredCredentials = m_allowStoredCredentials; | 97 data->m_allowStoredCredentials = m_allowStoredCredentials; |
| 95 data->m_reportUploadProgress = m_reportUploadProgress; | 98 data->m_reportUploadProgress = m_reportUploadProgress; |
| 96 data->m_hasUserGesture = m_hasUserGesture; | 99 data->m_hasUserGesture = m_hasUserGesture; |
| 97 data->m_downloadToFile = m_downloadToFile; | 100 data->m_downloadToFile = m_downloadToFile; |
| 98 data->m_useStreamOnResponse = m_useStreamOnResponse; | 101 data->m_useStreamOnResponse = m_useStreamOnResponse; |
| 99 data->m_skipServiceWorker = m_skipServiceWorker; | 102 data->m_skipServiceWorker = m_skipServiceWorker; |
| 100 data->m_shouldResetAppCache = m_shouldResetAppCache; | 103 data->m_shouldResetAppCache = m_shouldResetAppCache; |
| 101 data->m_requestorID = m_requestorID; | 104 data->m_requestorID = m_requestorID; |
| 102 data->m_requestorProcessID = m_requestorProcessID; | 105 data->m_requestorProcessID = m_requestorProcessID; |
| 103 data->m_appCacheHostID = m_appCacheHostID; | 106 data->m_appCacheHostID = m_appCacheHostID; |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 EncodedFormData* ResourceRequest::httpBody() const | 279 EncodedFormData* ResourceRequest::httpBody() const |
| 277 { | 280 { |
| 278 return m_httpBody.get(); | 281 return m_httpBody.get(); |
| 279 } | 282 } |
| 280 | 283 |
| 281 void ResourceRequest::setHTTPBody(PassRefPtr<EncodedFormData> httpBody) | 284 void ResourceRequest::setHTTPBody(PassRefPtr<EncodedFormData> httpBody) |
| 282 { | 285 { |
| 283 m_httpBody = httpBody; | 286 m_httpBody = httpBody; |
| 284 } | 287 } |
| 285 | 288 |
| 289 EncodedFormData* ResourceRequest::attachedCredentialBody() const |
| 290 { |
| 291 return m_attachedCredentialBody.get(); |
| 292 } |
| 293 |
| 294 void ResourceRequest::setAttachedCredentialBody(PassRefPtr<EncodedFormData> atta
chedCredentialBody) |
| 295 { |
| 296 m_attachedCredentialBody = attachedCredentialBody; |
| 297 } |
| 298 |
| 286 bool ResourceRequest::allowStoredCredentials() const | 299 bool ResourceRequest::allowStoredCredentials() const |
| 287 { | 300 { |
| 288 return m_allowStoredCredentials; | 301 return m_allowStoredCredentials; |
| 289 } | 302 } |
| 290 | 303 |
| 291 void ResourceRequest::setAllowStoredCredentials(bool allowCredentials) | 304 void ResourceRequest::setAllowStoredCredentials(bool allowCredentials) |
| 292 { | 305 { |
| 293 m_allowStoredCredentials = allowCredentials; | 306 m_allowStoredCredentials = allowCredentials; |
| 294 } | 307 } |
| 295 | 308 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 318 addHTTPHeaderField(it->key, it->value); | 331 addHTTPHeaderField(it->key, it->value); |
| 319 } | 332 } |
| 320 | 333 |
| 321 void ResourceRequest::clearHTTPHeaderField(const AtomicString& name) | 334 void ResourceRequest::clearHTTPHeaderField(const AtomicString& name) |
| 322 { | 335 { |
| 323 m_httpHeaderFields.remove(name); | 336 m_httpHeaderFields.remove(name); |
| 324 } | 337 } |
| 325 | 338 |
| 326 bool ResourceRequest::compare(const ResourceRequest& a, const ResourceRequest& b
) | 339 bool ResourceRequest::compare(const ResourceRequest& a, const ResourceRequest& b
) |
| 327 { | 340 { |
| 341 // TODO(mkwst): This looks unused. Remove it? |
| 328 if (a.url() != b.url()) | 342 if (a.url() != b.url()) |
| 329 return false; | 343 return false; |
| 330 | 344 |
| 331 if (a.getCachePolicy() != b.getCachePolicy()) | 345 if (a.getCachePolicy() != b.getCachePolicy()) |
| 332 return false; | 346 return false; |
| 333 | 347 |
| 334 if (a.timeoutInterval() != b.timeoutInterval()) | 348 if (a.timeoutInterval() != b.timeoutInterval()) |
| 335 return false; | 349 return false; |
| 336 | 350 |
| 337 if (a.firstPartyForCookies() != b.firstPartyForCookies()) | 351 if (a.firstPartyForCookies() != b.firstPartyForCookies()) |
| (...skipping 15 matching lines...) Expand all Loading... |
| 353 EncodedFormData* formDataB = b.httpBody(); | 367 EncodedFormData* formDataB = b.httpBody(); |
| 354 | 368 |
| 355 if (!formDataA) | 369 if (!formDataA) |
| 356 return !formDataB; | 370 return !formDataB; |
| 357 if (!formDataB) | 371 if (!formDataB) |
| 358 return !formDataA; | 372 return !formDataA; |
| 359 | 373 |
| 360 if (*formDataA != *formDataB) | 374 if (*formDataA != *formDataB) |
| 361 return false; | 375 return false; |
| 362 | 376 |
| 377 formDataA = a.attachedCredentialBody(); |
| 378 formDataB = b.attachedCredentialBody(); |
| 379 |
| 380 if (!formDataA) |
| 381 return !formDataB; |
| 382 if (!formDataB) |
| 383 return !formDataA; |
| 384 |
| 385 if (*formDataA != *formDataB) |
| 386 return false; |
| 387 |
| 363 if (a.httpHeaderFields() != b.httpHeaderFields()) | 388 if (a.httpHeaderFields() != b.httpHeaderFields()) |
| 364 return false; | 389 return false; |
| 365 | 390 |
| 366 return true; | 391 return true; |
| 367 } | 392 } |
| 368 | 393 |
| 369 void ResourceRequest::setExternalRequestStateFromRequestorAddressSpace(WebAddres
sSpace requestorSpace) | 394 void ResourceRequest::setExternalRequestStateFromRequestorAddressSpace(WebAddres
sSpace requestorSpace) |
| 370 { | 395 { |
| 371 static_assert(WebAddressSpaceLocal < WebAddressSpacePrivate, "Local is insid
e Private"); | 396 static_assert(WebAddressSpaceLocal < WebAddressSpacePrivate, "Local is insid
e Private"); |
| 372 static_assert(WebAddressSpaceLocal < WebAddressSpacePublic, "Local is inside
Public"); | 397 static_assert(WebAddressSpaceLocal < WebAddressSpacePublic, "Local is inside
Public"); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 m_didSetHTTPReferrer = false; | 478 m_didSetHTTPReferrer = false; |
| 454 m_checkForBrowserSideNavigation = true; | 479 m_checkForBrowserSideNavigation = true; |
| 455 m_uiStartTime = 0; | 480 m_uiStartTime = 0; |
| 456 m_isExternalRequest = false; | 481 m_isExternalRequest = false; |
| 457 m_inputPerfMetricReportPolicy = InputToLoadPerfMetricReportPolicy::NoReport; | 482 m_inputPerfMetricReportPolicy = InputToLoadPerfMetricReportPolicy::NoReport; |
| 458 m_followedRedirect = false; | 483 m_followedRedirect = false; |
| 459 m_requestorOrigin = SecurityOrigin::createUnique(); | 484 m_requestorOrigin = SecurityOrigin::createUnique(); |
| 460 } | 485 } |
| 461 | 486 |
| 462 } // namespace blink | 487 } // namespace blink |
| OLD | NEW |