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

Unified Diff: chrome/renderer/extensions/experimental.usb_custom_bindings.cc

Issue 10224009: Experimental USB API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review changes. Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/extensions/experimental.usb_custom_bindings.cc
diff --git a/chrome/renderer/extensions/experimental.usb_custom_bindings.cc b/chrome/renderer/extensions/experimental.usb_custom_bindings.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a188f0606fdcb9ce1dd2814c4d3b57c59f5fa7bf
--- /dev/null
+++ b/chrome/renderer/extensions/experimental.usb_custom_bindings.cc
@@ -0,0 +1,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++);
asargent_no_longer_on_chrome 2012/04/26 21:21:45 I notice this is essentially the same as the socke
+}
+
+} // namespace
+
+namespace extensions {
+
+ExperimentalUsbCustomBindings::ExperimentalUsbCustomBindings()
+ : ChromeV8Extension(NULL) {
+ RouteStaticFunction("GetNextUsbEventId", &GetNextUsbEventId);
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698