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

Side by Side Diff: third_party/WebKit/Source/web/WebDocument.cpp

Issue 1365203002: Make WebNode::to<Type>() (and toConst) casts contain type asserts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove more bad casts in WebFrameTest. Created 5 years, 2 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
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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 if (!linkElement) 329 if (!linkElement)
330 return false; 330 return false;
331 return equalIgnoringCase(linkElement->fastGetAttribute(HTMLNames::crossorigi nAttr), "use-credentials"); 331 return equalIgnoringCase(linkElement->fastGetAttribute(HTMLNames::crossorigi nAttr), "use-credentials");
332 } 332 }
333 333
334 WebDocument::WebDocument(const PassRefPtrWillBeRawPtr<Document>& elem) 334 WebDocument::WebDocument(const PassRefPtrWillBeRawPtr<Document>& elem)
335 : WebNode(elem) 335 : WebNode(elem)
336 { 336 {
337 } 337 }
338 338
339 DEFINE_WEB_NODE_TYPE_CASTS(WebDocument, constUnwrap<Node>()->isDocumentNode());
340
339 WebDocument& WebDocument::operator=(const PassRefPtrWillBeRawPtr<Document>& elem ) 341 WebDocument& WebDocument::operator=(const PassRefPtrWillBeRawPtr<Document>& elem )
340 { 342 {
341 m_private = elem; 343 m_private = elem;
342 return *this; 344 return *this;
343 } 345 }
344 346
345 WebDocument::operator PassRefPtrWillBeRawPtr<Document>() const 347 WebDocument::operator PassRefPtrWillBeRawPtr<Document>() const
346 { 348 {
347 return toDocument(m_private.get()); 349 return toDocument(m_private.get());
348 } 350 }
349 351
350 } // namespace blink 352 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698