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

Side by Side Diff: extensions/renderer/api_binding.h

Issue 2610743002: [Extensions Bindings] Make function definitions optional for an API. (Closed)
Patch Set: api_binding_unittest Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef EXTENSIONS_RENDERER_API_BINDING_H_ 5 #ifndef EXTENSIONS_RENDERER_API_BINDING_H_
6 #define EXTENSIONS_RENDERER_API_BINDING_H_ 6 #define EXTENSIONS_RENDERER_API_BINDING_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 v8::Local<v8::Function>)>; 50 v8::Local<v8::Function>)>;
51 51
52 // The callback for determining if a given API method (specified by |name|) 52 // The callback for determining if a given API method (specified by |name|)
53 // is available. 53 // is available.
54 using AvailabilityCallback = base::Callback<bool(const std::string& name)>; 54 using AvailabilityCallback = base::Callback<bool(const std::string& name)>;
55 55
56 // The callback type for handling an API call. 56 // The callback type for handling an API call.
57 using HandlerCallback = base::Callback<void(gin::Arguments*)>; 57 using HandlerCallback = base::Callback<void(gin::Arguments*)>;
58 58
59 // The ArgumentSpec::RefMap is required to outlive this object. 59 // The ArgumentSpec::RefMap is required to outlive this object.
60 // |type_definitions| and |event_definitions| may be null if the API does not 60 // |function_definitions|, |type_definitions| and |event_definitions|
61 // specify any types or events. 61 // may be null if the API does not specify any types or events.
Devlin 2017/01/04 15:49:14 s/types or events/of the given category or somethi
jbroman 2017/01/04 19:55:43 Done.
62 APIBinding(const std::string& name, 62 APIBinding(const std::string& name,
63 const base::ListValue& function_definitions, 63 const base::ListValue* function_definitions,
64 const base::ListValue* type_definitions, 64 const base::ListValue* type_definitions,
65 const base::ListValue* event_definitions, 65 const base::ListValue* event_definitions,
66 const APIMethodCallback& callback, 66 const APIMethodCallback& callback,
67 std::unique_ptr<APIBindingHooks> binding_hooks, 67 std::unique_ptr<APIBindingHooks> binding_hooks,
68 ArgumentSpec::RefMap* type_refs); 68 ArgumentSpec::RefMap* type_refs);
69 ~APIBinding(); 69 ~APIBinding();
70 70
71 // Returns a new v8::Object for the API this APIBinding represents. 71 // Returns a new v8::Object for the API this APIBinding represents.
72 v8::Local<v8::Object> CreateInstance( 72 v8::Local<v8::Object> CreateInstance(
73 v8::Local<v8::Context> context, 73 v8::Local<v8::Context> context,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 const ArgumentSpec::RefMap* type_refs_; 105 const ArgumentSpec::RefMap* type_refs_;
106 106
107 base::WeakPtrFactory<APIBinding> weak_factory_; 107 base::WeakPtrFactory<APIBinding> weak_factory_;
108 108
109 DISALLOW_COPY_AND_ASSIGN(APIBinding); 109 DISALLOW_COPY_AND_ASSIGN(APIBinding);
110 }; 110 };
111 111
112 } // namespace extensions 112 } // namespace extensions
113 113
114 #endif // EXTENSIONS_RENDERER_API_BINDING_H_ 114 #endif // EXTENSIONS_RENDERER_API_BINDING_H_
OLDNEW
« no previous file with comments | « no previous file | extensions/renderer/api_binding.cc » ('j') | extensions/renderer/api_binding_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698