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

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

Issue 153983004: Schedule image resource downloads by decreasing visual impact - Blink Side (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changes from review. Created 6 years, 10 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) 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // JavaScript that changes the window location), do nothing. 193 // JavaScript that changes the window location), do nothing.
194 if (m_state == Terminated) 194 if (m_state == Terminated)
195 return; 195 return;
196 196
197 if (m_notifiedLoadComplete) 197 if (m_notifiedLoadComplete)
198 return; 198 return;
199 m_notifiedLoadComplete = true; 199 m_notifiedLoadComplete = true;
200 m_host->didFinishLoading(m_resource, finishTime); 200 m_host->didFinishLoading(m_resource, finishTime);
201 } 201 }
202 202
203 void ResourceLoader::didChangePriority(ResourceLoadPriority loadPriority) 203 void ResourceLoader::didChangePriority(ResourceLoadPriority loadPriority, int in traPriorityValue)
204 { 204 {
205 if (m_loader) { 205 if (m_loader) {
206 m_host->didChangeLoadingPriority(m_resource, loadPriority); 206 m_host->didChangeLoadingPriority(m_resource, loadPriority, intraPriority Value);
207 m_loader->didChangePriority(static_cast<blink::WebURLRequest::Priority>( loadPriority)); 207 m_loader->didChangePriority(static_cast<blink::WebURLRequest::Priority>( loadPriority), intraPriorityValue);
208 } 208 }
209 } 209 }
210 210
211 void ResourceLoader::cancelIfNotFinishing() 211 void ResourceLoader::cancelIfNotFinishing()
212 { 212 {
213 if (m_state != Initialized) 213 if (m_state != Initialized)
214 return; 214 return;
215 cancel(); 215 cancel();
216 } 216 }
217 217
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 didReceiveResponse(0, responseOut); 456 didReceiveResponse(0, responseOut);
457 if (m_state == Terminated) 457 if (m_state == Terminated)
458 return; 458 return;
459 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse() .resourceLoadInfo(); 459 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse() .resourceLoadInfo();
460 m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), resourceL oadInfo ? resourceLoadInfo->encodedDataLength : -1); 460 m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), resourceL oadInfo ? resourceLoadInfo->encodedDataLength : -1);
461 m_resource->setResourceBuffer(dataOut); 461 m_resource->setResourceBuffer(dataOut);
462 didFinishLoading(0, monotonicallyIncreasingTime()); 462 didFinishLoading(0, monotonicallyIncreasingTime());
463 } 463 }
464 464
465 } 465 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698