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

Side by Side Diff: third_party/WebKit/Source/platform/bindings/ConditionalFeatures.h

Issue 2843603002: Move ScriptWrappable and dependencies to platform/bindings (Closed)
Patch Set: Rebase and try again Created 3 years, 7 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 ConditionalFeatures_h 5 #ifndef ConditionalFeatures_h
6 #define ConditionalFeatures_h 6 #define ConditionalFeatures_h
7 7
8 #include "core/CoreExport.h" 8 #include "platform/PlatformExport.h"
9 #include "platform/wtf/text/WTFString.h" 9 #include "platform/wtf/text/WTFString.h"
10 #include "v8/include/v8.h" 10 #include "v8/include/v8.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class ScriptState; 14 class ScriptState;
15 struct WrapperTypeInfo; 15 struct WrapperTypeInfo;
16 16
17 using InstallConditionalFeaturesFunction = void (*)(const WrapperTypeInfo*, 17 using InstallConditionalFeaturesFunction = void (*)(const WrapperTypeInfo*,
18 const ScriptState*, 18 const ScriptState*,
19 v8::Local<v8::Object>, 19 v8::Local<v8::Object>,
20 v8::Local<v8::Function>); 20 v8::Local<v8::Function>);
21 21
22 using InstallPendingConditionalFeatureFunction = void (*)(const String&, 22 using InstallPendingConditionalFeatureFunction = void (*)(const String&,
23 const ScriptState*); 23 const ScriptState*);
24 24
25 // Sets the function to be called by |installConditionalFeatures|. The function 25 // Sets the function to be called by |installConditionalFeatures|. The function
26 // is initially set to the private |installConditionalFeaturesDefault| function, 26 // is initially set to the private |installConditionalFeaturesDefault| function,
27 // but can be overridden by this function. A pointer to the previously set 27 // but can be overridden by this function. A pointer to the previously set
28 // function is returned, so that functions can be chained. 28 // function is returned, so that functions can be chained.
29 CORE_EXPORT InstallConditionalFeaturesFunction 29 PLATFORM_EXPORT InstallConditionalFeaturesFunction
30 SetInstallConditionalFeaturesFunction(InstallConditionalFeaturesFunction); 30 SetInstallConditionalFeaturesFunction(InstallConditionalFeaturesFunction);
31 31
32 // Sets the function to be called by |installPendingConditionalFeature|. This 32 // Sets the function to be called by |installPendingConditionalFeature|. This
33 // is initially set to the private |installPendingConditionalFeatureDefault| 33 // is initially set to the private |installPendingConditionalFeatureDefault|
34 // function, but can be overridden by this function. A pointer to the previously 34 // function, but can be overridden by this function. A pointer to the previously
35 // set function is returned, so that functions can be chained. 35 // set function is returned, so that functions can be chained.
36 CORE_EXPORT InstallPendingConditionalFeatureFunction 36 PLATFORM_EXPORT InstallPendingConditionalFeatureFunction
37 SetInstallPendingConditionalFeatureFunction( 37 SetInstallPendingConditionalFeatureFunction(
38 InstallPendingConditionalFeatureFunction); 38 InstallPendingConditionalFeatureFunction);
39 39
40 // Installs all of the conditionally enabled V8 bindings for the given type, in 40 // Installs all of the conditionally enabled V8 bindings for the given type, in
41 // a specific context. This is called in V8PerContextData, after the constructor 41 // a specific context. This is called in V8PerContextData, after the constructor
42 // and prototype for the type have been created. It indirectly calls the 42 // and prototype for the type have been created. It indirectly calls the
43 // function set by |setInstallConditionalFeaturesFunction|. 43 // function set by |setInstallConditionalFeaturesFunction|.
44 CORE_EXPORT void InstallConditionalFeatures(const WrapperTypeInfo*, 44 PLATFORM_EXPORT void InstallConditionalFeatures(const WrapperTypeInfo*,
45 const ScriptState*, 45 const ScriptState*,
46 v8::Local<v8::Object>, 46 v8::Local<v8::Object>,
47 v8::Local<v8::Function>); 47 v8::Local<v8::Function>);
48 48
49 // Installs all of the conditionally enabled V8 bindings for a feature, if 49 // Installs all of the conditionally enabled V8 bindings for a feature, if
50 // needed. This is called to install a newly-enabled feature on any existing 50 // needed. This is called to install a newly-enabled feature on any existing
51 // objects. If the target object hasn't been created, nothing is installed. The 51 // objects. If the target object hasn't been created, nothing is installed. The
52 // enabled feature will be instead be installed when the object is created 52 // enabled feature will be instead be installed when the object is created
53 // (avoids forcing the creation of objects prematurely). 53 // (avoids forcing the creation of objects prematurely).
54 CORE_EXPORT void InstallPendingConditionalFeature(const String&, 54 PLATFORM_EXPORT void InstallPendingConditionalFeature(const String&,
55 const ScriptState*); 55 const ScriptState*);
56 56
57 } // namespace blink 57 } // namespace blink
58 58
59 #endif // ConditionalFeatures_h 59 #endif // ConditionalFeatures_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698