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

Side by Side Diff: Source/bindings/tests/results/core/V8TestObject.cpp

Issue 1100223003: bindings: Add empty checks for toV8() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8TestObject.h" 8 #include "V8TestObject.h"
9 9
10 #include "bindings/core/v8/BindingSecurity.h" 10 #include "bindings/core/v8/BindingSecurity.h"
(...skipping 12827 matching lines...) Expand 10 before | Expand all | Expand 10 after
12838 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 12838 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
12839 if (contextInPrivateScript.IsEmpty()) 12839 if (contextInPrivateScript.IsEmpty())
12840 return false; 12840 return false;
12841 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 12841 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
12842 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 12842 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
12843 if (!scriptState->executionContext()) 12843 if (!scriptState->executionContext())
12844 return false; 12844 return false;
12845 12845
12846 ScriptState::Scope scope(scriptState); 12846 ScriptState::Scope scope(scriptState);
12847 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 12847 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
12848 if (holder.IsEmpty())
12849 return false;
12848 12850
12849 v8::Local<v8::Value> *argv = 0; 12851 v8::Local<v8::Value> *argv = 0;
12850 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodI mplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scri ptState->isolate()); 12852 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodI mplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scri ptState->isolate());
12851 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState , scriptStateInUserScript, "TestObject", "voidMethodImplementedInPrivateScript", holder, 0, argv); 12853 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState , scriptStateInUserScript, "TestObject", "voidMethodImplementedInPrivateScript", holder, 0, argv);
12852 if (v8Value.IsEmpty()) 12854 if (v8Value.IsEmpty())
12853 return false; 12855 return false;
12854 RELEASE_ASSERT(!exceptionState.hadException()); 12856 RELEASE_ASSERT(!exceptionState.hadException());
12855 return true; 12857 return true;
12856 } 12858 }
12857 12859
12858 bool V8TestObject::PrivateScript::shortMethodImplementedInPrivateScriptMethod(Lo calFrame* frame, TestObject* holderImpl, int* result) 12860 bool V8TestObject::PrivateScript::shortMethodImplementedInPrivateScriptMethod(Lo calFrame* frame, TestObject* holderImpl, int* result)
12859 { 12861 {
12860 if (!frame) 12862 if (!frame)
12861 return false; 12863 return false;
12862 v8::HandleScope handleScope(toIsolate(frame)); 12864 v8::HandleScope handleScope(toIsolate(frame));
12863 ScriptForbiddenScope::AllowUserAgentScript script; 12865 ScriptForbiddenScope::AllowUserAgentScript script;
12864 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 12866 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
12865 if (contextInPrivateScript.IsEmpty()) 12867 if (contextInPrivateScript.IsEmpty())
12866 return false; 12868 return false;
12867 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 12869 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
12868 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 12870 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
12869 if (!scriptState->executionContext()) 12871 if (!scriptState->executionContext())
12870 return false; 12872 return false;
12871 12873
12872 ScriptState::Scope scope(scriptState); 12874 ScriptState::Scope scope(scriptState);
12873 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 12875 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
12876 if (holder.IsEmpty())
12877 return false;
12874 12878
12875 v8::Local<v8::Value> *argv = 0; 12879 v8::Local<v8::Value> *argv = 0;
12876 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod ImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scr iptState->isolate()); 12880 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod ImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scr iptState->isolate());
12877 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState , scriptStateInUserScript, "TestObject", "shortMethodImplementedInPrivateScript" , holder, 0, argv); 12881 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState , scriptStateInUserScript, "TestObject", "shortMethodImplementedInPrivateScript" , holder, 0, argv);
12878 if (v8Value.IsEmpty()) 12882 if (v8Value.IsEmpty())
12879 return false; 12883 return false;
12880 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex ceptionState); 12884 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex ceptionState);
12881 if (exceptionState.throwIfNeeded()) 12885 if (exceptionState.throwIfNeeded())
12882 return false; 12886 return false;
12883 *result = cppValue; 12887 *result = cppValue;
(...skipping 10 matching lines...) Expand all
12894 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 12898 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
12895 if (contextInPrivateScript.IsEmpty()) 12899 if (contextInPrivateScript.IsEmpty())
12896 return false; 12900 return false;
12897 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 12901 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
12898 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 12902 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
12899 if (!scriptState->executionContext()) 12903 if (!scriptState->executionContext())
12900 return false; 12904 return false;
12901 12905
12902 ScriptState::Scope scope(scriptState); 12906 ScriptState::Scope scope(scriptState);
12903 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 12907 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
12908 if (holder.IsEmpty())
12909 return false;
12904 12910
12905 v8::Local<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(), value); 12911 v8::Local<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(), value);
12906 v8::Local<v8::Value> argv[] = { valueHandle }; 12912 v8::Local<v8::Value> argv[] = { valueHandle };
12907 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod WithShortArgumentImplementedInPrivateScript", "TestObject", scriptState->context ()->Global(), scriptState->isolate()); 12913 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod WithShortArgumentImplementedInPrivateScript", "TestObject", scriptState->context ()->Global(), scriptState->isolate());
12908 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState , scriptStateInUserScript, "TestObject", "shortMethodWithShortArgumentImplemente dInPrivateScript", holder, 1, argv); 12914 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState , scriptStateInUserScript, "TestObject", "shortMethodWithShortArgumentImplemente dInPrivateScript", holder, 1, argv);
12909 if (v8Value.IsEmpty()) 12915 if (v8Value.IsEmpty())
12910 return false; 12916 return false;
12911 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex ceptionState); 12917 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex ceptionState);
12912 if (exceptionState.throwIfNeeded()) 12918 if (exceptionState.throwIfNeeded())
12913 return false; 12919 return false;
(...skipping 11 matching lines...) Expand all
12925 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 12931 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
12926 if (contextInPrivateScript.IsEmpty()) 12932 if (contextInPrivateScript.IsEmpty())
12927 return false; 12933 return false;
12928 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 12934 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
12929 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 12935 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
12930 if (!scriptState->executionContext()) 12936 if (!scriptState->executionContext())
12931 return false; 12937 return false;
12932 12938
12933 ScriptState::Scope scope(scriptState); 12939 ScriptState::Scope scope(scriptState);
12934 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 12940 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
12941 if (holder.IsEmpty())
12942 return false;
12935 12943
12936 v8::Local<v8::Value> valueHandle = v8String(scriptState->isolate(), value); 12944 v8::Local<v8::Value> valueHandle = v8String(scriptState->isolate(), value);
12937 v8::Local<v8::Value> argv[] = { valueHandle }; 12945 v8::Local<v8::Value> argv[] = { valueHandle };
12938 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringMetho dWithStringArgumentImplementedInPrivateScript", "TestObject", scriptState->conte xt()->Global(), scriptState->isolate()); 12946 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringMetho dWithStringArgumentImplementedInPrivateScript", "TestObject", scriptState->conte xt()->Global(), scriptState->isolate());
12939 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState , scriptStateInUserScript, "TestObject", "stringMethodWithStringArgumentImplemen tedInPrivateScript", holder, 1, argv); 12947 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState , scriptStateInUserScript, "TestObject", "stringMethodWithStringArgumentImplemen tedInPrivateScript", holder, 1, argv);
12940 if (v8Value.IsEmpty()) 12948 if (v8Value.IsEmpty())
12941 return false; 12949 return false;
12942 V8StringResource<> cppValue = v8Value; 12950 V8StringResource<> cppValue = v8Value;
12943 if (!cppValue.prepare()) 12951 if (!cppValue.prepare())
12944 return false; 12952 return false;
(...skipping 11 matching lines...) Expand all
12956 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 12964 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
12957 if (contextInPrivateScript.IsEmpty()) 12965 if (contextInPrivateScript.IsEmpty())
12958 return false; 12966 return false;
12959 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 12967 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
12960 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 12968 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
12961 if (!scriptState->executionContext()) 12969 if (!scriptState->executionContext())
12962 return false; 12970 return false;
12963 12971
12964 ScriptState::Scope scope(scriptState); 12972 ScriptState::Scope scope(scriptState);
12965 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 12973 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
12974 if (holder.IsEmpty())
12975 return false;
12966 12976
12967 v8::Local<v8::Value> valueHandle = toV8(value, scriptState->context()->Globa l(), scriptState->isolate()); 12977 v8::Local<v8::Value> valueHandle = toV8(value, scriptState->context()->Globa l(), scriptState->isolate());
12968 v8::Local<v8::Value> argv[] = { valueHandle }; 12978 v8::Local<v8::Value> argv[] = { valueHandle };
12969 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW ithNodeArgumentImplementedInPrivateScript", "TestObject", scriptState->context() ->Global(), scriptState->isolate()); 12979 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW ithNodeArgumentImplementedInPrivateScript", "TestObject", scriptState->context() ->Global(), scriptState->isolate());
12970 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState , scriptStateInUserScript, "TestObject", "nodeMethodWithNodeArgumentImplementedI nPrivateScript", holder, 1, argv); 12980 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState , scriptStateInUserScript, "TestObject", "nodeMethodWithNodeArgumentImplementedI nPrivateScript", holder, 1, argv);
12971 if (v8Value.IsEmpty()) 12981 if (v8Value.IsEmpty())
12972 return false; 12982 return false;
12973 Node* cppValue = V8Node::toImplWithTypeCheck(scriptState->isolate(), v8Value ); 12983 Node* cppValue = V8Node::toImplWithTypeCheck(scriptState->isolate(), v8Value );
12974 *result = cppValue; 12984 *result = cppValue;
12975 RELEASE_ASSERT(!exceptionState.hadException()); 12985 RELEASE_ASSERT(!exceptionState.hadException());
12976 return true; 12986 return true;
12977 } 12987 }
12978 12988
12979 bool V8TestObject::PrivateScript::nodeMethodWithVariousArgumentsImplementedInPri vateScriptMethod(LocalFrame* frame, TestObject* holderImpl, PassRefPtrWillBeRawP tr<Document> document, PassRefPtrWillBeRawPtr<Node> node, int value1, double val ue2, String string, RefPtrWillBeRawPtr<Node>* result) 12989 bool V8TestObject::PrivateScript::nodeMethodWithVariousArgumentsImplementedInPri vateScriptMethod(LocalFrame* frame, TestObject* holderImpl, PassRefPtrWillBeRawP tr<Document> document, PassRefPtrWillBeRawPtr<Node> node, int value1, double val ue2, String string, RefPtrWillBeRawPtr<Node>* result)
12980 { 12990 {
12981 if (!frame) 12991 if (!frame)
12982 return false; 12992 return false;
12983 v8::HandleScope handleScope(toIsolate(frame)); 12993 v8::HandleScope handleScope(toIsolate(frame));
12984 ScriptForbiddenScope::AllowUserAgentScript script; 12994 ScriptForbiddenScope::AllowUserAgentScript script;
12985 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 12995 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
12986 if (contextInPrivateScript.IsEmpty()) 12996 if (contextInPrivateScript.IsEmpty())
12987 return false; 12997 return false;
12988 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 12998 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
12989 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 12999 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
12990 if (!scriptState->executionContext()) 13000 if (!scriptState->executionContext())
12991 return false; 13001 return false;
12992 13002
12993 ScriptState::Scope scope(scriptState); 13003 ScriptState::Scope scope(scriptState);
12994 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 13004 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
13005 if (holder.IsEmpty())
13006 return false;
12995 13007
12996 v8::Local<v8::Value> documentHandle = toV8(document, scriptState->context()- >Global(), scriptState->isolate()); 13008 v8::Local<v8::Value> documentHandle = toV8(document, scriptState->context()- >Global(), scriptState->isolate());
12997 v8::Local<v8::Value> nodeHandle = toV8(node, scriptState->context()->Global( ), scriptState->isolate()); 13009 v8::Local<v8::Value> nodeHandle = toV8(node, scriptState->context()->Global( ), scriptState->isolate());
12998 v8::Local<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate(), value1); 13010 v8::Local<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate(), value1);
12999 v8::Local<v8::Value> value2Handle = v8::Number::New(scriptState->isolate(), value2); 13011 v8::Local<v8::Value> value2Handle = v8::Number::New(scriptState->isolate(), value2);
13000 v8::Local<v8::Value> stringHandle = v8String(scriptState->isolate(), string) ; 13012 v8::Local<v8::Value> stringHandle = v8String(scriptState->isolate(), string) ;
13001 v8::Local<v8::Value> argv[] = { documentHandle, nodeHandle, value1Handle, va lue2Handle, stringHandle }; 13013 v8::Local<v8::Value> argv[] = { documentHandle, nodeHandle, value1Handle, va lue2Handle, stringHandle };
13002 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW ithVariousArgumentsImplementedInPrivateScript", "TestObject", scriptState->conte xt()->Global(), scriptState->isolate()); 13014 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW ithVariousArgumentsImplementedInPrivateScript", "TestObject", scriptState->conte xt()->Global(), scriptState->isolate());
13003 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState , scriptStateInUserScript, "TestObject", "nodeMethodWithVariousArgumentsImplemen tedInPrivateScript", holder, 5, argv); 13015 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState , scriptStateInUserScript, "TestObject", "nodeMethodWithVariousArgumentsImplemen tedInPrivateScript", holder, 5, argv);
13004 if (v8Value.IsEmpty()) 13016 if (v8Value.IsEmpty())
(...skipping 13 matching lines...) Expand all
13018 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 13030 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
13019 if (contextInPrivateScript.IsEmpty()) 13031 if (contextInPrivateScript.IsEmpty())
13020 return false; 13032 return false;
13021 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 13033 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
13022 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 13034 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
13023 if (!scriptState->executionContext()) 13035 if (!scriptState->executionContext())
13024 return false; 13036 return false;
13025 13037
13026 ScriptState::Scope scope(scriptState); 13038 ScriptState::Scope scope(scriptState);
13027 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 13039 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
13040 if (holder.IsEmpty())
13041 return false;
13028 13042
13029 v8::Local<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate(), value1); 13043 v8::Local<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate(), value1);
13030 v8::Local<v8::Value> value2Handle = v8::Integer::New(scriptState->isolate(), value2); 13044 v8::Local<v8::Value> value2Handle = v8::Integer::New(scriptState->isolate(), value2);
13031 v8::Local<v8::Value> argv[] = { value1Handle, value2Handle }; 13045 v8::Local<v8::Value> argv[] = { value1Handle, value2Handle };
13032 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodForPr ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i solate()); 13046 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodForPr ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i solate());
13033 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState , scriptStateInUserScript, "TestObject", "methodForPrivateScriptOnly", holder, 2 , argv); 13047 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState , scriptStateInUserScript, "TestObject", "methodForPrivateScriptOnly", holder, 2 , argv);
13034 if (v8Value.IsEmpty()) 13048 if (v8Value.IsEmpty())
13035 return false; 13049 return false;
13036 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex ceptionState); 13050 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex ceptionState);
13037 if (exceptionState.throwIfNeeded()) 13051 if (exceptionState.throwIfNeeded())
(...skipping 12 matching lines...) Expand all
13050 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 13064 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
13051 if (contextInPrivateScript.IsEmpty()) 13065 if (contextInPrivateScript.IsEmpty())
13052 return false; 13066 return false;
13053 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 13067 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
13054 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 13068 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
13055 if (!scriptState->executionContext()) 13069 if (!scriptState->executionContext())
13056 return false; 13070 return false;
13057 13071
13058 ScriptState::Scope scope(scriptState); 13072 ScriptState::Scope scope(scriptState);
13059 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 13073 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
13074 if (holder.IsEmpty())
13075 return false;
13060 13076
13061 ExceptionState exceptionState(ExceptionState::GetterContext, "readonlyShortA ttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate( )); 13077 ExceptionState exceptionState(ExceptionState::GetterContext, "readonlyShortA ttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate( ));
13062 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc riptState, scriptStateInUserScript, "TestObject", "readonlyShortAttribute", hold er); 13078 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc riptState, scriptStateInUserScript, "TestObject", "readonlyShortAttribute", hold er);
13063 if (v8Value.IsEmpty()) 13079 if (v8Value.IsEmpty())
13064 return false; 13080 return false;
13065 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex ceptionState); 13081 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex ceptionState);
13066 if (exceptionState.throwIfNeeded()) 13082 if (exceptionState.throwIfNeeded())
13067 return false; 13083 return false;
13068 RELEASE_ASSERT(!exceptionState.hadException()); 13084 RELEASE_ASSERT(!exceptionState.hadException());
13069 *result = cppValue; 13085 *result = cppValue;
13070 return true; 13086 return true;
13071 } 13087 }
13072 13088
13073 bool V8TestObject::PrivateScript::shortAttributeAttributeGetter(LocalFrame* fram e, TestObject* holderImpl, int* result) 13089 bool V8TestObject::PrivateScript::shortAttributeAttributeGetter(LocalFrame* fram e, TestObject* holderImpl, int* result)
13074 { 13090 {
13075 if (!frame) 13091 if (!frame)
13076 return false; 13092 return false;
13077 v8::HandleScope handleScope(toIsolate(frame)); 13093 v8::HandleScope handleScope(toIsolate(frame));
13078 ScriptForbiddenScope::AllowUserAgentScript script; 13094 ScriptForbiddenScope::AllowUserAgentScript script;
13079 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 13095 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
13080 if (contextInPrivateScript.IsEmpty()) 13096 if (contextInPrivateScript.IsEmpty())
13081 return false; 13097 return false;
13082 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 13098 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
13083 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 13099 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
13084 if (!scriptState->executionContext()) 13100 if (!scriptState->executionContext())
13085 return false; 13101 return false;
13086 13102
13087 ScriptState::Scope scope(scriptState); 13103 ScriptState::Scope scope(scriptState);
13088 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 13104 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
13105 if (holder.IsEmpty())
13106 return false;
13089 13107
13090 ExceptionState exceptionState(ExceptionState::GetterContext, "shortAttribute ", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 13108 ExceptionState exceptionState(ExceptionState::GetterContext, "shortAttribute ", "TestObject", scriptState->context()->Global(), scriptState->isolate());
13091 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc riptState, scriptStateInUserScript, "TestObject", "shortAttribute", holder); 13109 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc riptState, scriptStateInUserScript, "TestObject", "shortAttribute", holder);
13092 if (v8Value.IsEmpty()) 13110 if (v8Value.IsEmpty())
13093 return false; 13111 return false;
13094 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex ceptionState); 13112 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex ceptionState);
13095 if (exceptionState.throwIfNeeded()) 13113 if (exceptionState.throwIfNeeded())
13096 return false; 13114 return false;
13097 RELEASE_ASSERT(!exceptionState.hadException()); 13115 RELEASE_ASSERT(!exceptionState.hadException());
13098 *result = cppValue; 13116 *result = cppValue;
13099 return true; 13117 return true;
13100 } 13118 }
13101 13119
13102 bool V8TestObject::PrivateScript::shortAttributeAttributeSetter(LocalFrame* fram e, TestObject* holderImpl, int cppValue) 13120 bool V8TestObject::PrivateScript::shortAttributeAttributeSetter(LocalFrame* fram e, TestObject* holderImpl, int cppValue)
13103 { 13121 {
13104 if (!frame) 13122 if (!frame)
13105 return false; 13123 return false;
13106 v8::HandleScope handleScope(toIsolate(frame)); 13124 v8::HandleScope handleScope(toIsolate(frame));
13107 ScriptForbiddenScope::AllowUserAgentScript script; 13125 ScriptForbiddenScope::AllowUserAgentScript script;
13108 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 13126 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
13109 if (contextInPrivateScript.IsEmpty()) 13127 if (contextInPrivateScript.IsEmpty())
13110 return false; 13128 return false;
13111 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 13129 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
13112 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 13130 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
13113 if (!scriptState->executionContext()) 13131 if (!scriptState->executionContext())
13114 return false; 13132 return false;
13115 13133
13116 ScriptState::Scope scope(scriptState); 13134 ScriptState::Scope scope(scriptState);
13117 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 13135 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
13136 if (holder.IsEmpty())
13137 return false;
13118 13138
13119 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute ", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 13139 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute ", "TestObject", scriptState->context()->Global(), scriptState->isolate());
13120 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "shortAttribute", holder, v8::Integer::New(scriptState ->isolate(), cppValue)); 13140 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "shortAttribute", holder, v8::Integer::New(scriptState ->isolate(), cppValue));
13121 } 13141 }
13122 13142
13123 bool V8TestObject::PrivateScript::stringAttributeAttributeGetter(LocalFrame* fra me, TestObject* holderImpl, String* result) 13143 bool V8TestObject::PrivateScript::stringAttributeAttributeGetter(LocalFrame* fra me, TestObject* holderImpl, String* result)
13124 { 13144 {
13125 if (!frame) 13145 if (!frame)
13126 return false; 13146 return false;
13127 v8::HandleScope handleScope(toIsolate(frame)); 13147 v8::HandleScope handleScope(toIsolate(frame));
13128 ScriptForbiddenScope::AllowUserAgentScript script; 13148 ScriptForbiddenScope::AllowUserAgentScript script;
13129 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 13149 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
13130 if (contextInPrivateScript.IsEmpty()) 13150 if (contextInPrivateScript.IsEmpty())
13131 return false; 13151 return false;
13132 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 13152 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
13133 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 13153 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
13134 if (!scriptState->executionContext()) 13154 if (!scriptState->executionContext())
13135 return false; 13155 return false;
13136 13156
13137 ScriptState::Scope scope(scriptState); 13157 ScriptState::Scope scope(scriptState);
13138 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 13158 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
13159 if (holder.IsEmpty())
13160 return false;
13139 13161
13140 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttribut e", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 13162 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttribut e", "TestObject", scriptState->context()->Global(), scriptState->isolate());
13141 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc riptState, scriptStateInUserScript, "TestObject", "stringAttribute", holder); 13163 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc riptState, scriptStateInUserScript, "TestObject", "stringAttribute", holder);
13142 if (v8Value.IsEmpty()) 13164 if (v8Value.IsEmpty())
13143 return false; 13165 return false;
13144 V8StringResource<> cppValue = v8Value; 13166 V8StringResource<> cppValue = v8Value;
13145 if (!cppValue.prepare()) 13167 if (!cppValue.prepare())
13146 return false; 13168 return false;
13147 RELEASE_ASSERT(!exceptionState.hadException()); 13169 RELEASE_ASSERT(!exceptionState.hadException());
13148 *result = cppValue; 13170 *result = cppValue;
13149 return true; 13171 return true;
13150 } 13172 }
13151 13173
13152 bool V8TestObject::PrivateScript::stringAttributeAttributeSetter(LocalFrame* fra me, TestObject* holderImpl, String cppValue) 13174 bool V8TestObject::PrivateScript::stringAttributeAttributeSetter(LocalFrame* fra me, TestObject* holderImpl, String cppValue)
13153 { 13175 {
13154 if (!frame) 13176 if (!frame)
13155 return false; 13177 return false;
13156 v8::HandleScope handleScope(toIsolate(frame)); 13178 v8::HandleScope handleScope(toIsolate(frame));
13157 ScriptForbiddenScope::AllowUserAgentScript script; 13179 ScriptForbiddenScope::AllowUserAgentScript script;
13158 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 13180 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
13159 if (contextInPrivateScript.IsEmpty()) 13181 if (contextInPrivateScript.IsEmpty())
13160 return false; 13182 return false;
13161 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 13183 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
13162 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 13184 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
13163 if (!scriptState->executionContext()) 13185 if (!scriptState->executionContext())
13164 return false; 13186 return false;
13165 13187
13166 ScriptState::Scope scope(scriptState); 13188 ScriptState::Scope scope(scriptState);
13167 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 13189 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
13190 if (holder.IsEmpty())
13191 return false;
13168 13192
13169 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut e", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 13193 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut e", "TestObject", scriptState->context()->Global(), scriptState->isolate());
13170 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "stringAttribute", holder, v8String(scriptState->isola te(), cppValue)); 13194 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "stringAttribute", holder, v8String(scriptState->isola te(), cppValue));
13171 } 13195 }
13172 13196
13173 bool V8TestObject::PrivateScript::nodeAttributeAttributeGetter(LocalFrame* frame , TestObject* holderImpl, RefPtrWillBeRawPtr<Node>* result) 13197 bool V8TestObject::PrivateScript::nodeAttributeAttributeGetter(LocalFrame* frame , TestObject* holderImpl, RefPtrWillBeRawPtr<Node>* result)
13174 { 13198 {
13175 if (!frame) 13199 if (!frame)
13176 return false; 13200 return false;
13177 v8::HandleScope handleScope(toIsolate(frame)); 13201 v8::HandleScope handleScope(toIsolate(frame));
13178 ScriptForbiddenScope::AllowUserAgentScript script; 13202 ScriptForbiddenScope::AllowUserAgentScript script;
13179 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 13203 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
13180 if (contextInPrivateScript.IsEmpty()) 13204 if (contextInPrivateScript.IsEmpty())
13181 return false; 13205 return false;
13182 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 13206 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
13183 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 13207 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
13184 if (!scriptState->executionContext()) 13208 if (!scriptState->executionContext())
13185 return false; 13209 return false;
13186 13210
13187 ScriptState::Scope scope(scriptState); 13211 ScriptState::Scope scope(scriptState);
13188 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 13212 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
13213 if (holder.IsEmpty())
13214 return false;
13189 13215
13190 ExceptionState exceptionState(ExceptionState::GetterContext, "nodeAttribute" , "TestObject", scriptState->context()->Global(), scriptState->isolate()); 13216 ExceptionState exceptionState(ExceptionState::GetterContext, "nodeAttribute" , "TestObject", scriptState->context()->Global(), scriptState->isolate());
13191 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc riptState, scriptStateInUserScript, "TestObject", "nodeAttribute", holder); 13217 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc riptState, scriptStateInUserScript, "TestObject", "nodeAttribute", holder);
13192 if (v8Value.IsEmpty()) 13218 if (v8Value.IsEmpty())
13193 return false; 13219 return false;
13194 Node* cppValue = V8Node::toImplWithTypeCheck(scriptState->isolate(), v8Value ); 13220 Node* cppValue = V8Node::toImplWithTypeCheck(scriptState->isolate(), v8Value );
13195 RELEASE_ASSERT(!exceptionState.hadException()); 13221 RELEASE_ASSERT(!exceptionState.hadException());
13196 *result = cppValue; 13222 *result = cppValue;
13197 return true; 13223 return true;
13198 } 13224 }
13199 13225
13200 bool V8TestObject::PrivateScript::nodeAttributeAttributeSetter(LocalFrame* frame , TestObject* holderImpl, PassRefPtrWillBeRawPtr<Node> cppValue) 13226 bool V8TestObject::PrivateScript::nodeAttributeAttributeSetter(LocalFrame* frame , TestObject* holderImpl, PassRefPtrWillBeRawPtr<Node> cppValue)
13201 { 13227 {
13202 if (!frame) 13228 if (!frame)
13203 return false; 13229 return false;
13204 v8::HandleScope handleScope(toIsolate(frame)); 13230 v8::HandleScope handleScope(toIsolate(frame));
13205 ScriptForbiddenScope::AllowUserAgentScript script; 13231 ScriptForbiddenScope::AllowUserAgentScript script;
13206 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 13232 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
13207 if (contextInPrivateScript.IsEmpty()) 13233 if (contextInPrivateScript.IsEmpty())
13208 return false; 13234 return false;
13209 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 13235 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
13210 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 13236 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
13211 if (!scriptState->executionContext()) 13237 if (!scriptState->executionContext())
13212 return false; 13238 return false;
13213 13239
13214 ScriptState::Scope scope(scriptState); 13240 ScriptState::Scope scope(scriptState);
13215 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 13241 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
13242 if (holder.IsEmpty())
13243 return false;
13216 13244
13217 ExceptionState exceptionState(ExceptionState::SetterContext, "nodeAttribute" , "TestObject", scriptState->context()->Global(), scriptState->isolate()); 13245 ExceptionState exceptionState(ExceptionState::SetterContext, "nodeAttribute" , "TestObject", scriptState->context()->Global(), scriptState->isolate());
13218 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "nodeAttribute", holder, toV8(cppValue, scriptState->c ontext()->Global(), scriptState->isolate())); 13246 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "nodeAttribute", holder, toV8(cppValue, scriptState->c ontext()->Global(), scriptState->isolate()));
13219 } 13247 }
13220 13248
13221 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeGetter(L ocalFrame* frame, TestObject* holderImpl, String* result) 13249 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeGetter(L ocalFrame* frame, TestObject* holderImpl, String* result)
13222 { 13250 {
13223 if (!frame) 13251 if (!frame)
13224 return false; 13252 return false;
13225 v8::HandleScope handleScope(toIsolate(frame)); 13253 v8::HandleScope handleScope(toIsolate(frame));
13226 ScriptForbiddenScope::AllowUserAgentScript script; 13254 ScriptForbiddenScope::AllowUserAgentScript script;
13227 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 13255 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
13228 if (contextInPrivateScript.IsEmpty()) 13256 if (contextInPrivateScript.IsEmpty())
13229 return false; 13257 return false;
13230 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 13258 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
13231 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 13259 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
13232 if (!scriptState->executionContext()) 13260 if (!scriptState->executionContext())
13233 return false; 13261 return false;
13234 13262
13235 ScriptState::Scope scope(scriptState); 13263 ScriptState::Scope scope(scriptState);
13236 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 13264 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
13265 if (holder.IsEmpty())
13266 return false;
13237 13267
13238 ExceptionState exceptionState(ExceptionState::GetterContext, "attributeForPr ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i solate()); 13268 ExceptionState exceptionState(ExceptionState::GetterContext, "attributeForPr ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i solate());
13239 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc riptState, scriptStateInUserScript, "TestObject", "attributeForPrivateScriptOnly ", holder); 13269 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc riptState, scriptStateInUserScript, "TestObject", "attributeForPrivateScriptOnly ", holder);
13240 if (v8Value.IsEmpty()) 13270 if (v8Value.IsEmpty())
13241 return false; 13271 return false;
13242 V8StringResource<> cppValue = v8Value; 13272 V8StringResource<> cppValue = v8Value;
13243 if (!cppValue.prepare()) 13273 if (!cppValue.prepare())
13244 return false; 13274 return false;
13245 RELEASE_ASSERT(!exceptionState.hadException()); 13275 RELEASE_ASSERT(!exceptionState.hadException());
13246 *result = cppValue; 13276 *result = cppValue;
13247 return true; 13277 return true;
13248 } 13278 }
13249 13279
13250 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeSetter(L ocalFrame* frame, TestObject* holderImpl, String cppValue) 13280 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeSetter(L ocalFrame* frame, TestObject* holderImpl, String cppValue)
13251 { 13281 {
13252 if (!frame) 13282 if (!frame)
13253 return false; 13283 return false;
13254 v8::HandleScope handleScope(toIsolate(frame)); 13284 v8::HandleScope handleScope(toIsolate(frame));
13255 ScriptForbiddenScope::AllowUserAgentScript script; 13285 ScriptForbiddenScope::AllowUserAgentScript script;
13256 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 13286 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
13257 if (contextInPrivateScript.IsEmpty()) 13287 if (contextInPrivateScript.IsEmpty())
13258 return false; 13288 return false;
13259 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 13289 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
13260 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 13290 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
13261 if (!scriptState->executionContext()) 13291 if (!scriptState->executionContext())
13262 return false; 13292 return false;
13263 13293
13264 ScriptState::Scope scope(scriptState); 13294 ScriptState::Scope scope(scriptState);
13265 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 13295 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
13296 if (holder.IsEmpty())
13297 return false;
13266 13298
13267 ExceptionState exceptionState(ExceptionState::SetterContext, "attributeForPr ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i solate()); 13299 ExceptionState exceptionState(ExceptionState::SetterContext, "attributeForPr ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i solate());
13268 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "attributeForPrivateScriptOnly", holder, v8String(scri ptState->isolate(), cppValue)); 13300 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "attributeForPrivateScriptOnly", holder, v8String(scri ptState->isolate(), cppValue));
13269 } 13301 }
13270 13302
13271 bool V8TestObject::PrivateScript::enumForPrivateScriptAttributeGetter(LocalFrame * frame, TestObject* holderImpl, String* result) 13303 bool V8TestObject::PrivateScript::enumForPrivateScriptAttributeGetter(LocalFrame * frame, TestObject* holderImpl, String* result)
13272 { 13304 {
13273 if (!frame) 13305 if (!frame)
13274 return false; 13306 return false;
13275 v8::HandleScope handleScope(toIsolate(frame)); 13307 v8::HandleScope handleScope(toIsolate(frame));
13276 ScriptForbiddenScope::AllowUserAgentScript script; 13308 ScriptForbiddenScope::AllowUserAgentScript script;
13277 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 13309 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
13278 if (contextInPrivateScript.IsEmpty()) 13310 if (contextInPrivateScript.IsEmpty())
13279 return false; 13311 return false;
13280 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 13312 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
13281 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 13313 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
13282 if (!scriptState->executionContext()) 13314 if (!scriptState->executionContext())
13283 return false; 13315 return false;
13284 13316
13285 ScriptState::Scope scope(scriptState); 13317 ScriptState::Scope scope(scriptState);
13286 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 13318 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
13319 if (holder.IsEmpty())
13320 return false;
13287 13321
13288 ExceptionState exceptionState(ExceptionState::GetterContext, "enumForPrivate Script", "TestObject", scriptState->context()->Global(), scriptState->isolate()) ; 13322 ExceptionState exceptionState(ExceptionState::GetterContext, "enumForPrivate Script", "TestObject", scriptState->context()->Global(), scriptState->isolate()) ;
13289 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc riptState, scriptStateInUserScript, "TestObject", "enumForPrivateScript", holder ); 13323 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc riptState, scriptStateInUserScript, "TestObject", "enumForPrivateScript", holder );
13290 if (v8Value.IsEmpty()) 13324 if (v8Value.IsEmpty())
13291 return false; 13325 return false;
13292 V8StringResource<> cppValue = v8Value; 13326 V8StringResource<> cppValue = v8Value;
13293 if (!cppValue.prepare()) 13327 if (!cppValue.prepare())
13294 return false; 13328 return false;
13295 RELEASE_ASSERT(!exceptionState.hadException()); 13329 RELEASE_ASSERT(!exceptionState.hadException());
13296 *result = cppValue; 13330 *result = cppValue;
13297 return true; 13331 return true;
13298 } 13332 }
13299 13333
13300 bool V8TestObject::PrivateScript::enumForPrivateScriptAttributeSetter(LocalFrame * frame, TestObject* holderImpl, String cppValue) 13334 bool V8TestObject::PrivateScript::enumForPrivateScriptAttributeSetter(LocalFrame * frame, TestObject* holderImpl, String cppValue)
13301 { 13335 {
13302 if (!frame) 13336 if (!frame)
13303 return false; 13337 return false;
13304 v8::HandleScope handleScope(toIsolate(frame)); 13338 v8::HandleScope handleScope(toIsolate(frame));
13305 ScriptForbiddenScope::AllowUserAgentScript script; 13339 ScriptForbiddenScope::AllowUserAgentScript script;
13306 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 13340 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
13307 if (contextInPrivateScript.IsEmpty()) 13341 if (contextInPrivateScript.IsEmpty())
13308 return false; 13342 return false;
13309 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 13343 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
13310 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 13344 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
13311 if (!scriptState->executionContext()) 13345 if (!scriptState->executionContext())
13312 return false; 13346 return false;
13313 13347
13314 ScriptState::Scope scope(scriptState); 13348 ScriptState::Scope scope(scriptState);
13315 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 13349 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
13350 if (holder.IsEmpty())
13351 return false;
13316 13352
13317 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate Script", "TestObject", scriptState->context()->Global(), scriptState->isolate()) ; 13353 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate Script", "TestObject", scriptState->context()->Global(), scriptState->isolate()) ;
13318 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState-> isolate(), cppValue)); 13354 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState-> isolate(), cppValue));
13319 } 13355 }
13320 13356
13321 } // namespace blink 13357 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698