summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/extensions/experimental.usb_custom_bindings.cc
blob: a188f0606fdcb9ce1dd2814c4d3b57c59f5fa7bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/renderer/extensions/experimental.usb_custom_bindings.h"

#include "base/logging.h"
#include "v8/include/v8.h"

namespace {

v8::Handle<v8::Value> GetNextUsbEventId(const v8::Arguments &arguments) {
  static int next_event_id = 1;
  return v8::Integer::New(next_event_id++);
}

}  // namespace

namespace extensions {

ExperimentalUsbCustomBindings::ExperimentalUsbCustomBindings()
    : ChromeV8Extension(NULL) {
  RouteStaticFunction("GetNextUsbEventId", &GetNextUsbEventId);
}

}  // namespace extensions