Chromium Code Reviews| 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 20 matching lines...) Expand all Loading... | |
| 316 HTTPHeaderMap::const_iterator end = headerFields.end(); | 329 HTTPHeaderMap::const_iterator end = headerFields.end(); |
| 317 for (HTTPHeaderMap::const_iterator it = headerFields.begin(); it != end; ++i t) | 330 for (HTTPHeaderMap::const_iterator it = headerFields.begin(); it != end; ++i t) |
| 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 ) |
|
horo
2016/04/04 05:26:00
There is no code which compares ResourceRequests.
Mike West
2016/04/04 08:04:20
I've added a TODO, and I'll take a look in a separ
| |
| 327 { | 340 { |
| 328 if (a.url() != b.url()) | 341 if (a.url() != b.url()) |
| 329 return false; | 342 return false; |
| 330 | 343 |
| 331 if (a.getCachePolicy() != b.getCachePolicy()) | 344 if (a.getCachePolicy() != b.getCachePolicy()) |
| 332 return false; | 345 return false; |
| 333 | 346 |
| 334 if (a.timeoutInterval() != b.timeoutInterval()) | 347 if (a.timeoutInterval() != b.timeoutInterval()) |
| 335 return false; | 348 return false; |
| 336 | 349 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 353 EncodedFormData* formDataB = b.httpBody(); | 366 EncodedFormData* formDataB = b.httpBody(); |
| 354 | 367 |
| 355 if (!formDataA) | 368 if (!formDataA) |
| 356 return !formDataB; | 369 return !formDataB; |
| 357 if (!formDataB) | 370 if (!formDataB) |
| 358 return !formDataA; | 371 return !formDataA; |
| 359 | 372 |
| 360 if (*formDataA != *formDataB) | 373 if (*formDataA != *formDataB) |
| 361 return false; | 374 return false; |
| 362 | 375 |
| 376 formDataA = a.attachedCredentialBody(); | |
| 377 formDataB = b.attachedCredentialBody(); | |
| 378 | |
| 379 if (!formDataA) | |
| 380 return !formDataB; | |
| 381 if (!formDataB) | |
| 382 return !formDataA; | |
| 383 | |
| 384 if (*formDataA != *formDataB) | |
| 385 return false; | |
| 386 | |
| 363 if (a.httpHeaderFields() != b.httpHeaderFields()) | 387 if (a.httpHeaderFields() != b.httpHeaderFields()) |
| 364 return false; | 388 return false; |
| 365 | 389 |
| 366 return true; | 390 return true; |
| 367 } | 391 } |
| 368 | 392 |
| 369 void ResourceRequest::setExternalRequestStateFromRequestorAddressSpace(WebAddres sSpace requestorSpace) | 393 void ResourceRequest::setExternalRequestStateFromRequestorAddressSpace(WebAddres sSpace requestorSpace) |
| 370 { | 394 { |
| 371 static_assert(WebAddressSpaceLocal < WebAddressSpacePrivate, "Local is insid e Private"); | 395 static_assert(WebAddressSpaceLocal < WebAddressSpacePrivate, "Local is insid e Private"); |
| 372 static_assert(WebAddressSpaceLocal < WebAddressSpacePublic, "Local is inside Public"); | 396 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; | 477 m_didSetHTTPReferrer = false; |
| 454 m_checkForBrowserSideNavigation = true; | 478 m_checkForBrowserSideNavigation = true; |
| 455 m_uiStartTime = 0; | 479 m_uiStartTime = 0; |
| 456 m_isExternalRequest = false; | 480 m_isExternalRequest = false; |
| 457 m_inputPerfMetricReportPolicy = InputToLoadPerfMetricReportPolicy::NoReport; | 481 m_inputPerfMetricReportPolicy = InputToLoadPerfMetricReportPolicy::NoReport; |
| 458 m_followedRedirect = false; | 482 m_followedRedirect = false; |
| 459 m_requestorOrigin = SecurityOrigin::createUnique(); | 483 m_requestorOrigin = SecurityOrigin::createUnique(); |
| 460 } | 484 } |
| 461 | 485 |
| 462 } // namespace blink | 486 } // namespace blink |
| OLD | NEW |