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

Side by Side Diff: third_party/WebKit/Source/core/fetch/ResourceLoader.cpp

Issue 1800333003: Keep multipart images in m_nonBlockingLoaders after first part loaded (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved.
3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com) 3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com)
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 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 RELEASE_ASSERT(m_state == ConnectionStateReceivedResponse); 122 RELEASE_ASSERT(m_state == ConnectionStateReceivedResponse);
123 m_fetcher->didDownloadData(m_resource.get(), length, encodedDataLength); 123 m_fetcher->didDownloadData(m_resource.get(), length, encodedDataLength);
124 if (m_state == ConnectionStateReleased) 124 if (m_state == ConnectionStateReleased)
125 return; 125 return;
126 m_resource->didDownloadData(length); 126 m_resource->didDownloadData(length);
127 } 127 }
128 128
129 void ResourceLoader::didFinishLoadingOnePart(double finishTime, int64_t encodedD ataLength) 129 void ResourceLoader::didFinishLoadingOnePart(double finishTime, int64_t encodedD ataLength)
130 { 130 {
131 ASSERT(m_state != ConnectionStateReleased); 131 ASSERT(m_state != ConnectionStateReleased);
132 if (!isFinishing()) { 132 if (!isFinishing()) {
yhirano 2016/03/16 02:17:33 [optional] It might be good to reorder clauses: I'
hiroshige 2016/03/16 21:18:43 Done.
133 // When loading a multipart resource, make the loader non-block when 133 // When loading a multipart resource, make the loader non-block when
134 // finishing loading the first part. 134 // finishing loading the first part.
135 m_fetcher->subresourceLoaderFinishedLoadingOnePart(this); 135 m_fetcher->moveResourceLoaderToNonBlocking(this);
136
137 m_fetcher->didLoadResource(m_resource.get());
138 if (m_state == ConnectionStateReleased)
139 return;
140 } else {
141 m_fetcher->removeResourceLoader(this);
136 } 142 }
137 143
138 if (m_state == ConnectionStateReleased)
139 return;
140
141 if (m_notifiedLoadComplete) 144 if (m_notifiedLoadComplete)
142 return; 145 return;
143 m_notifiedLoadComplete = true; 146 m_notifiedLoadComplete = true;
144 m_fetcher->didFinishLoading(m_resource.get(), finishTime, encodedDataLength) ; 147 m_fetcher->didFinishLoading(m_resource.get(), finishTime, encodedDataLength) ;
145 } 148 }
146 149
147 void ResourceLoader::didChangePriority(ResourceLoadPriority loadPriority, int in traPriorityValue) 150 void ResourceLoader::didChangePriority(ResourceLoadPriority loadPriority, int in traPriorityValue)
148 { 151 {
149 ASSERT(m_state != ConnectionStateReleased); 152 ASSERT(m_state != ConnectionStateReleased);
150 if (m_loader) 153 if (m_loader)
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 // empty buffer is a noop in most cases, but is destructive in the case of 409 // empty buffer is a noop in most cases, but is destructive in the case of
407 // a 304, where it will overwrite the cached data we should be reusing. 410 // a 304, where it will overwrite the cached data we should be reusing.
408 if (dataOut.size()) { 411 if (dataOut.size()) {
409 m_fetcher->didReceiveData(m_resource.get(), dataOut.data(), dataOut.size (), encodedDataLength); 412 m_fetcher->didReceiveData(m_resource.get(), dataOut.data(), dataOut.size (), encodedDataLength);
410 m_resource->setResourceBuffer(dataOut); 413 m_resource->setResourceBuffer(dataOut);
411 } 414 }
412 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); 415 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength);
413 } 416 }
414 417
415 } // namespace blink 418 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698