Index: chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc |
diff --git a/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc b/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc |
index 5a55b53ebe0d35213a75512f17ce3ef602d6b106..a6bac89494d692efdd5bb0a175540acf31fd4302 100644 |
--- a/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc |
+++ b/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc |
@@ -9,7 +9,6 @@ |
#include "chrome/common/chrome_utility_messages.h" |
#include "content/public/browser/browser_thread.h" |
#include "content/public/browser/child_process_data.h" |
-#include "content/public/browser/utility_process_host.h" |
using chrome::MediaFileSystemBackend; |
using content::BrowserThread; |
@@ -105,11 +104,14 @@ void SafePicasaAlbumsIndexer::StartWorkOnIOThread() { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
DCHECK_EQ(FINISHED_READING_INI_FILES_STATE, parser_state_); |
- UtilityProcessHost* host = |
- UtilityProcessHost::Create(this, base::MessageLoopProxy::current()); |
- host->EnableZygote(); |
- host->Send(new ChromeUtilityMsg_IndexPicasaAlbumsContents(album_uids_, |
- folders_inis_)); |
+ utility_process_host_ = content::UtilityProcessHost::Create( |
+ this, |
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get()) |
+ ->AsWeakPtr(); |
+ |
+ utility_process_host_->EnableZygote(); |
+ utility_process_host_->Send(new ChromeUtilityMsg_IndexPicasaAlbumsContents( |
+ album_uids_, folders_inis_)); |
parser_state_ = STARTED_PARSING_STATE; |
} |
@@ -121,7 +123,9 @@ void SafePicasaAlbumsIndexer::OnIndexPicasaAlbumsContentsFinished( |
MediaFileSystemBackend::MediaTaskRunner()->PostTask( |
FROM_HERE, |
- base::Bind(callback_, albums_images)); |
+ base::Bind(callback_, |
+ make_scoped_refptr(this), |
+ albums_images)); |
parser_state_ = FINISHED_PARSING_STATE; |
} |