| Index: chrome/browser/prerender/prerender_contents.cc
|
| diff --git a/chrome/browser/prerender/prerender_contents.cc b/chrome/browser/prerender/prerender_contents.cc
|
| index 8fa33154e3bd9c25c03ed32d4a3017bcdc8852da..f533a2b02b92035af83821c71dc41e3d0b96970a 100644
|
| --- a/chrome/browser/prerender/prerender_contents.cc
|
| +++ b/chrome/browser/prerender/prerender_contents.cc
|
| @@ -70,7 +70,12 @@ const char* const kValidHttpMethodsForPrerendering[] = {
|
| };
|
|
|
| void ResumeThrottles(
|
| - std::vector<base::WeakPtr<PrerenderResourceThrottle> > throttles) {
|
| + std::vector<base::WeakPtr<PrerenderResourceThrottle>> throttles,
|
| + std::vector<base::WeakPtr<PrerenderResourceThrottle>> idle_resources) {
|
| + for (auto resource : idle_resources) {
|
| + if (resource)
|
| + resource->ResetResourcePriority();
|
| + }
|
| for (size_t i = 0; i < throttles.size(); i++) {
|
| if (throttles[i])
|
| throttles[i]->ResumeHandler();
|
| @@ -757,10 +762,10 @@ void PrerenderContents::PrepareForUse() {
|
| NotifyPrerenderStop();
|
|
|
| BrowserThread::PostTask(
|
| - BrowserThread::IO,
|
| - FROM_HERE,
|
| - base::Bind(&ResumeThrottles, resource_throttles_));
|
| + BrowserThread::IO, FROM_HERE,
|
| + base::Bind(&ResumeThrottles, resource_throttles_, idle_resources_));
|
| resource_throttles_.clear();
|
| + idle_resources_.clear();
|
| }
|
|
|
| void PrerenderContents::CancelPrerenderForPrinting() {
|
| @@ -778,6 +783,11 @@ void PrerenderContents::AddResourceThrottle(
|
| resource_throttles_.push_back(throttle);
|
| }
|
|
|
| +void PrerenderContents::AddIdleResource(
|
| + const base::WeakPtr<PrerenderResourceThrottle>& throttle) {
|
| + idle_resources_.push_back(throttle);
|
| +}
|
| +
|
| void PrerenderContents::AddNetworkBytes(int64_t bytes) {
|
| network_bytes_ += bytes;
|
| for (Observer& observer : observer_list_)
|
|
|