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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.h

Issue 2057273002: [OriginTrials] Support OriginTrialEnabled IDL attribute on constants (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move signature creation out of for loop Created 4 years, 6 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // installConstants and installConstant are used for simple constants. They 136 // installConstants and installConstant are used for simple constants. They
137 // install constants using v8::Template::Set(), which results in a property 137 // install constants using v8::Template::Set(), which results in a property
138 // that is much faster to access from scripts. 138 // that is much faster to access from scripts.
139 // installConstantWithGetter is used when some C++ code needs to be executed 139 // installConstantWithGetter is used when some C++ code needs to be executed
140 // when the constant is accessed, e.g. to handle deprecation or measuring 140 // when the constant is accessed, e.g. to handle deprecation or measuring
141 // usage. The property appears the same to scripts, but is slower to access. 141 // usage. The property appears the same to scripts, but is slower to access.
142 static void installConstants(v8::Isolate*, v8::Local<v8::FunctionTemplate> i nterfaceTemplate, v8::Local<v8::ObjectTemplate> prototypeTemplate, const Constan tConfiguration*, size_t constantCount); 142 static void installConstants(v8::Isolate*, v8::Local<v8::FunctionTemplate> i nterfaceTemplate, v8::Local<v8::ObjectTemplate> prototypeTemplate, const Constan tConfiguration*, size_t constantCount);
143 143
144 static void installConstant(v8::Isolate*, v8::Local<v8::FunctionTemplate> in terfaceTemplate, v8::Local<v8::ObjectTemplate> prototypeTemplate, const Constant Configuration&); 144 static void installConstant(v8::Isolate*, v8::Local<v8::FunctionTemplate> in terfaceTemplate, v8::Local<v8::ObjectTemplate> prototypeTemplate, const Constant Configuration&);
145 145
146 static void installConstant(v8::Isolate*, v8::Local<v8::Function> interface, v8::Local<v8::Object> prototype, const ConstantConfiguration&);
147
146 static void installConstantWithGetter(v8::Isolate*, v8::Local<v8::FunctionTe mplate> interfaceTemplate, v8::Local<v8::ObjectTemplate> prototypeTemplate, cons t char* name, v8::AccessorNameGetterCallback); 148 static void installConstantWithGetter(v8::Isolate*, v8::Local<v8::FunctionTe mplate> interfaceTemplate, v8::Local<v8::ObjectTemplate> prototypeTemplate, cons t char* name, v8::AccessorNameGetterCallback);
147 149
148 // MethodConfiguration translates into calls to Set() for setting up an 150 // MethodConfiguration translates into calls to Set() for setting up an
149 // object's callbacks. It sets the method on both the FunctionTemplate or 151 // object's callbacks. It sets the method on both the FunctionTemplate or
150 // the ObjectTemplate. 152 // the ObjectTemplate.
151 struct MethodConfiguration { 153 struct MethodConfiguration {
152 MethodConfiguration& operator=(const MethodConfiguration&) = delete; 154 MethodConfiguration& operator=(const MethodConfiguration&) = delete;
153 DISALLOW_NEW(); 155 DISALLOW_NEW();
154 v8::Local<v8::Name> methodName(v8::Isolate* isolate) const { return v8At omicString(isolate, name); } 156 v8::Local<v8::Name> methodName(v8::Isolate* isolate) const { return v8At omicString(isolate, name); }
155 v8::FunctionCallback callbackForWorld(const DOMWrapperWorld& world) cons t 157 v8::FunctionCallback callbackForWorld(const DOMWrapperWorld& world) cons t
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 static v8::Local<v8::FunctionTemplate> domClassTemplate(v8::Isolate*, const DOMWrapperWorld&, WrapperTypeInfo*, InstallTemplateFunction); 199 static v8::Local<v8::FunctionTemplate> domClassTemplate(v8::Isolate*, const DOMWrapperWorld&, WrapperTypeInfo*, InstallTemplateFunction);
198 200
199 // Sets the class string of platform objects, interface prototype objects, e tc. 201 // Sets the class string of platform objects, interface prototype objects, e tc.
200 // See also http://heycam.github.io/webidl/#dfn-class-string 202 // See also http://heycam.github.io/webidl/#dfn-class-string
201 static void setClassString(v8::Isolate*, v8::Local<v8::ObjectTemplate>, cons t char* classString); 203 static void setClassString(v8::Isolate*, v8::Local<v8::ObjectTemplate>, cons t char* classString);
202 }; 204 };
203 205
204 } // namespace blink 206 } // namespace blink
205 207
206 #endif // V8DOMConfiguration_h 208 #endif // V8DOMConfiguration_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698