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

Side by Side Diff: device/generic_sensor/sensor_provider_impl.cc

Issue 2396873002: [sensors] Fix crash after 85cc22d when using async creation of sensors. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "device/generic_sensor/sensor_provider_impl.h" 5 #include "device/generic_sensor/sensor_provider_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "device/generic_sensor/platform_sensor_provider.h" 9 #include "device/generic_sensor/platform_sensor_provider.h"
10 #include "device/generic_sensor/sensor_impl.h" 10 #include "device/generic_sensor/sensor_impl.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 } 89 }
90 90
91 auto sensor_impl = base::MakeUnique<SensorImpl>(sensor); 91 auto sensor_impl = base::MakeUnique<SensorImpl>(sensor);
92 92
93 auto init_params = mojom::SensorInitParams::New(); 93 auto init_params = mojom::SensorInitParams::New();
94 init_params->memory = std::move(cloned_handle); 94 init_params->memory = std::move(cloned_handle);
95 init_params->buffer_offset = GetBufferOffset(type); 95 init_params->buffer_offset = GetBufferOffset(type);
96 init_params->mode = sensor->GetReportingMode(); 96 init_params->mode = sensor->GetReportingMode();
97 init_params->default_configuration = sensor->GetDefaultConfiguration(); 97 init_params->default_configuration = sensor->GetDefaultConfiguration();
98 98
99 NotifySensorCreated(std::move(init_params), sensor_impl.get(), callback);
timvolodine 2016/10/05 17:59:35 is the order of Notify and MakeStrongBinding impor
100
99 mojo::MakeStrongBinding(std::move(sensor_impl), std::move(sensor_request)); 101 mojo::MakeStrongBinding(std::move(sensor_impl), std::move(sensor_request));
100
101 NotifySensorCreated(nullptr, nullptr, callback);
102 } 102 }
103 103
104 } // namespace device 104 } // namespace device
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698