Index: extensions/browser/mojo/stash_backend.h |
diff --git a/extensions/browser/mojo/stash_backend.h b/extensions/browser/mojo/stash_backend.h |
index 2aff13494ddd2f511c243944fb965097812096d0..07d506d9718d7aec4fe7a46df6b68b965a4c9468 100644 |
--- a/extensions/browser/mojo/stash_backend.h |
+++ b/extensions/browser/mojo/stash_backend.h |
@@ -7,6 +7,7 @@ |
#include <vector> |
+#include "base/callback.h" |
#include "base/memory/linked_ptr.h" |
#include "base/memory/weak_ptr.h" |
#include "extensions/common/mojo/stash.mojom.h" |
@@ -17,7 +18,7 @@ namespace extensions { |
// A backend that provides access to StashService for a single extension. |
class StashBackend { |
public: |
- StashBackend(); |
+ explicit StashBackend(const base::Closure& on_handle_readable); |
~StashBackend(); |
// Creates a StashService that forwards calls to this StashBackend and bind it |
@@ -32,8 +33,19 @@ class StashBackend { |
mojo::Array<StashedObjectPtr> RetrieveStash(); |
private: |
+ class StashEntry; |
+ |
+ // Invoked when a handle is readable. |
+ void OnHandleReady(); |
+ |
// The objects that have been stashed. |
- mojo::Array<StashedObjectPtr> stashed_objects_; |
+ std::vector<linked_ptr<StashEntry>> stashed_objects_; |
+ |
+ // The callback to call when a handle is readable. |
+ const base::Closure on_handle_readable_; |
+ |
+ // Whether a handle has become readable since the last RetrieveStash() call. |
+ bool has_notified_; |
base::WeakPtrFactory<StashBackend> weak_factory_; |