OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 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 "chrome/renderer/extensions/downloads_custom_bindings.h" | |
6 | |
7 #include <string> | |
8 | |
9 #include "base/string_number_conversions.h" | |
10 #include "grit/renderer_resources.h" | |
11 #include "v8/include/v8.h" | |
12 | |
13 namespace extensions { | |
14 | |
15 DownloadsCustomBindings::DownloadsCustomBindings() | |
16 : ChromeV8Extension(NULL) { | |
17 RouteStaticFunction("GetFilenameDeterminerId", &GetFilenameDeterminerId); | |
18 } | |
19 | |
20 // Attach an event name to an object. | |
21 // static | |
22 v8::Handle<v8::Value> DownloadsCustomBindings::GetFilenameDeterminerId( | |
23 const v8::Arguments& args) { | |
24 static int next_event_id = 0; | |
25 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.
| |
26 return v8::String::New(base::IntToString(++next_event_id).c_str()); | |
27 } | |
28 | |
29 } // extensions | |
30 | |
OLD | NEW |