OLD | NEW |
---|---|
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 #include "bindings/core/v8/ConditionalFeatures.h" | 5 #include "bindings/core/v8/ConditionalFeatures.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptState.h" | 7 #include "bindings/core/v8/ScriptState.h" |
8 #include "bindings/core/v8/V8HTMLLinkElement.h" | 8 #include "bindings/core/v8/V8HTMLLinkElement.h" |
9 #include "bindings/core/v8/V8Navigator.h" | 9 #include "bindings/core/v8/V8Navigator.h" |
10 #include "bindings/core/v8/V8Window.h" | 10 #include "bindings/core/v8/V8Window.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 InstallConditionalFeaturesFunction newInstallConditionalFeaturesFunction) { | 46 InstallConditionalFeaturesFunction newInstallConditionalFeaturesFunction) { |
47 InstallConditionalFeaturesFunction originalFunction = | 47 InstallConditionalFeaturesFunction originalFunction = |
48 s_installConditionalFeaturesFunction; | 48 s_installConditionalFeaturesFunction; |
49 s_installConditionalFeaturesFunction = newInstallConditionalFeaturesFunction; | 49 s_installConditionalFeaturesFunction = newInstallConditionalFeaturesFunction; |
50 return originalFunction; | 50 return originalFunction; |
51 } | 51 } |
52 | 52 |
53 void installConditionalFeatures(const WrapperTypeInfo* type, | 53 void installConditionalFeatures(const WrapperTypeInfo* type, |
54 const ScriptState* scriptState, | 54 const ScriptState* scriptState, |
55 v8::Local<v8::Object> prototypeObject, | 55 v8::Local<v8::Object> prototypeObject, |
56 v8::Local<v8::Function> interfaceObject) { | 56 v8::Local<v8::Function> interfaceObject) { |
haraken
2016/11/03 16:02:17
Add DCHECK(scriptState->world()->isMainWorld()).
iclelland
2016/11/03 16:43:04
I can't do that here -- that would require deeper
| |
57 (*s_installConditionalFeaturesFunction)(type, scriptState, prototypeObject, | 57 (*s_installConditionalFeaturesFunction)(type, scriptState, prototypeObject, |
58 interfaceObject); | 58 interfaceObject); |
59 } | 59 } |
60 | 60 |
61 void installPendingConditionalFeaturesOnWindow(const ScriptState* scriptState) { | |
62 DCHECK(scriptState); | |
63 DCHECK(scriptState->context() == scriptState->isolate()->GetCurrentContext()); | |
64 DCHECK(scriptState->perContextData()); | |
haraken
2016/11/03 16:02:17
Add DCHECK(scriptState->world()->isMainWorld()).
iclelland
2016/11/03 16:43:04
Done. This one is safe (and correct :) )
| |
65 (*s_installConditionalFeaturesFunction)(&V8Window::wrapperTypeInfo, | |
66 scriptState, v8::Local<v8::Object>(), | |
67 v8::Local<v8::Function>()); | |
68 } | |
69 | |
61 } // namespace blink | 70 } // namespace blink |
OLD | NEW |