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

Side by Side Diff: Source/WebKit/chromium/src/WebInputElement.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 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 23 matching lines...) Expand all
34 #include "HTMLNames.h" 34 #include "HTMLNames.h"
35 #include "TextFieldDecoratorImpl.h" 35 #include "TextFieldDecoratorImpl.h"
36 #include "WebNodeCollection.h" 36 #include "WebNodeCollection.h"
37 #include "WebTextFieldDecoratorClient.h" 37 #include "WebTextFieldDecoratorClient.h"
38 #include "core/dom/ElementShadow.h" 38 #include "core/dom/ElementShadow.h"
39 #include "core/dom/ShadowRoot.h" 39 #include "core/dom/ShadowRoot.h"
40 #include "core/html/HTMLDataListElement.h" 40 #include "core/html/HTMLDataListElement.h"
41 #include "core/html/HTMLInputElement.h" 41 #include "core/html/HTMLInputElement.h"
42 #include "core/html/shadow/TextControlInnerElements.h" 42 #include "core/html/shadow/TextControlInnerElements.h"
43 #include "core/html/shadow/TextFieldDecorationElement.h" 43 #include "core/html/shadow/TextFieldDecorationElement.h"
44 #include "heap/Handle.h"
44 #include <public/WebString.h> 45 #include <public/WebString.h>
45 #include <wtf/PassRefPtr.h> 46 #include <wtf/PassRefPtr.h>
46 47
47 using namespace WebCore; 48 using namespace WebCore;
48 49
49 namespace WebKit { 50 namespace WebKit {
50 51
51 bool WebInputElement::isTextField() const 52 bool WebInputElement::isTextField() const
52 { 53 {
53 return constUnwrap<HTMLInputElement>()->isTextField(); 54 return constUnwrap<HTMLInputElement>()->isTextField();
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 ShadowRoot* shadowRoot = unwrap<HTMLInputElement>()->youngestShadowRoot(); 252 ShadowRoot* shadowRoot = unwrap<HTMLInputElement>()->youngestShadowRoot();
252 while (shadowRoot) { 253 while (shadowRoot) {
253 TextFieldDecorationElement* decoration = TextFieldDecorationElement::fro mShadowRoot(shadowRoot); 254 TextFieldDecorationElement* decoration = TextFieldDecorationElement::fro mShadowRoot(shadowRoot);
254 if (decoration && decoratorClient->isClientFor(decoration->textFieldDeco rator())) 255 if (decoration && decoratorClient->isClientFor(decoration->textFieldDeco rator()))
255 return WebElement(decoration); 256 return WebElement(decoration);
256 shadowRoot = shadowRoot->olderShadowRoot(); 257 shadowRoot = shadowRoot->olderShadowRoot();
257 } 258 }
258 return WebElement(); 259 return WebElement();
259 } 260 }
260 261
261 WebInputElement::WebInputElement(const PassRefPtr<HTMLInputElement>& elem) 262 WebInputElement::WebInputElement(Handle<HTMLInputElement> elem)
262 : WebFormControlElement(elem) 263 : WebFormControlElement(elem)
263 { 264 {
264 } 265 }
265 266
266 WebInputElement& WebInputElement::operator=(const PassRefPtr<HTMLInputElement>& elem) 267 WebInputElement& WebInputElement::operator=(Handle<HTMLInputElement> elem)
267 { 268 {
268 m_private = elem; 269 m_private = elem.passRefPtr();
269 return *this; 270 return *this;
270 } 271 }
271 272
272 WebInputElement::operator PassRefPtr<HTMLInputElement>() const 273 WebInputElement::operator Handle<HTMLInputElement>() const
273 { 274 {
274 return static_cast<HTMLInputElement*>(m_private.get()); 275 return Handle<HTMLInputElement>(static_cast<HTMLInputElement*>(m_private.get ()));
275 } 276 }
276 277
277 WebInputElement* toWebInputElement(WebElement* webElement) 278 WebInputElement* toWebInputElement(WebElement* webElement)
278 { 279 {
279 HTMLInputElement* inputElement = webElement->unwrap<Element>()->toInputEleme nt(); 280 Handle<HTMLInputElement> inputElement = webElement->unwrap<Element>()->toInp utElement();
280 if (!inputElement) 281 if (!inputElement)
281 return 0; 282 return 0;
282 283
283 return static_cast<WebInputElement*>(webElement); 284 return static_cast<WebInputElement*>(webElement);
284 } 285 }
285 } // namespace WebKit 286 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/WebKit/chromium/src/WebFormElement.cpp ('k') | Source/WebKit/chromium/src/WebPasswordFormData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698