summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-20 20:00:53 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-20 20:00:53 +0000
commit2d95d36188d22deb05a2d243ec36170939ebd321 (patch)
treea2b378766ecb4b607629e6ea428f9625b324b33e /chrome/test
parentf76b49d07507a14b5ef9e9f85b8bd5644f50199a (diff)
downloadchromium_src-2d95d36188d22deb05a2d243ec36170939ebd321.zip
chromium_src-2d95d36188d22deb05a2d243ec36170939ebd321.tar.gz
chromium_src-2d95d36188d22deb05a2d243ec36170939ebd321.tar.bz2
Move NTP CSS resources into the NTP resource cache.
Moving the HTML to the cache saved 8ms on New Tab Warm on Windows, maybe we can shave a few more ms off by moving the CSS. http://build.chromium.org/buildbot/perf/xp-release-dual-core/new-tab-ui-warm/report.html?history=150 After this change, I'm going to try to do some cleanup to merge NewTabHTMLSource into DOMUIThemeSource since these classes are both quite small now. BUG=26228 Review URL: http://codereview.chromium.org/413004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32649 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/testing_profile.cc7
-rw-r--r--chrome/test/testing_profile.h4
2 files changed, 10 insertions, 1 deletions
diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc
index b718773..39e847a 100644
--- a/chrome/test/testing_profile.cc
+++ b/chrome/test/testing_profile.cc
@@ -7,6 +7,7 @@
#include "build/build_config.h"
#include "base/string_util.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
+#include "chrome/browser/dom_ui/ntp_resource_cache.h"
#include "chrome/browser/history/history_backend.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/common/chrome_constants.h"
@@ -201,6 +202,12 @@ void TestingProfile::InitThemes() {
}
}
+NTPResourceCache* TestingProfile::GetNTPResourceCache() {
+ if (!ntp_resource_cache_.get())
+ ntp_resource_cache_.reset(new NTPResourceCache(this));
+ return ntp_resource_cache_.get();
+}
+
void TestingProfile::BlockUntilHistoryProcessesPendingRequests() {
DCHECK(history_service_.get());
DCHECK(MessageLoop::current());
diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h
index 677bb7e..37c35ea 100644
--- a/chrome/test/testing_profile.h
+++ b/chrome/test/testing_profile.h
@@ -182,7 +182,7 @@ class TestingProfile : public Profile {
virtual void MarkAsCleanShutdown() {}
virtual void InitExtensions() {}
virtual void InitWebResources() {}
- virtual NTPResourceCache* GetNTPResourceCache() { return NULL; }
+ virtual NTPResourceCache* GetNTPResourceCache();
virtual DesktopNotificationService* GetDesktopNotificationService() {
return NULL;
}
@@ -220,6 +220,8 @@ class TestingProfile : public Profile {
// The TemplateURLFetcher. Only created if CreateTemplateURLModel is invoked.
scoped_ptr<TemplateURLModel> template_url_model_;
+ scoped_ptr<NTPResourceCache> ntp_resource_cache_;
+
// The SessionService. Defaults to NULL, but can be set using the setter.
scoped_refptr<SessionService> session_service_;