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

Side by Side Diff: Source/bindings/v8/CustomElementHelpers.h

Issue 14688008: Revert 149589 "Set a bit on Custom Elements on creation to simplify wrapping" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/bindings/v8/CustomElementHelpers.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 CreateSVGWrapperFunction m_svg; 81 CreateSVGWrapperFunction m_svg;
82 CreateHTMLWrapperFunction m_html; 82 CreateHTMLWrapperFunction m_html;
83 }; 83 };
84 84
85 // You can just use toV8(Node*) to get correct wrapper objects, 85 // You can just use toV8(Node*) to get correct wrapper objects,
86 // even for custom elements. Then generated 86 // even for custom elements. Then generated
87 // ElementWrapperFactories call V8CustomElement::wrap() with 87 // ElementWrapperFactories call V8CustomElement::wrap() with
88 // proper prototype instances accordingly. 88 // proper prototype instances accordingly.
89 static v8::Handle<v8::Object> wrap(Element*, v8::Handle<v8::Object> creation Context, v8::Isolate*, const CreateWrapperFunction& createTypeExtensionUpgradeCa ndidateWrapper); 89 static v8::Handle<v8::Object> wrap(Element*, v8::Handle<v8::Object> creation Context, v8::Isolate*, const CreateWrapperFunction& createTypeExtensionUpgradeCa ndidateWrapper);
90 90
91 static bool isCustomElement(Element*);
92
91 private: 93 private:
92 static void invokeReadyCallbackIfNeeded(Element*, v8::Handle<v8::Context>); 94 static void invokeReadyCallbackIfNeeded(Element*, v8::Handle<v8::Context>);
93 static v8::Handle<v8::Object> createWrapper(PassRefPtr<Element>, v8::Handle< v8::Object>, v8::Isolate*, const CreateWrapperFunction& createTypeExtensionUpgra deCandidateWrapper); 95 static v8::Handle<v8::Object> createWrapper(PassRefPtr<Element>, v8::Handle< v8::Object>, v8::Isolate*, const CreateWrapperFunction& createTypeExtensionUpgra deCandidateWrapper);
94 static v8::Handle<v8::Object> createUpgradeCandidateWrapper(PassRefPtr<Eleme nt>, v8::Handle<v8::Object> creationContext, v8::Isolate*, const CreateWrapperFu nction& createTypeExtensionUpgradeCandidateWrapper); 96 static v8::Handle<v8::Object> createUpgradeCandidateWrapper(PassRefPtr<Eleme nt>, v8::Handle<v8::Object> creationContext, v8::Isolate*, const CreateWrapperFu nction& createTypeExtensionUpgradeCandidateWrapper);
95 }; 97 };
96 98
97 inline v8::Handle<v8::Object> CustomElementHelpers::wrap(Element* impl, v8::Hand le<v8::Object> creationContext, v8::Isolate* isolate, const CreateWrapperFunctio n& createWrapper) 99 inline v8::Handle<v8::Object> CustomElementHelpers::wrap(Element* impl, v8::Hand le<v8::Object> creationContext, v8::Isolate* isolate, const CreateWrapperFunctio n& createWrapper)
98 { 100 {
99 ASSERT(impl); 101 ASSERT(impl);
100 ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty()); 102 ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty());
101 return CustomElementHelpers::createWrapper(impl, creationContext, isolate, c reateWrapper); 103 return CustomElementHelpers::createWrapper(impl, creationContext, isolate, c reateWrapper);
102 } 104 }
103 105
104 inline bool CustomElementHelpers::isValidPrototypeParameter(const ScriptValue& v alue, ScriptState* state) 106 inline bool CustomElementHelpers::isValidPrototypeParameter(const ScriptValue& v alue, ScriptState* state)
105 { 107 {
106 AtomicString namespaceURI; 108 AtomicString namespaceURI;
107 return isValidPrototypeParameter(value, state, namespaceURI); 109 return isValidPrototypeParameter(value, state, namespaceURI);
108 } 110 }
109 111
110 } // namespace WebCore 112 } // namespace WebCore
111 113
112 #endif // CustomElementHelpers_h 114 #endif // CustomElementHelpers_h
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/v8/CustomElementHelpers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698