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

Unified Diff: components/offline_pages/downloads/download_ui_adapter.h

Issue 2264233002: Fix a crash in DownloadUIAddapter that happens when Java bridge is created/removed quickly while (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more checks Created 4 years, 4 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
« no previous file with comments | « no previous file | components/offline_pages/downloads/download_ui_adapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/downloads/download_ui_adapter.h
diff --git a/components/offline_pages/downloads/download_ui_adapter.h b/components/offline_pages/downloads/download_ui_adapter.h
index 937799b697d314a2269818b0d734d0ccddfef043..a8ea99be966218913d20a2441b1f309a78e3f666 100644
--- a/components/offline_pages/downloads/download_ui_adapter.h
+++ b/components/offline_pages/downloads/download_ui_adapter.h
@@ -81,6 +81,12 @@ class DownloadUIAdapter : public OfflinePageModel::Observer,
const ClientId& client_id) override;
private:
+ enum class State {
+ NOT_LOADED,
+ LOADING,
+ LOADED
+ };
+
struct ItemInfo {
explicit ItemInfo(const OfflinePageItem& page);
~ItemInfo();
@@ -110,13 +116,14 @@ class DownloadUIAdapter : public OfflinePageModel::Observer,
// Always valid, this class is a member of the model.
OfflinePageModel* model_;
- bool is_loaded_;
+ State state_;
// The cache of UI items. The key is DownloadUIItem.guid.
DownloadUIItems items_;
// The observers.
base::ObserverList<Observer> observers_;
+ int observers_count_;
base::WeakPtrFactory<DownloadUIAdapter> weak_ptr_factory_;
« no previous file with comments | « no previous file | components/offline_pages/downloads/download_ui_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698