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

Unified Diff: chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.h

Issue 18986012: Media Galleries API Picasa: Make PicasaDataProvider handle async PMP and INI parsing robustly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0039-picasa-import-sandbox-ini-parsing
Patch Set: Created 7 years, 5 months 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/media_galleries/fileapi/safe_picasa_albums_indexer.h
diff --git a/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.h b/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.h
index 9c299ddac768a6da10b1f96a106842ec623dff46..e207aeb9658807f64c0dcf8b00c84bf3f2623b62 100644
--- a/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.h
+++ b/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.h
@@ -9,9 +9,11 @@
#include <vector>
#include "base/callback.h"
-#include "base/compiler_specific.h"
+#include "base/compiler_specific.h"
+#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
-#include "chrome/common/media_galleries/picasa_types.h"
+#include "chrome/common/media_galleries/picasa_types.h"
+#include "content/public/browser/utility_process_host.h"
#include "content/public/browser/utility_process_host_client.h"
namespace base {
@@ -31,7 +33,10 @@ namespace picasa {
// utility process replies or when it dies.
class SafePicasaAlbumsIndexer : public content::UtilityProcessHostClient {
public:
- typedef base::Callback<void(bool success,
+ // Callback includes a refptr to itself to guarantee that this object
+ // survives past the execution of its last posted callback.
+ typedef base::Callback<void(scoped_refptr<SafePicasaAlbumsIndexer>,
+ bool success,
const picasa::AlbumImagesMap&)> DoneCallback;
SafePicasaAlbumsIndexer(const AlbumMap& albums,
@@ -75,6 +80,9 @@ class SafePicasaAlbumsIndexer : public content::UtilityProcessHostClient {
std::vector<picasa::FolderINIContents> folders_inis_;
+ // Only accessed on the IO thread.
+ base::WeakPtr<content::UtilityProcessHost> utility_process_host_;
vandebo (ex-Chrome) 2013/07/12 18:29:59 This isn't used in this CL?
tommycli 2013/07/12 21:37:19 This is an aborted attempt to make the utility pro
+
// Only accessed on the Media Task Runner.
const DoneCallback callback_;

Powered by Google App Engine
This is Rietveld 408576698