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

Side by Side Diff: Source/bindings/tests/results/V8TestInterface.cpp

Issue 210663003: Use |isolate| local variable in bindings, clean up comments (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update extension Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 /* 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be
3 * 3 // found in the LICENSE file.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 *
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
13 * distribution.
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30 4
31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
32 6
33 #include "config.h" 7 #include "config.h"
34 #if ENABLE(Condition1) || ENABLE(Condition2) 8 #if ENABLE(Condition1) || ENABLE(Condition2)
35 #include "V8TestInterface.h" 9 #include "V8TestInterface.h"
36 10
37 #include "RuntimeEnabledFeatures.h" 11 #include "RuntimeEnabledFeatures.h"
38 #include "V8Node.h" 12 #include "V8Node.h"
39 #include "V8NodeList.h" 13 #include "V8NodeList.h"
40 #include "V8TestInterfaceEmpty.h" 14 #include "V8TestInterfaceEmpty.h"
41 #include "V8TestObject.h" 15 #include "V8TestObject.h"
(...skipping 17 matching lines...) Expand all
59 static void initializeScriptWrappableForInterface(TestInterface* object) 33 static void initializeScriptWrappableForInterface(TestInterface* object)
60 { 34 {
61 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) 35 if (ScriptWrappable::wrapperCanBeStoredInObject(object))
62 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterface::wrapperTy peInfo); 36 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterface::wrapperTy peInfo);
63 else 37 else
64 ASSERT_NOT_REACHED(); 38 ASSERT_NOT_REACHED();
65 } 39 }
66 40
67 } // namespace WebCore 41 } // namespace WebCore
68 42
69 // In ScriptWrappable::init, the use of a local function declaration has an issu e on Windows:
70 // the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
71 // in the global namespace.
72 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe edback/details/664619/the-namespace-of-local-function-declarations-in-c)
73 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterface* object ) 43 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterface* object )
74 { 44 {
75 WebCore::initializeScriptWrappableForInterface(object); 45 WebCore::initializeScriptWrappableForInterface(object);
76 } 46 }
77 47
78 namespace WebCore { 48 namespace WebCore {
79 const WrapperTypeInfo V8TestInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterface::domTemplate, V8TestInterface::derefObject, V8TestInterface::toA ctiveDOMObject, 0, V8TestInterface::visitDOMWrapper, V8TestInterface::installPer ContextEnabledMethods, 0, WrapperTypeObjectPrototype, false }; 49 const WrapperTypeInfo V8TestInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterface::domTemplate, V8TestInterface::derefObject, V8TestInterface::toA ctiveDOMObject, 0, V8TestInterface::visitDOMWrapper, V8TestInterface::installPer ContextEnabledMethods, 0, WrapperTypeObjectPrototype, false };
80 50
81 namespace TestInterfaceV8Internal { 51 namespace TestInterfaceV8Internal {
82 52
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 static void supplementalMethod4MethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info) 585 static void supplementalMethod4MethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info)
616 { 586 {
617 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 587 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
618 TestInterfaceV8Internal::supplementalMethod4Method(info); 588 TestInterfaceV8Internal::supplementalMethod4Method(info);
619 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 589 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
620 } 590 }
621 #endif // ENABLE(CONDITION_PARTIAL) 591 #endif // ENABLE(CONDITION_PARTIAL)
622 592
623 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 593 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
624 { 594 {
625 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rface", info.Holder(), info.GetIsolate()); 595 v8::Isolate* isolate = info.GetIsolate();
596 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rface", info.Holder(), isolate);
626 if (UNLIKELY(info.Length() < 1)) { 597 if (UNLIKELY(info.Length() < 1)) {
627 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length())); 598 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
628 exceptionState.throwIfNeeded(); 599 exceptionState.throwIfNeeded();
629 return; 600 return;
630 } 601 }
631 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str1, info[0]); 602 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str1, info[0]);
632 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str2, info[1]); 603 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str2, info[1]);
633 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); 604 ExecutionContext* context = currentExecutionContext(isolate);
634 RefPtr<TestInterface> impl = TestInterface::create(context, str1, str2, exce ptionState); 605 RefPtr<TestInterface> impl = TestInterface::create(context, str1, str2, exce ptionState);
635 if (exceptionState.throwIfNeeded()) 606 if (exceptionState.throwIfNeeded())
636 return; 607 return;
637 608
638 v8::Handle<v8::Object> wrapper = info.Holder(); 609 v8::Handle<v8::Object> wrapper = info.Holder();
639 V8DOMWrapper::associateObjectWithWrapper<V8TestInterface>(impl.release(), &V 8TestInterface::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguratio n::Dependent); 610 V8DOMWrapper::associateObjectWithWrapper<V8TestInterface>(impl.release(), &V 8TestInterface::wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Depende nt);
640 v8SetReturnValue(info, wrapper); 611 v8SetReturnValue(info, wrapper);
641 } 612 }
642 613
643 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa llbackInfo<v8::Value>& info) 614 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa llbackInfo<v8::Value>& info)
644 { 615 {
645 if (info.Holder()->HasRealNamedProperty(name)) 616 if (info.Holder()->HasRealNamedProperty(name))
646 return; 617 return;
647 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) 618 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
648 return; 619 return;
649 620
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro pertyCallbackInfo<v8::Integer>& info) 669 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro pertyCallbackInfo<v8::Integer>& info)
699 { 670 {
700 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); 671 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
701 TestInterfaceV8Internal::namedPropertyQuery(name, info); 672 TestInterfaceV8Internal::namedPropertyQuery(name, info);
702 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 673 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
703 } 674 }
704 675
705 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo) 676 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo)
706 { 677 {
707 TestInterface* impl = V8TestInterface::toNative(info.Holder()); 678 TestInterface* impl = V8TestInterface::toNative(info.Holder());
679 v8::Isolate* isolate = info.GetIsolate();
708 Vector<String> names; 680 Vector<String> names;
709 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInter face", info.Holder(), info.GetIsolate()); 681 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInter face", info.Holder(), isolate);
710 impl->namedPropertyEnumerator(names, exceptionState); 682 impl->namedPropertyEnumerator(names, exceptionState);
711 if (exceptionState.throwIfNeeded()) 683 if (exceptionState.throwIfNeeded())
712 return; 684 return;
713 v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size ()); 685 v8::Handle<v8::Array> v8names = v8::Array::New(isolate, names.size());
714 for (size_t i = 0; i < names.size(); ++i) 686 for (size_t i = 0; i < names.size(); ++i)
715 v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIs olate(), names[i])); 687 v8names->Set(v8::Integer::New(isolate, i), v8String(isolate, names[i]));
716 v8SetReturnValue(info, v8names); 688 v8SetReturnValue(info, v8names);
717 } 689 }
718 690
719 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info) 691 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info)
720 { 692 {
721 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); 693 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
722 TestInterfaceV8Internal::namedPropertyEnumerator(info); 694 TestInterfaceV8Internal::namedPropertyEnumerator(info);
723 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 695 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
724 } 696 }
725 697
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 } 884 }
913 885
914 template<> 886 template<>
915 v8::Handle<v8::Value> toV8NoInline(TestInterface* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 887 v8::Handle<v8::Value> toV8NoInline(TestInterface* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate)
916 { 888 {
917 return toV8(impl, creationContext, isolate); 889 return toV8(impl, creationContext, isolate);
918 } 890 }
919 891
920 } // namespace WebCore 892 } // namespace WebCore
921 #endif // ENABLE(Condition1) || ENABLE(Condition2) 893 #endif // ENABLE(Condition1) || ENABLE(Condition2)
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterface.h ('k') | Source/bindings/tests/results/V8TestInterfaceCheckSecurity.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698