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

Side by Side Diff: Source/web/WebNode.cpp

Issue 270573008: Oilpan: Prepare to support garbage-collected Node in WebNode hierarchy. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add FIXME comments Created 6 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 | « Source/web/WebLocalFrameImpl.cpp ('k') | Source/web/WebOptionElement.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) 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 { 197 {
198 if (m_private->isContainerNode()) 198 if (m_private->isContainerNode())
199 return WebElementCollection(toContainerNode(m_private.get())->getElement sByTagName(tag)); 199 return WebElementCollection(toContainerNode(m_private.get())->getElement sByTagName(tag));
200 return WebElementCollection(); 200 return WebElementCollection();
201 } 201 }
202 202
203 WebElement WebNode::querySelector(const WebString& tag, WebExceptionCode& ec) co nst 203 WebElement WebNode::querySelector(const WebString& tag, WebExceptionCode& ec) co nst
204 { 204 {
205 TrackExceptionState exceptionState; 205 TrackExceptionState exceptionState;
206 WebElement element; 206 WebElement element;
207 if (m_private->isContainerNode()) 207 if (m_private->isContainerNode()) {
208 #if ENABLE(OILPAN)
209 // FIXME: ContainerNode::querySelector should return an Element raw
210 // pointer.
211 element = toContainerNode(m_private.get())->querySelector(tag, exception State).get();
212 #else
208 element = toContainerNode(m_private.get())->querySelector(tag, exception State); 213 element = toContainerNode(m_private.get())->querySelector(tag, exception State);
214 #endif
215 }
209 ec = exceptionState.code(); 216 ec = exceptionState.code();
210 return element; 217 return element;
211 } 218 }
212 219
213 WebElement WebNode::rootEditableElement() const 220 WebElement WebNode::rootEditableElement() const
214 { 221 {
215 return WebElement(m_private->rootEditableElement()); 222 return WebElement(m_private->rootEditableElement());
216 } 223 }
217 224
218 bool WebNode::focused() const 225 bool WebNode::focused() const
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 } 257 }
251 258
252 WebElement WebNode::shadowHost() const 259 WebElement WebNode::shadowHost() const
253 { 260 {
254 if (isNull()) 261 if (isNull())
255 return WebElement(); 262 return WebElement();
256 const Node* coreNode = constUnwrap<Node>(); 263 const Node* coreNode = constUnwrap<Node>();
257 return WebElement(coreNode->shadowHost()); 264 return WebElement(coreNode->shadowHost());
258 } 265 }
259 266
260 WebNode::WebNode(const PassRefPtr<Node>& node) 267 WebNode::WebNode(const PassRefPtrWillBeRawPtr<Node>& node)
261 : m_private(node) 268 : m_private(node)
262 { 269 {
263 } 270 }
264 271
265 WebNode& WebNode::operator=(const PassRefPtr<Node>& node) 272 WebNode& WebNode::operator=(const PassRefPtrWillBeRawPtr<Node>& node)
266 { 273 {
267 m_private = node; 274 m_private = node;
268 return *this; 275 return *this;
269 } 276 }
270 277
271 WebNode::operator PassRefPtr<Node>() const 278 WebNode::operator PassRefPtrWillBeRawPtr<Node>() const
272 { 279 {
273 return m_private.get(); 280 return m_private.get();
274 } 281 }
275 282
276 } // namespace blink 283 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebLocalFrameImpl.cpp ('k') | Source/web/WebOptionElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698