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

Side by Side Diff: third_party/WebKit/Source/modules/webusb/USBController.cpp

Issue 1850023002: Consume Mojo services directly in Blink's WebUSB implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't do assignments in if statements. 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "modules/webusb/USBController.h"
6
7 #include "platform/RuntimeEnabledFeatures.h"
8 #include "public/platform/modules/webusb/WebUSBClient.h"
9
10 namespace blink {
11
12 USBController::~USBController()
13 {
14 }
15
16 void USBController::provideTo(LocalFrame& frame, WebUSBClient* client)
17 {
18 USBController* controller = new USBController(frame, client);
19 Supplement<LocalFrame>::provideTo(frame, supplementName(), controller);
20 }
21
22 USBController& USBController::from(LocalFrame& frame)
23 {
24 USBController* controller = static_cast<USBController*>(Supplement<LocalFram e>::from(frame, supplementName()));
25 ASSERT(controller);
26 return *controller;
27 }
28
29 const char* USBController::supplementName()
30 {
31 return "USBController";
32 }
33
34 USBController::USBController(LocalFrame& frame, WebUSBClient* client)
35 : LocalFrameLifecycleObserver(&frame)
36 , m_client(client)
37 {
38 }
39
40 void USBController::willDetachFrameHost()
41 {
42 m_client = nullptr;
43 }
44
45 DEFINE_TRACE(USBController)
46 {
47 Supplement<LocalFrame>::trace(visitor);
48 LocalFrameLifecycleObserver::trace(visitor);
49 }
50
51 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webusb/USBController.h ('k') | third_party/WebKit/Source/modules/webusb/USBDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698