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

Unified Diff: Source/core/html/InputType.cpp

Issue 19510005: [oilpan] Completely move HTMLFormControlElement's hierarchy to the managed heap Base URL: svn://svn.chromium.org/blink/branches/oilpan
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/InputType.h ('k') | Source/core/html/MonthInputType.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/InputType.cpp
diff --git a/Source/core/html/InputType.cpp b/Source/core/html/InputType.cpp
index 1cfcaebaf837b983fbba3ac07b92e307831d705c..07eb4db278f9a87f001e1427d41d8a2ffdbed6fa 100644
--- a/Source/core/html/InputType.cpp
+++ b/Source/core/html/InputType.cpp
@@ -86,7 +86,7 @@ namespace WebCore {
using namespace HTMLNames;
using namespace std;
-typedef PassOwnPtr<InputType> (*InputTypeFactoryFunction)(HTMLInputElement*);
+typedef PassOwnPtr<InputType> (*InputTypeFactoryFunction)(Handle<HTMLInputElement>);
typedef HashMap<AtomicString, InputTypeFactoryFunction, WTF::FastAllocator, CaseFoldingHash> InputTypeFactoryMap;
static PassOwnPtr<InputTypeFactoryMap> createInputTypeFactoryMap()
@@ -124,16 +124,16 @@ static PassOwnPtr<InputTypeFactoryMap> createInputTypeFactoryMap()
return map.release();
}
-PassOwnPtr<InputType> InputType::create(HTMLInputElement* element, const AtomicString& typeName)
+PassOwnPtr<InputType> InputType::create(Handle<HTMLInputElement> element, const AtomicString& typeName)
{
static const InputTypeFactoryMap* factoryMap = createInputTypeFactoryMap().leakPtr();
- PassOwnPtr<InputType> (*factory)(HTMLInputElement*) = typeName.isEmpty() ? 0 : factoryMap->get(typeName);
+ PassOwnPtr<InputType> (*factory)(Handle<HTMLInputElement>) = typeName.isEmpty() ? 0 : factoryMap->get(typeName);
if (!factory)
factory = TextInputType::create;
return factory(element);
}
-PassOwnPtr<InputType> InputType::createText(HTMLInputElement* element)
+PassOwnPtr<InputType> InputType::createText(Handle<HTMLInputElement> element)
{
return TextInputType::create(element);
}
@@ -447,7 +447,7 @@ PassRefPtr<HTMLFormElement> InputType::formForSubmission() const
RenderObject* InputType::createRenderer(RenderArena*, RenderStyle* style) const
{
- return RenderObject::createObject(element(), style);
+ return RenderObject::createObject(Handle<HTMLInputElement>(element()).raw(), style);
}
PassRefPtr<RenderStyle> InputType::customStyleForRenderer(PassRefPtr<RenderStyle> originalStyle)
@@ -990,7 +990,7 @@ void InputType::applyStep(int count, AnyStepHandling anyStepHandling, TextFieldE
setValueAsDecimal(newValue, eventBehavior, ec);
if (AXObjectCache* cache = element()->document()->existingAXObjectCache())
- cache->postNotification(element(), AXObjectCache::AXValueChanged, true);
+ cache->postNotification(Handle<HTMLInputElement>(element()).raw(), AXObjectCache::AXValueChanged, true);
}
bool InputType::getAllowedValueStep(Decimal* step) const
@@ -1116,6 +1116,16 @@ void InputType::stepUpFromRenderer(int n)
}
}
+InputType::InputType(const Handle<HTMLInputElement>& element)
+ : m_element(element.raw())
+{
+}
+
+Result<HTMLInputElement> InputType::element() const
+{
+ return Handle<HTMLInputElement>(m_element);
+}
+
void InputType::observeFeatureIfVisible(UseCounter::Feature feature) const
{
if (RenderStyle* style = element()->renderStyle()) {
« no previous file with comments | « Source/core/html/InputType.h ('k') | Source/core/html/MonthInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698