Chromium Code Reviews| Index: chrome/renderer/extensions/downloads_custom_bindings.cc |
| diff --git a/chrome/renderer/extensions/downloads_custom_bindings.cc b/chrome/renderer/extensions/downloads_custom_bindings.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a37c7de53f6bd1631738fb0755445cf09cb4d35d |
| --- /dev/null |
| +++ b/chrome/renderer/extensions/downloads_custom_bindings.cc |
| @@ -0,0 +1,30 @@ |
| +// 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/downloads_custom_bindings.h" |
| + |
| +#include <string> |
| + |
| +#include "base/string_number_conversions.h" |
| +#include "grit/renderer_resources.h" |
| +#include "v8/include/v8.h" |
| + |
| +namespace extensions { |
| + |
| +DownloadsCustomBindings::DownloadsCustomBindings() |
| + : ChromeV8Extension(NULL) { |
| + RouteStaticFunction("GetFilenameDeterminerId", &GetFilenameDeterminerId); |
| +} |
| + |
| +// Attach an event name to an object. |
| +// static |
| +v8::Handle<v8::Value> DownloadsCustomBindings::GetFilenameDeterminerId( |
| + const v8::Arguments& args) { |
| + static int next_event_id = 0; |
| + DCHECK(args.Length() == 0); |
|
vabr (Chromium)
2013/01/11 12:43:40
Lint says: "Consider using DCHECK_EQ instead of DC
benjhayden
2013/01/11 21:21:27
Done.
|
| + return v8::String::New(base::IntToString(++next_event_id).c_str()); |
| +} |
| + |
| +} // extensions |
| + |