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

Unified Diff: chrome/browser/history/in_memory_url_index_types.h

Issue 9030031: Move InMemoryURLIndex Caching Operations to FILE Thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Use proper refcounted structures for passing around status. Created 8 years, 9 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/history/in_memory_url_index_types.h
===================================================================
--- chrome/browser/history/in_memory_url_index_types.h (revision 125078)
+++ chrome/browser/history/in_memory_url_index_types.h (working copy)
@@ -10,6 +10,7 @@
#include <set>
#include <vector>
+#include "base/memory/ref_counted.h"
#include "base/string16.h"
#include "chrome/browser/history/history_types.h"
#include "chrome/browser/autocomplete/history_provider_util.h"
@@ -74,6 +75,29 @@
};
typedef std::vector<ScoredHistoryMatch> ScoredHistoryMatches;
+// RefCountedBool --------------------------------------------------------------
+
+// An implementation of RefCountedMemory that manages a bool that we use for
+// passing around success when saving our cache.
+class RefCountedBool : public RefCountedMemory {
+ public:
+ explicit RefCountedBool(bool value) : bool_(value) {}
+
+ virtual const unsigned char* front() const OVERRIDE;
+ virtual size_t size() const OVERRIDE;
+
+ bool value() { return bool_; }
+ void set_value(bool value) { bool_ = value; }
+
+ private:
+ friend class base::RefCountedThreadSafe<RefCountedBool>;
+ virtual ~RefCountedBool();
+
+ bool bool_;
+
+ DISALLOW_COPY_AND_ASSIGN(RefCountedBool);
+};
+
// Convenience Types -----------------------------------------------------------
typedef std::vector<string16> String16Vector;

Powered by Google App Engine
This is Rietveld 408576698