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