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

Side by Side Diff: components/arc/test/fake_app_instance.h

Issue 1921973002: Convert //components/[a-e]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef COMPONENTS_ARC_TEST_FAKE_APP_INSTANCE_H_ 5 #ifndef COMPONENTS_ARC_TEST_FAKE_APP_INSTANCE_H_
6 #define COMPONENTS_ARC_TEST_FAKE_APP_INSTANCE_H_ 6 #define COMPONENTS_ARC_TEST_FAKE_APP_INSTANCE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory>
9 #include <string> 10 #include <string>
10 #include <vector> 11 #include <vector>
11 12
12 #include "base/macros.h" 13 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "base/memory/scoped_vector.h" 14 #include "base/memory/scoped_vector.h"
15 #include "components/arc/common/app.mojom.h" 15 #include "components/arc/common/app.mojom.h"
16 #include "mojo/public/cpp/bindings/binding.h" 16 #include "mojo/public/cpp/bindings/binding.h"
17 17
18 namespace arc { 18 namespace arc {
19 19
20 class FakeAppInstance : public mojom::AppInstance { 20 class FakeAppInstance : public mojom::AppInstance {
21 public: 21 public:
22 class Request { 22 class Request {
23 public: 23 public:
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // mojom::AppHost::OnAppInstanceReady(), which in turn calls 110 // mojom::AppHost::OnAppInstanceReady(), which in turn calls
111 // mojom::AppInstance::Init() and 111 // mojom::AppInstance::Init() and
112 // mojom::AppInstance::RefreshAppList(). This method should be called after a 112 // mojom::AppInstance::RefreshAppList(). This method should be called after a
113 // call 113 // call
114 // to mojom::ArcBridgeHost::OnAppInstanceReady() to make sure all method calls 114 // to mojom::ArcBridgeHost::OnAppInstanceReady() to make sure all method calls
115 // have 115 // have
116 // been dispatched. 116 // been dispatched.
117 void WaitForOnAppInstanceReady(); 117 void WaitForOnAppInstanceReady();
118 118
119 private: 119 private:
120 using TaskIdToInfo = std::map<int32_t, scoped_ptr<Request>>; 120 using TaskIdToInfo = std::map<int32_t, std::unique_ptr<Request>>;
121 // Mojo endpoints. 121 // Mojo endpoints.
122 mojo::Binding<mojom::AppInstance> binding_; 122 mojo::Binding<mojom::AppInstance> binding_;
123 mojom::AppHost* app_host_; 123 mojom::AppHost* app_host_;
124 // Number of RefreshAppList calls. 124 // Number of RefreshAppList calls.
125 int refresh_app_list_count_ = 0; 125 int refresh_app_list_count_ = 0;
126 // Keeps information about launch requests. 126 // Keeps information about launch requests.
127 ScopedVector<Request> launch_requests_; 127 ScopedVector<Request> launch_requests_;
128 // Keeps information about icon load requests. 128 // Keeps information about icon load requests.
129 ScopedVector<IconRequest> icon_requests_; 129 ScopedVector<IconRequest> icon_requests_;
130 // Keeps information for running tasks. 130 // Keeps information for running tasks.
131 TaskIdToInfo task_id_to_info_; 131 TaskIdToInfo task_id_to_info_;
132 132
133 DISALLOW_COPY_AND_ASSIGN(FakeAppInstance); 133 DISALLOW_COPY_AND_ASSIGN(FakeAppInstance);
134 }; 134 };
135 135
136 } // namespace arc 136 } // namespace arc
137 137
138 #endif // COMPONENTS_ARC_TEST_FAKE_APP_INSTANCE_H_ 138 #endif // COMPONENTS_ARC_TEST_FAKE_APP_INSTANCE_H_
OLDNEW
« no previous file with comments | « components/arc/standalone/service_helper_unittest.cc ('k') | components/audio_modem/audio_player_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698