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

Side by Side Diff: extensions/browser/stash_backend.h

Issue 638273004: Move stash_backend into extensions/browser/mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « extensions/browser/mojo/stash_backend_unittest.cc ('k') | extensions/browser/stash_backend.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef EXTENSIONS_BROWSER_STASH_BACKEND_H_
6 #define EXTENSIONS_BROWSER_STASH_BACKEND_H_
7
8 #include <vector>
9
10 #include "base/memory/linked_ptr.h"
11 #include "base/memory/weak_ptr.h"
12 #include "extensions/common/stash.mojom.h"
13 #include "mojo/public/cpp/bindings/interface_request.h"
14
15 namespace extensions {
16
17 // A backend that provides access to StashService for a single extension.
18 class StashBackend {
19 public:
20 StashBackend();
21 ~StashBackend();
22
23 // Creates a StashService that forwards calls to this StashBackend and bind it
24 // to |request|.
25 void BindToRequest(mojo::InterfaceRequest<StashService> request);
26
27 // Adds the StashedObjects contained within |stash| to the stash.
28 void AddToStash(mojo::Array<StashedObjectPtr> stash);
29
30 // Returns all StashedObjects added to the stash since the last call to
31 // RetrieveStash.
32 mojo::Array<StashedObjectPtr> RetrieveStash();
33
34 private:
35 // The objects that have been stashed.
36 mojo::Array<StashedObjectPtr> stashed_objects_;
37
38 base::WeakPtrFactory<StashBackend> weak_factory_;
39
40 DISALLOW_COPY_AND_ASSIGN(StashBackend);
41 };
42
43 } // namespace extensions
44
45 #endif // EXTENSIONS_BROWSER_STASH_BACKEND_H_
OLDNEW
« no previous file with comments | « extensions/browser/mojo/stash_backend_unittest.cc ('k') | extensions/browser/stash_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698