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

Side by Side Diff: Source/WebKit/chromium/src/WebSelectElement.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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 16 matching lines...) Expand all
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 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. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 #include "WebSelectElement.h" 32 #include "WebSelectElement.h"
33 33
34 #include "HTMLNames.h" 34 #include "HTMLNames.h"
35 #include "core/html/HTMLOptionElement.h" 35 #include "core/html/HTMLOptionElement.h"
36 #include "core/html/HTMLSelectElement.h" 36 #include "core/html/HTMLSelectElement.h"
37 #include "heap/Handle.h"
37 #include <public/WebString.h> 38 #include <public/WebString.h>
38 #include <wtf/PassRefPtr.h> 39 #include <wtf/PassRefPtr.h>
39 40
40 using namespace WebCore; 41 using namespace WebCore;
41 42
42 namespace WebKit { 43 namespace WebKit {
43 44
44 void WebSelectElement::setValue(const WebString& value) 45 void WebSelectElement::setValue(const WebString& value)
45 { 46 {
46 unwrap<HTMLSelectElement>()->setValue(value); 47 unwrap<HTMLSelectElement>()->setValue(value);
47 } 48 }
48 49
49 WebString WebSelectElement::value() const 50 WebString WebSelectElement::value() const
50 { 51 {
51 return constUnwrap<HTMLSelectElement>()->value(); 52 return constUnwrap<HTMLSelectElement>()->value();
52 } 53 }
53 54
54 WebVector<WebElement> WebSelectElement::listItems() const 55 WebVector<WebElement> WebSelectElement::listItems() const
55 { 56 {
56 const Vector<HTMLElement*>& sourceItems = constUnwrap<HTMLSelectElement>()-> listItems(); 57 const Vector<HTMLElement*>& sourceItems = constUnwrap<HTMLSelectElement>()-> listItems();
57 WebVector<WebElement> items(sourceItems.size()); 58 WebVector<WebElement> items(sourceItems.size());
58 for (size_t i = 0; i < sourceItems.size(); ++i) 59 for (size_t i = 0; i < sourceItems.size(); ++i)
59 items[i] = WebElement(sourceItems[i]); 60 items[i] = WebElement(sourceItems[i]);
60 61
61 return items; 62 return items;
62 } 63 }
63 64
64 WebSelectElement::WebSelectElement(const PassRefPtr<HTMLSelectElement>& elem) 65 WebSelectElement::WebSelectElement(Handle<HTMLSelectElement> elem)
65 : WebFormControlElement(elem) 66 : WebFormControlElement(elem)
66 { 67 {
67 } 68 }
68 69
69 WebSelectElement& WebSelectElement::operator=(const PassRefPtr<HTMLSelectElement >& elem) 70 WebSelectElement& WebSelectElement::operator=(Handle<HTMLSelectElement> elem)
70 { 71 {
71 m_private = elem; 72 m_private = elem.passRefPtr();
72 return *this; 73 return *this;
73 } 74 }
74 75
75 WebSelectElement::operator PassRefPtr<HTMLSelectElement>() const 76 WebSelectElement::operator Handle<HTMLSelectElement>() const
76 { 77 {
77 return static_cast<HTMLSelectElement*>(m_private.get()); 78 return Handle<HTMLSelectElement>(static_cast<HTMLSelectElement*>(m_private.g et()));
78 } 79 }
79 80
80 } // namespace WebKit 81 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/WebKit/chromium/src/WebSearchableFormData.cpp ('k') | Source/WebKit/chromium/src/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698