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

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: 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 125451)
+++ 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 {
brettw 2012/03/12 04:37:40 IT wasn't the intent for all random types to go in
mrossetti 2012/03/13 22:25:46 This class is used to exchange status between the
+ public:
+ explicit RefCountedBool(bool value) : bool_(value) {}
+
+ virtual const unsigned char* front() const OVERRIDE;
brettw 2012/03/12 04:37:40 Delete these.
mrossetti 2012/03/13 22:25:46 Done.
+ virtual size_t size() const OVERRIDE;
+
+ bool value() { return bool_; }
brettw 2012/03/12 04:37:40 This should be const.
mrossetti 2012/03/13 22:25:46 Done.
+ void set_value(bool value) { bool_ = value; }
+
+ private:
+ friend class base::RefCountedThreadSafe<RefCountedBool>;
+ virtual ~RefCountedBool();
+
+ bool bool_;
brettw 2012/03/12 04:37:40 This should be called "value_" to match the getter
+
+ DISALLOW_COPY_AND_ASSIGN(RefCountedBool);
+};
+
// Convenience Types -----------------------------------------------------------
typedef std::vector<string16> String16Vector;

Powered by Google App Engine
This is Rietveld 408576698