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

Side by Side Diff: content/renderer/usb/web_usb_client_impl.cc

Issue 1900953002: Mojo C++ bindings: make SyncHandleRegistry a ref-counted object. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | mojo/public/cpp/bindings/lib/connector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/renderer/usb/web_usb_client_impl.h" 5 #include "content/renderer/usb/web_usb_client_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
11 11
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/memory/ptr_util.h" 14 #include "base/memory/ptr_util.h"
15 #include "base/move.h" 15 #include "base/move.h"
16 #include "base/stl_util.h"
16 #include "base/strings/utf_string_conversions.h" 17 #include "base/strings/utf_string_conversions.h"
17 #include "content/child/mojo/type_converters.h" 18 #include "content/child/mojo/type_converters.h"
18 #include "content/child/scoped_web_callbacks.h" 19 #include "content/child/scoped_web_callbacks.h"
19 #include "content/public/common/service_registry.h" 20 #include "content/public/common/service_registry.h"
20 #include "content/renderer/usb/type_converters.h" 21 #include "content/renderer/usb/type_converters.h"
21 #include "content/renderer/usb/web_usb_device_impl.h" 22 #include "content/renderer/usb/web_usb_device_impl.h"
22 #include "mojo/public/cpp/bindings/array.h" 23 #include "mojo/public/cpp/bindings/array.h"
23 #include "mojo/public/cpp/bindings/interface_request.h" 24 #include "mojo/public/cpp/bindings/interface_request.h"
24 #include "third_party/WebKit/public/platform/WebCallbacks.h" 25 #include "third_party/WebKit/public/platform/WebCallbacks.h"
25 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBDeviceFilter.h " 26 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBDeviceFilter.h "
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 for (size_t i = 0; i < notification->devices_removed.size(); ++i) { 171 for (size_t i = 0; i < notification->devices_removed.size(); ++i) {
171 const device::usb::DeviceInfoPtr& device_info = 172 const device::usb::DeviceInfoPtr& device_info =
172 notification->devices_removed[i]; 173 notification->devices_removed[i];
173 for (auto observer : observers_) 174 for (auto observer : observers_)
174 observer->onDeviceDisconnected(base::WrapUnique(new WebUSBDeviceImpl( 175 observer->onDeviceDisconnected(base::WrapUnique(new WebUSBDeviceImpl(
175 nullptr, mojo::ConvertTo<blink::WebUSBDeviceInfo>(device_info)))); 176 nullptr, mojo::ConvertTo<blink::WebUSBDeviceInfo>(device_info))));
176 } 177 }
177 } 178 }
178 179
179 } // namespace content 180 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/lib/connector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698