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

Side by Side Diff: chrome/browser/task_manager/providers/arc/arc_process_task.h

Issue 2655233007: Get rid of RefCounted for ActivityIconLoader. (Closed)
Patch Set: address comments Created 3 years, 10 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 CHROME_BROWSER_TASK_MANAGER_PROVIDERS_ARC_ARC_PROCESS_TASK_H_ 5 #ifndef CHROME_BROWSER_TASK_MANAGER_PROVIDERS_ARC_ARC_PROCESS_TASK_H_
6 #define CHROME_BROWSER_TASK_MANAGER_PROVIDERS_ARC_ARC_PROCESS_TASK_H_ 6 #define CHROME_BROWSER_TASK_MANAGER_PROVIDERS_ARC_ARC_PROCESS_TASK_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "chrome/browser/task_manager/providers/task.h" 14 #include "chrome/browser/task_manager/providers/task.h"
15 #include "components/arc/common/intent_helper.mojom.h" 15 #include "components/arc/common/intent_helper.mojom.h"
16 #include "components/arc/common/process.mojom.h" 16 #include "components/arc/common/process.mojom.h"
17 #include "components/arc/instance_holder.h" 17 #include "components/arc/instance_holder.h"
18 #include "components/arc/intent_helper/activity_icon_loader.h" 18 #include "components/arc/intent_helper/arc_intent_helper_bridge.h"
19 19
20 namespace task_manager { 20 namespace task_manager {
21 21
22 // Defines a task that represents an ARC process. 22 // Defines a task that represents an ARC process.
23 class ArcProcessTask 23 class ArcProcessTask
24 : public Task, 24 : public Task,
25 public arc::InstanceHolder<arc::mojom::IntentHelperInstance>::Observer { 25 public arc::InstanceHolder<arc::mojom::IntentHelperInstance>::Observer {
26 public: 26 public:
27 ArcProcessTask(base::ProcessId pid, 27 ArcProcessTask(base::ProcessId pid,
28 base::ProcessId nspid, 28 base::ProcessId nspid,
(...skipping 12 matching lines...) Expand all
41 void OnInstanceReady() override; 41 void OnInstanceReady() override;
42 42
43 void SetProcessState(arc::mojom::ProcessState process_state); 43 void SetProcessState(arc::mojom::ProcessState process_state);
44 44
45 base::ProcessId nspid() const { return nspid_; } 45 base::ProcessId nspid() const { return nspid_; }
46 const std::string& process_name() const { return process_name_; } 46 const std::string& process_name() const { return process_name_; }
47 47
48 private: 48 private:
49 void StartIconLoading(); 49 void StartIconLoading();
50 void OnIconLoaded( 50 void OnIconLoaded(
51 std::unique_ptr<arc::ActivityIconLoader::ActivityToIconsMap> icons); 51 std::unique_ptr<arc::ArcIntentHelperBridge::ActivityToIconsMap> icons);
52 52
53 const base::ProcessId nspid_; 53 const base::ProcessId nspid_;
54 const std::string process_name_; 54 const std::string process_name_;
55 arc::mojom::ProcessState process_state_; 55 arc::mojom::ProcessState process_state_;
56 const std::string package_name_; 56 const std::string package_name_;
57 57
58 // Note: This should remain the last member so it'll be destroyed and 58 // Note: This should remain the last member so it'll be destroyed and
59 // invalidate the weak pointers before any other members are destroyed. 59 // invalidate the weak pointers before any other members are destroyed.
60 base::WeakPtrFactory<ArcProcessTask> weak_ptr_factory_; 60 base::WeakPtrFactory<ArcProcessTask> weak_ptr_factory_;
61 61
62 DISALLOW_COPY_AND_ASSIGN(ArcProcessTask); 62 DISALLOW_COPY_AND_ASSIGN(ArcProcessTask);
63 }; 63 };
64 64
65 } // namespace task_manager 65 } // namespace task_manager
66 66
67 #endif // CHROME_BROWSER_TASK_MANAGER_PROVIDERS_ARC_ARC_PROCESS_TASK_H_ 67 #endif // CHROME_BROWSER_TASK_MANAGER_PROVIDERS_ARC_ARC_PROCESS_TASK_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/file_manager/arc_file_tasks.cc ('k') | chrome/browser/task_manager/providers/arc/arc_process_task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698