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

Unified Diff: content/public/browser/dom_storage_context.h

Issue 9704048: Make the content::DOMStorageContext methods callable on the main thread and hide the threading deta… (Closed) Base URL: svn://chrome-svn/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: content/public/browser/dom_storage_context.h
===================================================================
--- content/public/browser/dom_storage_context.h (revision 126737)
+++ content/public/browser/dom_storage_context.h (working copy)
@@ -8,14 +8,13 @@
#include <vector>
+#include "base/callback.h"
#include "base/string16.h"
-#include "base/memory/ref_counted.h"
#include "content/common/content_export.h"
class FilePath;
namespace base {
-class SequencedTaskRunner;
class Time;
}
@@ -24,17 +23,15 @@
class BrowserContext;
// Represents the per-BrowserContext Local Storage data.
-// Call these methods only on tasks scheduled via it's task_runner().
-class DOMStorageContext : public base::RefCountedThreadSafe<DOMStorageContext> {
+class DOMStorageContext {
public:
virtual ~DOMStorageContext() {}
michaeln 2012/03/15 02:49:44 maybe make the dtor protected
jam 2012/03/15 04:06:17 Done.
- // Returns a task runner which should be used to schedule tasks
- // which can invoke the other methods of this interface.
- virtual base::SequencedTaskRunner* task_runner() const = 0;
+ typedef base::Callback<void(const std::vector<FilePath>&)>
+ GetAllStorageFilesCallback;
- // Returns all the file paths of local storage files.
- virtual std::vector<FilePath> GetAllStorageFiles() = 0;
+ // Returns all the file paths of local storage files to the given callback.
+ virtual void GetAllStorageFiles(GetAllStorageFilesCallback callback) = 0;
michaeln 2012/03/15 01:26:02 const ref here?
jam 2012/03/15 04:06:17 Done.
// Get the file name of the local storage file for the given origin.
virtual FilePath GetFilePath(const string16& origin_id) const = 0;

Powered by Google App Engine
This is Rietveld 408576698