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

Unified Diff: chrome/browser/safe_browsing/threat_details.h

Issue 1569993003: Ensure ThreatDetails is always destroyed on the UI thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/threat_details.h
diff --git a/chrome/browser/safe_browsing/threat_details.h b/chrome/browser/safe_browsing/threat_details.h
index 4f9e981d5fb30d71a6e3c3754513468857d9c3be..b23e404cf3e529d836f0688315eb55d73a47e600 100644
--- a/chrome/browser/safe_browsing/threat_details.h
+++ b/chrome/browser/safe_browsing/threat_details.h
@@ -22,6 +22,7 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/safe_browsing/ui_manager.h"
#include "chrome/common/safe_browsing/csd.pb.h"
+#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents_observer.h"
#include "net/base/completion_callback.h"
@@ -44,7 +45,9 @@ typedef base::hash_map<
linked_ptr<ClientSafeBrowsingReportRequest::Resource>>
ResourceMap;
-class ThreatDetails : public base::RefCountedThreadSafe<ThreatDetails>,
+class ThreatDetails : public base::RefCountedThreadSafe<
+ ThreatDetails,
+ content::BrowserThread::DeleteOnUIThread>,
public content::WebContentsObserver {
public:
typedef SafeBrowsingUIManager::UnsafeResource UnsafeResource;
@@ -98,6 +101,9 @@ class ThreatDetails : public base::RefCountedThreadSafe<ThreatDetails>,
private:
friend class base::RefCountedThreadSafe<ThreatDetails>;
+ friend struct content::BrowserThread::DeleteOnThread<
+ content::BrowserThread::UI>;
+ friend class base::DeleteHelper<ThreatDetails>;
// Starts the collection of the report.
void StartCollection();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698