OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 } | 811 } |
812 return v8::Local<v8::Context>(); | 812 return v8::Local<v8::Context>(); |
813 } | 813 } |
814 | 814 |
815 v8::Local<v8::Context> toV8ContextEvenIfDetached(Frame* frame, DOMWrapperWorld&
world) | 815 v8::Local<v8::Context> toV8ContextEvenIfDetached(Frame* frame, DOMWrapperWorld&
world) |
816 { | 816 { |
817 ASSERT(frame); | 817 ASSERT(frame); |
818 return frame->windowProxy(world)->contextIfInitialized(); | 818 return frame->windowProxy(world)->contextIfInitialized(); |
819 } | 819 } |
820 | 820 |
| 821 void installOriginTrialsCore(ScriptState* scriptState) |
| 822 { |
| 823 // TODO(iclelland): Generate all of this logic at compile-time, based on the |
| 824 // configuration of origin trial enabled attibutes and interfaces in IDL |
| 825 // files. (crbug.com/615060) |
| 826 |
| 827 // Initialization code for origin trials for core bindings, if necessary, |
| 828 // should go here. |
| 829 } |
| 830 |
| 831 namespace { |
| 832 InstallOriginTrialsFunction s_installOriginTrialsFunction = &installOriginTrials
Core; |
| 833 } |
| 834 |
| 835 void installOriginTrials(ScriptState* scriptState) |
| 836 { |
| 837 (*s_installOriginTrialsFunction)(scriptState); |
| 838 } |
| 839 |
| 840 InstallOriginTrialsFunction setInstallOriginTrialsFunction(InstallOriginTrialsFu
nction newInstallOriginTrialsFunction) |
| 841 { |
| 842 InstallOriginTrialsFunction originalFunction = s_installOriginTrialsFunction
; |
| 843 s_installOriginTrialsFunction = newInstallOriginTrialsFunction; |
| 844 return originalFunction; |
| 845 } |
| 846 |
821 void crashIfIsolateIsDead(v8::Isolate* isolate) | 847 void crashIfIsolateIsDead(v8::Isolate* isolate) |
822 { | 848 { |
823 if (isolate->IsDead()) { | 849 if (isolate->IsDead()) { |
824 // FIXME: We temporarily deal with V8 internal error situations | 850 // FIXME: We temporarily deal with V8 internal error situations |
825 // such as out-of-memory by crashing the renderer. | 851 // such as out-of-memory by crashing the renderer. |
826 CRASH(); | 852 CRASH(); |
827 } | 853 } |
828 } | 854 } |
829 | 855 |
830 bool isValidEnum(const String& value, const char** validValues, size_t length, c
onst String& enumName, ExceptionState& exceptionState) | 856 bool isValidEnum(const String& value, const char** validValues, size_t length, c
onst String& enumName, ExceptionState& exceptionState) |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u
nwrap(data))); | 946 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u
nwrap(data))); |
921 } | 947 } |
922 | 948 |
923 v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value> value, v8::Isolate* iso
late) | 949 v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value> value, v8::Isolate* iso
late) |
924 { | 950 { |
925 v8CallOrCrash(value.As<v8::Object>()->SetIntegrityLevel(isolate->GetCurrentC
ontext(), v8::IntegrityLevel::kFrozen)); | 951 v8CallOrCrash(value.As<v8::Object>()->SetIntegrityLevel(isolate->GetCurrentC
ontext(), v8::IntegrityLevel::kFrozen)); |
926 return value; | 952 return value; |
927 } | 953 } |
928 | 954 |
929 } // namespace blink | 955 } // namespace blink |
OLD | NEW |