From 156ed27bc42a66a694e243f3ecb0ad80f0c83351 Mon Sep 17 00:00:00 2001 From: "tony@chromium.org" Date: Mon, 23 Nov 2009 18:31:25 +0000 Subject: Take 2 at moving 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. The last change had a regression on the mac new tab perf, so I suspect it's the extra round trip to the UI thread when trying to load the CSS (the UI thread is probably just busy at that time). Instead, I'm moving the generation of the CSS to the time the object is constructed, rather than when the resource is requested. This is like the code before, except sometimes we'll hit the cache. BUG=26228 Review URL: http://codereview.chromium.org/427003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32815 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/testing_profile.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'chrome/test/testing_profile.cc') 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()); -- cgit v1.1