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

Side by Side Diff: components/arc/crash_collector/arc_crash_collector_bridge.cc

Issue 2357053002: Always use arc::InstanceHolder<T>::GetInstanceForMethod (Closed)
Patch Set: rebased to catch up tot Created 4 years, 3 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 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 #include "components/arc/crash_collector/arc_crash_collector_bridge.h" 5 #include "components/arc/crash_collector/arc_crash_collector_bridge.h"
6 6
7 #include <sysexits.h> 7 #include <sysexits.h>
8 #include <unistd.h> 8 #include <unistd.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 13 matching lines...) Expand all
24 arc_bridge_service()->crash_collector()->AddObserver(this); 24 arc_bridge_service()->crash_collector()->AddObserver(this);
25 } 25 }
26 26
27 ArcCrashCollectorBridge::~ArcCrashCollectorBridge() { 27 ArcCrashCollectorBridge::~ArcCrashCollectorBridge() {
28 arc_bridge_service()->crash_collector()->RemoveObserver(this); 28 arc_bridge_service()->crash_collector()->RemoveObserver(this);
29 } 29 }
30 30
31 void ArcCrashCollectorBridge::OnInstanceReady() { 31 void ArcCrashCollectorBridge::OnInstanceReady() {
32 mojom::CrashCollectorHostPtr host_ptr; 32 mojom::CrashCollectorHostPtr host_ptr;
33 binding_.Bind(mojo::GetProxy(&host_ptr)); 33 binding_.Bind(mojo::GetProxy(&host_ptr));
34 arc_bridge_service()->crash_collector()->instance()->Init( 34 auto* instance =
35 std::move(host_ptr)); 35 arc_bridge_service()->crash_collector()->GetInstanceForMethod("Init");
36 CHECK(instance);
37 instance->Init(std::move(host_ptr));
36 } 38 }
37 39
38 void ArcCrashCollectorBridge::DumpCrash(const mojo::String& type, 40 void ArcCrashCollectorBridge::DumpCrash(const mojo::String& type,
39 mojo::ScopedHandle pipe) { 41 mojo::ScopedHandle pipe) {
40 mojo::edk::ScopedPlatformHandle handle; 42 mojo::edk::ScopedPlatformHandle handle;
41 mojo::edk::PassWrappedPlatformHandle(pipe.get().value(), &handle); 43 mojo::edk::PassWrappedPlatformHandle(pipe.get().value(), &handle);
42 44
43 base::FileHandleMappingVector fd_map = { 45 base::FileHandleMappingVector fd_map = {
44 std::make_pair(handle.get().handle, STDIN_FILENO)}; 46 std::make_pair(handle.get().handle, STDIN_FILENO)};
45 47
(...skipping 16 matching lines...) Expand all
62 64
63 void ArcCrashCollectorBridge::SetBuildProperties(const mojo::String& device, 65 void ArcCrashCollectorBridge::SetBuildProperties(const mojo::String& device,
64 const mojo::String& board, 66 const mojo::String& board,
65 const mojo::String& cpu_abi) { 67 const mojo::String& cpu_abi) {
66 device_ = device.get(); 68 device_ = device.get();
67 board_ = board.get(); 69 board_ = board.get();
68 cpu_abi_ = cpu_abi.get(); 70 cpu_abi_ = cpu_abi.get();
69 } 71 }
70 72
71 } // namespace arc 73 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698