| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
| 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
| 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
| 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
| 6 rights reserved. | 6 rights reserved. |
| 7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
| 8 | 8 |
| 9 This library is free software; you can redistribute it and/or | 9 This library is free software; you can redistribute it and/or |
| 10 modify it under the terms of the GNU Library General Public | 10 modify it under the terms of the GNU Library General Public |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 | 444 |
| 445 return resource; | 445 return resource; |
| 446 } | 446 } |
| 447 | 447 |
| 448 Resource* ResourceFetcher::ResourceForBlockedRequest( | 448 Resource* ResourceFetcher::ResourceForBlockedRequest( |
| 449 const FetchParameters& params, | 449 const FetchParameters& params, |
| 450 const ResourceFactory& factory, | 450 const ResourceFactory& factory, |
| 451 ResourceRequestBlockedReason blocked_reason) { | 451 ResourceRequestBlockedReason blocked_reason) { |
| 452 Resource* resource = factory.Create(params.GetResourceRequest(), | 452 Resource* resource = factory.Create(params.GetResourceRequest(), |
| 453 params.Options(), params.Charset()); | 453 params.Options(), params.Charset()); |
| 454 resource->GetError(ResourceError::CancelledDueToAccessCheckError( | 454 resource->FinishAsError(ResourceError::CancelledDueToAccessCheckError( |
| 455 params.Url(), blocked_reason)); | 455 params.Url(), blocked_reason)); |
| 456 return resource; | 456 return resource; |
| 457 } | 457 } |
| 458 | 458 |
| 459 void ResourceFetcher::MakePreloadedResourceBlockOnloadIfNeeded( | 459 void ResourceFetcher::MakePreloadedResourceBlockOnloadIfNeeded( |
| 460 Resource* resource, | 460 Resource* resource, |
| 461 const FetchParameters& params) { | 461 const FetchParameters& params) { |
| 462 // TODO(yoav): Test that non-blocking resources (video/audio/track) continue | 462 // TODO(yoav): Test that non-blocking resources (video/audio/track) continue |
| 463 // to not-block even after being preloaded and discovered. | 463 // to not-block even after being preloaded and discovered. |
| 464 if (resource && resource->Loader() && | 464 if (resource && resource->Loader() && |
| (...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 | 1310 |
| 1311 bool is_internal_request = resource->Options().initiator_info.name == | 1311 bool is_internal_request = resource->Options().initiator_info.name == |
| 1312 FetchInitiatorTypeNames::internal; | 1312 FetchInitiatorTypeNames::internal; |
| 1313 | 1313 |
| 1314 Context().DispatchDidFail(resource->Identifier(), error, | 1314 Context().DispatchDidFail(resource->Identifier(), error, |
| 1315 resource->GetResponse().EncodedDataLength(), | 1315 resource->GetResponse().EncodedDataLength(), |
| 1316 is_internal_request); | 1316 is_internal_request); |
| 1317 | 1317 |
| 1318 if (error.IsCancellation()) | 1318 if (error.IsCancellation()) |
| 1319 RemovePreload(resource); | 1319 RemovePreload(resource); |
| 1320 resource->GetError(error); | 1320 resource->FinishAsError(error); |
| 1321 | 1321 |
| 1322 HandleLoadCompletion(resource); | 1322 HandleLoadCompletion(resource); |
| 1323 } | 1323 } |
| 1324 | 1324 |
| 1325 void ResourceFetcher::MoveResourceLoaderToNonBlocking(ResourceLoader* loader) { | 1325 void ResourceFetcher::MoveResourceLoaderToNonBlocking(ResourceLoader* loader) { |
| 1326 DCHECK(loader); | 1326 DCHECK(loader); |
| 1327 // TODO(yoav): Convert CHECK to DCHECK if no crash reports come in. | 1327 // TODO(yoav): Convert CHECK to DCHECK if no crash reports come in. |
| 1328 CHECK(loaders_.Contains(loader)); | 1328 CHECK(loaders_.Contains(loader)); |
| 1329 non_blocking_loaders_.insert(loader); | 1329 non_blocking_loaders_.insert(loader); |
| 1330 loaders_.erase(loader); | 1330 loaders_.erase(loader); |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1612 visitor->Trace(context_); | 1612 visitor->Trace(context_); |
| 1613 visitor->Trace(archive_); | 1613 visitor->Trace(archive_); |
| 1614 visitor->Trace(loaders_); | 1614 visitor->Trace(loaders_); |
| 1615 visitor->Trace(non_blocking_loaders_); | 1615 visitor->Trace(non_blocking_loaders_); |
| 1616 visitor->Trace(document_resources_); | 1616 visitor->Trace(document_resources_); |
| 1617 visitor->Trace(preloads_); | 1617 visitor->Trace(preloads_); |
| 1618 visitor->Trace(resource_timing_info_map_); | 1618 visitor->Trace(resource_timing_info_map_); |
| 1619 } | 1619 } |
| 1620 | 1620 |
| 1621 } // namespace blink | 1621 } // namespace blink |
| OLD | NEW |