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

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

Issue 717453002: Remove unnecessary methods and collapse function calls in the preloader code (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 | « Source/core/fetch/ResourceFetcher.h ('k') | Source/core/html/parser/HTMLResourcePreloader.h » ('j') | 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) 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 rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 { 1226 {
1227 if (res->ignoreForRequestCount()) 1227 if (res->ignoreForRequestCount())
1228 return; 1228 return;
1229 1229
1230 --m_requestCount; 1230 --m_requestCount;
1231 ASSERT(m_requestCount > -1); 1231 ASSERT(m_requestCount > -1);
1232 } 1232 }
1233 1233
1234 void ResourceFetcher::preload(Resource::Type type, FetchRequest& request, const String& charset) 1234 void ResourceFetcher::preload(Resource::Type type, FetchRequest& request, const String& charset)
1235 { 1235 {
1236 requestPreload(type, request, charset);
1237 }
1238
1239 void ResourceFetcher::requestPreload(Resource::Type type, FetchRequest& request, const String& charset)
1240 {
1241 // Ensure main resources aren't preloaded, since the cache can't actually re use the preload. 1236 // Ensure main resources aren't preloaded, since the cache can't actually re use the preload.
1242 if (type == Resource::MainResource) 1237 if (type == Resource::MainResource)
1243 return; 1238 return;
1244 1239
1245 String encoding; 1240 String encoding;
1246 if (type == Resource::Script || type == Resource::CSSStyleSheet) 1241 if (type == Resource::Script || type == Resource::CSSStyleSheet)
1247 encoding = charset.isEmpty() ? m_document->charset().string() : charset; 1242 encoding = charset.isEmpty() ? m_document->charset().string() : charset;
1248 1243
1249 request.setCharset(encoding); 1244 request.setCharset(encoding);
1250 request.setForPreload(true); 1245 request.setForPreload(true);
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1563 1558
1564 void ResourceFetcher::trace(Visitor* visitor) 1559 void ResourceFetcher::trace(Visitor* visitor)
1565 { 1560 {
1566 visitor->trace(m_document); 1561 visitor->trace(m_document);
1567 visitor->trace(m_loaders); 1562 visitor->trace(m_loaders);
1568 visitor->trace(m_multipartLoaders); 1563 visitor->trace(m_multipartLoaders);
1569 ResourceLoaderHost::trace(visitor); 1564 ResourceLoaderHost::trace(visitor);
1570 } 1565 }
1571 1566
1572 } 1567 }
OLDNEW
« no previous file with comments | « Source/core/fetch/ResourceFetcher.h ('k') | Source/core/html/parser/HTMLResourcePreloader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698