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 "components/arc/arc_bridge_service.h" | 11 #include "components/arc/arc_bridge_service.h" |
12 #include "components/arc/arc_service.h" | 12 #include "components/arc/arc_service.h" |
13 #include "mojo/public/cpp/bindings/binding.h" | 13 #include "mojo/public/cpp/bindings/binding.h" |
14 | 14 |
15 namespace arc { | 15 namespace arc { |
16 | 16 |
17 // Relays dumps for non-native ARC crashes to the crash reporter in Chrome OS. | 17 // Relays dumps for non-native ARC crashes to the crash reporter in Chrome OS. |
18 class ArcCrashCollectorBridge : public ArcService, | 18 class ArcCrashCollectorBridge |
19 public ArcBridgeService::Observer, | 19 : public ArcService, |
20 public mojom::CrashCollectorHost { | 20 public ArcBridgeService::InstanceObserver<mojom::CrashCollectorInstance>, |
| 21 public mojom::CrashCollectorHost { |
21 public: | 22 public: |
22 explicit ArcCrashCollectorBridge(ArcBridgeService* bridge); | 23 explicit ArcCrashCollectorBridge(ArcBridgeService* bridge); |
23 ~ArcCrashCollectorBridge() override; | 24 ~ArcCrashCollectorBridge() override; |
24 | 25 |
25 // ArcBridgeService::Observer overrides. | 26 // ArcBridgeService::InstanceObserver<mojom::CrashCollectorInstance> |
26 void OnCrashCollectorInstanceReady() override; | 27 // overrides. |
| 28 void OnInstanceReady(mojom::CrashCollectorInstance* crash_collector_instance, |
| 29 uint32_t version) override; |
27 | 30 |
28 // mojom::CrashCollectorHost overrides. | 31 // mojom::CrashCollectorHost overrides. |
29 void DumpCrash(const mojo::String& type, mojo::ScopedHandle pipe) override; | 32 void DumpCrash(const mojo::String& type, mojo::ScopedHandle pipe) override; |
30 | 33 |
31 void SetBuildProperties(const mojo::String& device, | 34 void SetBuildProperties(const mojo::String& device, |
32 const mojo::String& board, | 35 const mojo::String& board, |
33 const mojo::String& cpu_abi) override; | 36 const mojo::String& cpu_abi) override; |
34 | 37 |
35 private: | 38 private: |
36 mojo::Binding<mojom::CrashCollectorHost> binding_; | 39 mojo::Binding<mojom::CrashCollectorHost> binding_; |
37 | 40 |
38 std::string device_; | 41 std::string device_; |
39 std::string board_; | 42 std::string board_; |
40 std::string cpu_abi_; | 43 std::string cpu_abi_; |
41 | 44 |
42 DISALLOW_COPY_AND_ASSIGN(ArcCrashCollectorBridge); | 45 DISALLOW_COPY_AND_ASSIGN(ArcCrashCollectorBridge); |
43 }; | 46 }; |
44 | 47 |
45 } // namespace arc | 48 } // namespace arc |
46 | 49 |
47 #endif // COMPONENTS_ARC_CRASH_COLLECTOR_ARC_CRASH_COLLECTOR_BRIDGE_H_ | 50 #endif // COMPONENTS_ARC_CRASH_COLLECTOR_ARC_CRASH_COLLECTOR_BRIDGE_H_ |
OLD | NEW |