diff options
author | groby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-29 02:18:47 +0000 |
---|---|---|
committer | groby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-29 02:18:47 +0000 |
commit | c90388e337eef11ba7bc80d5d734347e87660ab6 (patch) | |
tree | 9a7e59dcc9b05ae33f6adc5470b1a1937ddca03e /chrome/browser/instant/instant_controller.cc | |
parent | 5f819e2f365b7031b7243bbddc0038e0cb0d2421 (diff) | |
download | chromium_src-c90388e337eef11ba7bc80d5d734347e87660ab6.zip chromium_src-c90388e337eef11ba7bc80d5d734347e87660ab6.tar.gz chromium_src-c90388e337eef11ba7bc80d5d734347e87660ab6.tar.bz2 |
base::Bind fixes
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/8666011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111830 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/instant/instant_controller.cc')
-rw-r--r-- | chrome/browser/instant/instant_controller.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc index 62ed8e9..d4d3078 100644 --- a/chrome/browser/instant/instant_controller.cc +++ b/chrome/browser/instant/instant_controller.cc @@ -4,6 +4,7 @@ #include "chrome/browser/instant/instant_controller.h" +#include "base/bind.h" #include "base/command_line.h" #include "base/message_loop.h" #include "base/metrics/histogram.h" @@ -43,7 +44,7 @@ InstantController::InstantController(Profile* profile, is_out_of_date_(true), commit_on_mouse_up_(false), last_transition_type_(content::PAGE_TRANSITION_LINK), - ALLOW_THIS_IN_INITIALIZER_LIST(destroy_factory_(this)) { + ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { PrefService* service = profile->GetPrefs(); if (service && !InstantFieldTrial::IsInstantExperiment(profile)) { // kInstantEnabledOnce was added after instant, set it now to make sure it @@ -550,10 +551,10 @@ void InstantController::ClearBlacklist() { void InstantController::ScheduleDestroy(InstantLoader* loader) { loaders_to_destroy_.push_back(loader); - if (destroy_factory_.empty()) { + if (!weak_factory_.HasWeakPtrs()) { MessageLoop::current()->PostTask( - FROM_HERE, destroy_factory_.NewRunnableMethod( - &InstantController::DestroyLoaders)); + FROM_HERE, base::Bind(&InstantController::DestroyLoaders, + weak_factory_.GetWeakPtr())); } } |