OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_CRASH_COLLECTOR_ARC_CRASH_COLLECTOR_BRIDGE_H_ | 5 #ifndef COMPONENTS_ARC_CRASH_COLLECTOR_ARC_CRASH_COLLECTOR_BRIDGE_H_ |
6 #define COMPONENTS_ARC_CRASH_COLLECTOR_ARC_CRASH_COLLECTOR_BRIDGE_H_ | 6 #define COMPONENTS_ARC_CRASH_COLLECTOR_ARC_CRASH_COLLECTOR_BRIDGE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" |
11 #include "components/arc/arc_bridge_service.h" | 12 #include "components/arc/arc_bridge_service.h" |
12 #include "components/arc/arc_service.h" | 13 #include "components/arc/arc_service.h" |
13 #include "components/arc/instance_holder.h" | 14 #include "components/arc/instance_holder.h" |
14 #include "mojo/public/cpp/bindings/binding.h" | 15 #include "mojo/public/cpp/bindings/binding.h" |
15 | 16 |
| 17 namespace base { |
| 18 class TaskRunner; |
| 19 } |
| 20 |
16 namespace arc { | 21 namespace arc { |
17 | 22 |
18 // Relays dumps for non-native ARC crashes to the crash reporter in Chrome OS. | 23 // Relays dumps for non-native ARC crashes to the crash reporter in Chrome OS. |
19 class ArcCrashCollectorBridge | 24 class ArcCrashCollectorBridge |
20 : public ArcService, | 25 : public ArcService, |
21 public InstanceHolder<mojom::CrashCollectorInstance>::Observer, | 26 public InstanceHolder<mojom::CrashCollectorInstance>::Observer, |
22 public mojom::CrashCollectorHost { | 27 public mojom::CrashCollectorHost { |
23 public: | 28 public: |
24 explicit ArcCrashCollectorBridge(ArcBridgeService* bridge); | 29 ArcCrashCollectorBridge(ArcBridgeService* bridge, |
| 30 scoped_refptr<base::TaskRunner> blocking_task_runner); |
25 ~ArcCrashCollectorBridge() override; | 31 ~ArcCrashCollectorBridge() override; |
26 | 32 |
27 // InstanceHolder<mojom::CrashCollectorInstance>::Observer overrides. | 33 // InstanceHolder<mojom::CrashCollectorInstance>::Observer overrides. |
28 void OnInstanceReady() override; | 34 void OnInstanceReady() override; |
29 | 35 |
30 // mojom::CrashCollectorHost overrides. | 36 // mojom::CrashCollectorHost overrides. |
31 void DumpCrash(const mojo::String& type, mojo::ScopedHandle pipe) override; | 37 void DumpCrash(const mojo::String& type, mojo::ScopedHandle pipe) override; |
32 | 38 |
33 void SetBuildProperties(const mojo::String& device, | 39 void SetBuildProperties(const mojo::String& device, |
34 const mojo::String& board, | 40 const mojo::String& board, |
35 const mojo::String& cpu_abi) override; | 41 const mojo::String& cpu_abi) override; |
36 | 42 |
37 private: | 43 private: |
| 44 scoped_refptr<base::TaskRunner> blocking_task_runner_; |
| 45 |
38 mojo::Binding<mojom::CrashCollectorHost> binding_; | 46 mojo::Binding<mojom::CrashCollectorHost> binding_; |
39 | 47 |
40 std::string device_; | 48 std::string device_; |
41 std::string board_; | 49 std::string board_; |
42 std::string cpu_abi_; | 50 std::string cpu_abi_; |
43 | 51 |
44 DISALLOW_COPY_AND_ASSIGN(ArcCrashCollectorBridge); | 52 DISALLOW_COPY_AND_ASSIGN(ArcCrashCollectorBridge); |
45 }; | 53 }; |
46 | 54 |
47 } // namespace arc | 55 } // namespace arc |
48 | 56 |
49 #endif // COMPONENTS_ARC_CRASH_COLLECTOR_ARC_CRASH_COLLECTOR_BRIDGE_H_ | 57 #endif // COMPONENTS_ARC_CRASH_COLLECTOR_ARC_CRASH_COLLECTOR_BRIDGE_H_ |
OLD | NEW |