Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp

Issue 2855883004: Rename Resource::GetError() to FinishAsError() (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 439
440 return resource; 440 return resource;
441 } 441 }
442 442
443 Resource* ResourceFetcher::ResourceForBlockedRequest( 443 Resource* ResourceFetcher::ResourceForBlockedRequest(
444 const FetchParameters& params, 444 const FetchParameters& params,
445 const ResourceFactory& factory, 445 const ResourceFactory& factory,
446 ResourceRequestBlockedReason blocked_reason) { 446 ResourceRequestBlockedReason blocked_reason) {
447 Resource* resource = factory.Create(params.GetResourceRequest(), 447 Resource* resource = factory.Create(params.GetResourceRequest(),
448 params.Options(), params.Charset()); 448 params.Options(), params.Charset());
449 resource->GetError(ResourceError::CancelledDueToAccessCheckError( 449 resource->FinishAsError(ResourceError::CancelledDueToAccessCheckError(
450 params.Url(), blocked_reason)); 450 params.Url(), blocked_reason));
451 return resource; 451 return resource;
452 } 452 }
453 453
454 void ResourceFetcher::MakePreloadedResourceBlockOnloadIfNeeded( 454 void ResourceFetcher::MakePreloadedResourceBlockOnloadIfNeeded(
455 Resource* resource, 455 Resource* resource,
456 const FetchParameters& params) { 456 const FetchParameters& params) {
457 // TODO(yoav): Test that non-blocking resources (video/audio/track) continue 457 // TODO(yoav): Test that non-blocking resources (video/audio/track) continue
458 // to not-block even after being preloaded and discovered. 458 // to not-block even after being preloaded and discovered.
459 if (resource && resource->Loader() && 459 if (resource && resource->Loader() &&
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
1225 1225
1226 resource_timing_info_map_.Take(resource); 1226 resource_timing_info_map_.Take(resource);
1227 1227
1228 bool is_internal_request = resource->Options().initiator_info.name == 1228 bool is_internal_request = resource->Options().initiator_info.name ==
1229 FetchInitiatorTypeNames::internal; 1229 FetchInitiatorTypeNames::internal;
1230 1230
1231 Context().DispatchDidFail(resource->Identifier(), error, 1231 Context().DispatchDidFail(resource->Identifier(), error,
1232 resource->GetResponse().EncodedDataLength(), 1232 resource->GetResponse().EncodedDataLength(),
1233 is_internal_request); 1233 is_internal_request);
1234 1234
1235 resource->GetError(error); 1235 resource->FinishAsError(error);
1236 1236
1237 HandleLoadCompletion(resource); 1237 HandleLoadCompletion(resource);
1238 } 1238 }
1239 1239
1240 void ResourceFetcher::MoveResourceLoaderToNonBlocking(ResourceLoader* loader) { 1240 void ResourceFetcher::MoveResourceLoaderToNonBlocking(ResourceLoader* loader) {
1241 DCHECK(loader); 1241 DCHECK(loader);
1242 // TODO(yoav): Convert CHECK to DCHECK if no crash reports come in. 1242 // TODO(yoav): Convert CHECK to DCHECK if no crash reports come in.
1243 CHECK(loaders_.Contains(loader)); 1243 CHECK(loaders_.Contains(loader));
1244 non_blocking_loaders_.insert(loader); 1244 non_blocking_loaders_.insert(loader);
1245 loaders_.erase(loader); 1245 loaders_.erase(loader);
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1526 visitor->Trace(context_); 1526 visitor->Trace(context_);
1527 visitor->Trace(archive_); 1527 visitor->Trace(archive_);
1528 visitor->Trace(loaders_); 1528 visitor->Trace(loaders_);
1529 visitor->Trace(non_blocking_loaders_); 1529 visitor->Trace(non_blocking_loaders_);
1530 visitor->Trace(document_resources_); 1530 visitor->Trace(document_resources_);
1531 visitor->Trace(preloads_); 1531 visitor->Trace(preloads_);
1532 visitor->Trace(resource_timing_info_map_); 1532 visitor->Trace(resource_timing_info_map_);
1533 } 1533 }
1534 1534
1535 } // namespace blink 1535 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698