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

Side by Side Diff: device/udev_linux/udev_loader.cc

Issue 674703002: Linux: Dynamically load libudev. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scoped_udev
Patch Set: rebase to head, which includes third_party/libudev already Created 6 years, 1 month 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 | « device/udev_linux/udev_loader.h ('k') | device/usb/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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 "device/udev_linux/udev_loader.h"
6
7 #include "base/logging.h"
8 #include "device/udev_linux/udev0_loader.h"
9 #include "device/udev_linux/udev1_loader.h"
10
11 namespace device {
12
13 namespace {
14
15 UdevLoader* g_udev_loader = NULL;
16
17 } // namespace
18
19 // static
20 UdevLoader* UdevLoader::Get() {
21 if (g_udev_loader)
22 return g_udev_loader;
23
24 scoped_ptr<UdevLoader> udev_loader;
25 udev_loader.reset(new Udev1Loader);
26 if (udev_loader->Init()) {
27 g_udev_loader = udev_loader.release();
28 return g_udev_loader;
29 }
30
31 udev_loader.reset(new Udev0Loader);
32 if (udev_loader->Init()) {
33 g_udev_loader = udev_loader.release();
34 return g_udev_loader;
35 }
36 CHECK(false);
37 return NULL;
38 }
39
40 UdevLoader::~UdevLoader() {
41 }
42
43 } // namespace device
OLDNEW
« no previous file with comments | « device/udev_linux/udev_loader.h ('k') | device/usb/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698