Index: chrome/browser/search/instant_service.cc |
diff --git a/chrome/browser/search/instant_service.cc b/chrome/browser/search/instant_service.cc |
index 7b671d2bb06602c249c3467bb95d292e09afae37..1e4fa9fe5fb7b419ae8298193c2bb8dd0f678616 100644 |
--- a/chrome/browser/search/instant_service.cc |
+++ b/chrome/browser/search/instant_service.cc |
@@ -67,8 +67,6 @@ RGBAColor SkColorToRGBAColor(const SkColor& sKColor) { |
InstantService::InstantService(Profile* profile) |
: profile_(profile), |
- ntp_prerenderer_(profile, this, profile->GetPrefs()), |
- browser_instant_controller_object_count_(0), |
weak_ptr_factory_(this) { |
// Stub for unit tests. |
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) |
@@ -124,8 +122,6 @@ InstantService::InstantService(Profile* profile) |
registrar_.Add(this, chrome::NOTIFICATION_GOOGLE_URL_UPDATED, |
content::Source<Profile>(profile_->GetOriginalProfile())); |
- registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, |
- content::Source<Profile>(profile_)); |
} |
InstantService::~InstantService() { |
@@ -205,37 +201,6 @@ void InstantService::Shutdown() { |
instant_io_context_ = NULL; |
} |
-scoped_ptr<content::WebContents> InstantService::ReleaseNTPContents() { |
- return ntp_prerenderer_.ReleaseNTPContents(); |
-} |
- |
-content::WebContents* InstantService::GetNTPContents() const { |
- return ntp_prerenderer_.GetNTPContents(); |
-} |
- |
-void InstantService::OnBrowserInstantControllerCreated() { |
- if (profile_->IsOffTheRecord()) |
- return; |
- |
- ++browser_instant_controller_object_count_; |
- |
- if (browser_instant_controller_object_count_ == 1) |
- ntp_prerenderer_.ReloadInstantNTP(); |
-} |
- |
-void InstantService::OnBrowserInstantControllerDestroyed() { |
- if (profile_->IsOffTheRecord()) |
- return; |
- |
- DCHECK_GT(browser_instant_controller_object_count_, 0U); |
- --browser_instant_controller_object_count_; |
- |
- // All browser windows have closed, so release the InstantNTP resources to |
- // work around http://crbug.com/180810. |
- if (browser_instant_controller_object_count_ == 0) |
- ntp_prerenderer_.DeleteNTPContents(); |
-} |
- |
void InstantService::Observe(int type, |
const content::NotificationSource& source, |
const content::NotificationDetails& details) { |
@@ -263,16 +228,6 @@ void InstantService::Observe(int type, |
break; |
} |
#endif // defined(ENABLE_THEMES) |
- case chrome::NOTIFICATION_PROFILE_DESTROYED: { |
- // Last chance to delete InstantNTP contents. We generally delete |
- // preloaded InstantNTP when the last BrowserInstantController object is |
- // destroyed. When the browser shutdown happens without closing browsers, |
- // there is a race condition between BrowserInstantController destruction |
- // and Profile destruction. |
- if (GetNTPContents()) |
- ntp_prerenderer_.DeleteNTPContents(); |
- break; |
- } |
case chrome::NOTIFICATION_GOOGLE_URL_UPDATED: { |
OnGoogleURLUpdated( |
content::Source<Profile>(source).ptr(), |
@@ -476,10 +431,6 @@ void InstantService::OnDefaultSearchProviderChanged( |
InstantServiceObserver, observers_, DefaultSearchProviderChanged()); |
} |
-InstantNTPPrerenderer* InstantService::ntp_prerenderer() { |
- return &ntp_prerenderer_; |
-} |
- |
void InstantService::ResetInstantSearchPrerenderer() { |
if (!chrome::ShouldPrefetchSearchResults()) |
return; |