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

Unified Diff: chrome/browser/dom_ui/slideshow_ui.cc

Issue 5710002: Create base::WorkerPoolJob. Use it for HostResolverImpl and DirectoryLister. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 10 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/dom_ui/slideshow_ui.cc
diff --git a/chrome/browser/dom_ui/slideshow_ui.cc b/chrome/browser/dom_ui/slideshow_ui.cc
index da8a8075d8d990886d723a93ecfc808842cdfd5e..6305b92c1e65226ec3efef33e4fbb0c048aa94ba 100644
--- a/chrome/browser/dom_ui/slideshow_ui.cc
+++ b/chrome/browser/dom_ui/slideshow_ui.cc
@@ -58,7 +58,7 @@ class SlideshowUIHTMLSource : public ChromeURLDataManager::DataSource {
};
// The handler for Javascript messages related to the "slideshow" view.
-class SlideshowHandler : public net::DirectoryLister::DirectoryListerDelegate,
+class SlideshowHandler : public net::DirectoryLister::Delegate,
public DOMMessageHandler,
public base::SupportsWeakPtr<SlideshowHandler> {
public:
@@ -68,9 +68,8 @@ class SlideshowHandler : public net::DirectoryLister::DirectoryListerDelegate,
// Init work after Attach.
void Init();
- // DirectoryLister::DirectoryListerDelegate methods:
- virtual void OnListFile(
- const net::DirectoryLister::DirectoryListerData& data);
+ // DirectoryLister::Delegate methods:
+ virtual void OnListFile(const net::DirectoryLister::Data& data);
virtual void OnListDone(int error);
// DOMMessageHandler implementation.
@@ -93,7 +92,7 @@ class SlideshowHandler : public net::DirectoryLister::DirectoryListerDelegate,
Profile* profile_;
int counter_;
int currentOffset_;
- scoped_refptr<net::DirectoryLister> lister_;
+ scoped_ptr<net::DirectoryLister> lister_;
bool is_refresh_;
DISALLOW_COPY_AND_ASSIGN(SlideshowHandler);
@@ -138,15 +137,9 @@ void SlideshowUIHTMLSource::StartDataRequest(const std::string& path,
SlideshowHandler::SlideshowHandler()
: profile_(NULL),
is_refresh_(false) {
- lister_ = NULL;
}
-SlideshowHandler::~SlideshowHandler() {
- if (lister_.get()) {
- lister_->Cancel();
- lister_->set_delegate(NULL);
- }
-}
+SlideshowHandler::~SlideshowHandler() {}
DOMMessageHandler* SlideshowHandler::Attach(DOMUI* dom_ui) {
// Create our favicon data source.
@@ -182,20 +175,16 @@ void SlideshowHandler::GetChildrenForPath(const FilePath& path,
filelist_value_.reset(new ListValue());
currentpath_ = path;
- if (lister_.get()) {
- lister_->Cancel();
- lister_->set_delegate(NULL);
- lister_ = NULL;
- }
+ lister_.reset();
is_refresh_ = is_refresh;
if (file_util::EnsureEndsWithSeparator(&currentpath_) &&
currentpath_.IsAbsolute()) {
- lister_ = new net::DirectoryLister(currentpath_, this);
+ lister_.reset(new net::DirectoryLister(currentpath_, this));
} else {
originalpath_ = currentpath_;
currentpath_ = currentpath_.DirName();
- lister_ = new net::DirectoryLister(currentpath_, this);
+ lister_.reset(new net::DirectoryLister(currentpath_, this));
}
counter_ = 0;
currentOffset_ = -1;
@@ -228,8 +217,7 @@ bool SlideshowHandler::PathIsImageFile(const char* filename) {
#endif
}
-void SlideshowHandler::OnListFile(
- const net::DirectoryLister::DirectoryListerData& data) {
+void SlideshowHandler::OnListFile(const net::DirectoryLister::Data& data) {
#if defined(OS_CHROMEOS)
if (data.info.filename[0] == '.') {
return;

Powered by Google App Engine
This is Rietveld 408576698