OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "extensions/browser/stash_backend.h" | 5 #include "extensions/browser/mojo/stash_backend.h" |
6 | 6 |
7 namespace extensions { | 7 namespace extensions { |
8 | 8 |
9 // An implementation of StashService that forwards calls to a StashBackend. | 9 // An implementation of StashService that forwards calls to a StashBackend. |
10 class StashServiceImpl : public mojo::InterfaceImpl<StashService> { | 10 class StashServiceImpl : public mojo::InterfaceImpl<StashService> { |
11 public: | 11 public: |
12 explicit StashServiceImpl(base::WeakPtr<StashBackend> backend); | 12 explicit StashServiceImpl(base::WeakPtr<StashBackend> backend); |
13 ~StashServiceImpl() override; | 13 ~StashServiceImpl() override; |
14 | 14 |
15 // mojo::InterfaceImpl<StashService> overrides. | 15 // mojo::InterfaceImpl<StashService> overrides. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 void StashServiceImpl::RetrieveStash( | 64 void StashServiceImpl::RetrieveStash( |
65 const mojo::Callback<void(mojo::Array<StashedObjectPtr>)>& callback) { | 65 const mojo::Callback<void(mojo::Array<StashedObjectPtr>)>& callback) { |
66 if (!backend_) { | 66 if (!backend_) { |
67 callback.Run(mojo::Array<StashedObjectPtr>(0)); | 67 callback.Run(mojo::Array<StashedObjectPtr>(0)); |
68 return; | 68 return; |
69 } | 69 } |
70 callback.Run(backend_->RetrieveStash()); | 70 callback.Run(backend_->RetrieveStash()); |
71 } | 71 } |
72 | 72 |
73 } // namespace extensions | 73 } // namespace extensions |
OLD | NEW |