OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013, Intel Corporation | 3 * Copyright (C) 2013, Intel Corporation |
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 are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 , m_crossOriginNonSimpleRequest(false) | 125 , m_crossOriginNonSimpleRequest(false) |
126 , m_isUsingDataConsumerHandle(false) | 126 , m_isUsingDataConsumerHandle(false) |
127 , m_async(blockingBehavior == LoadAsynchronously) | 127 , m_async(blockingBehavior == LoadAsynchronously) |
128 , m_requestContext(WebURLRequest::RequestContextUnspecified) | 128 , m_requestContext(WebURLRequest::RequestContextUnspecified) |
129 , m_timeoutTimer(this, &DocumentThreadableLoader::didTimeout) | 129 , m_timeoutTimer(this, &DocumentThreadableLoader::didTimeout) |
130 , m_requestStartedSeconds(0.0) | 130 , m_requestStartedSeconds(0.0) |
131 , m_corsRedirectLimit(kMaxCORSRedirects) | 131 , m_corsRedirectLimit(kMaxCORSRedirects) |
132 , m_redirectMode(WebURLRequest::FetchRedirectModeFollow) | 132 , m_redirectMode(WebURLRequest::FetchRedirectModeFollow) |
133 , m_weakFactory(this) | 133 , m_weakFactory(this) |
134 { | 134 { |
135 LOG(WARNING) << __FUNCTION__; | |
Peter Beverloo
2016/04/15 11:07:29
I presume this is for figuring out the ASAN proble
Michael van Ouwerkerk
2016/04/18 11:26:53
Acknowledged.
| |
135 ASSERT(client); | 136 ASSERT(client); |
136 } | 137 } |
137 | 138 |
138 void DocumentThreadableLoader::start(const ResourceRequest& request) | 139 void DocumentThreadableLoader::start(const ResourceRequest& request) |
139 { | 140 { |
141 LOG(WARNING) << __FUNCTION__; | |
140 // Setting an outgoing referer is only supported in the async code path. | 142 // Setting an outgoing referer is only supported in the async code path. |
141 ASSERT(m_async || request.httpReferrer().isEmpty()); | 143 ASSERT(m_async || request.httpReferrer().isEmpty()); |
142 | 144 |
143 m_sameOriginRequest = getSecurityOrigin()->canRequestNoSuborigin(request.url ()); | 145 m_sameOriginRequest = getSecurityOrigin()->canRequestNoSuborigin(request.url ()); |
144 m_requestContext = request.requestContext(); | 146 m_requestContext = request.requestContext(); |
145 m_redirectMode = request.fetchRedirectMode(); | 147 m_redirectMode = request.fetchRedirectMode(); |
146 | 148 |
147 if (!m_sameOriginRequest && m_options.crossOriginRequestPolicy == DenyCrossO riginRequests) { | 149 if (!m_sameOriginRequest && m_options.crossOriginRequestPolicy == DenyCrossO riginRequests) { |
148 ThreadableLoaderClient* client = m_client; | 150 ThreadableLoaderClient* client = m_client; |
149 clear(); | 151 clear(); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
301 ResourceLoaderOptions preflightOptions = m_actualOptions; | 303 ResourceLoaderOptions preflightOptions = m_actualOptions; |
302 preflightOptions.allowCredentials = DoNotAllowStoredCredentials; | 304 preflightOptions.allowCredentials = DoNotAllowStoredCredentials; |
303 loadRequest(preflightRequest, preflightOptions); | 305 loadRequest(preflightRequest, preflightOptions); |
304 // |this| may be dead here in async mode. | 306 // |this| may be dead here in async mode. |
305 } | 307 } |
306 } | 308 } |
307 } | 309 } |
308 | 310 |
309 DocumentThreadableLoader::~DocumentThreadableLoader() | 311 DocumentThreadableLoader::~DocumentThreadableLoader() |
310 { | 312 { |
313 LOG(WARNING) << __FUNCTION__; | |
311 m_client = nullptr; | 314 m_client = nullptr; |
312 | 315 |
313 // TODO(oilpan): Remove this once DocumentThreadableLoader is once again a R esourceOwner. | 316 // TODO(oilpan): Remove this once DocumentThreadableLoader is once again a R esourceOwner. |
314 clearResource(); | 317 clearResource(); |
315 } | 318 } |
316 | 319 |
317 void DocumentThreadableLoader::overrideTimeout(unsigned long timeoutMilliseconds ) | 320 void DocumentThreadableLoader::overrideTimeout(unsigned long timeoutMilliseconds ) |
318 { | 321 { |
319 ASSERT(m_async); | 322 ASSERT(m_async); |
320 | 323 |
(...skipping 14 matching lines...) Expand all Loading... | |
335 if (timeoutMilliseconds) { | 338 if (timeoutMilliseconds) { |
336 double elapsedTime = monotonicallyIncreasingTime() - m_requestStartedSec onds; | 339 double elapsedTime = monotonicallyIncreasingTime() - m_requestStartedSec onds; |
337 double nextFire = timeoutMilliseconds / 1000.0; | 340 double nextFire = timeoutMilliseconds / 1000.0; |
338 double resolvedTime = std::max(nextFire - elapsedTime, 0.0); | 341 double resolvedTime = std::max(nextFire - elapsedTime, 0.0); |
339 m_timeoutTimer.startOneShot(resolvedTime, BLINK_FROM_HERE); | 342 m_timeoutTimer.startOneShot(resolvedTime, BLINK_FROM_HERE); |
340 } | 343 } |
341 } | 344 } |
342 | 345 |
343 void DocumentThreadableLoader::cancel() | 346 void DocumentThreadableLoader::cancel() |
344 { | 347 { |
348 LOG(WARNING) << __FUNCTION__; | |
345 cancelWithError(ResourceError()); | 349 cancelWithError(ResourceError()); |
346 // |this| may be dead here. | 350 // |this| may be dead here. |
347 } | 351 } |
348 | 352 |
349 void DocumentThreadableLoader::cancelWithError(const ResourceError& error) | 353 void DocumentThreadableLoader::cancelWithError(const ResourceError& error) |
350 { | 354 { |
351 // Cancel can re-enter and m_resource might be null here as a result. | 355 // Cancel can re-enter and m_resource might be null here as a result. |
352 if (!m_client || !resource()) { | 356 if (!m_client || !resource()) { |
353 clear(); | 357 clear(); |
354 return; | 358 return; |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
936 return m_securityOrigin ? m_securityOrigin.get() : document().getSecurityOri gin(); | 940 return m_securityOrigin ? m_securityOrigin.get() : document().getSecurityOri gin(); |
937 } | 941 } |
938 | 942 |
939 Document& DocumentThreadableLoader::document() const | 943 Document& DocumentThreadableLoader::document() const |
940 { | 944 { |
941 ASSERT(m_document); | 945 ASSERT(m_document); |
942 return *m_document; | 946 return *m_document; |
943 } | 947 } |
944 | 948 |
945 } // namespace blink | 949 } // namespace blink |
OLD | NEW |