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

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

Issue 1839643009: RELEASE_ASSERT -> CHECK and ASSERT -> DCHECK in web. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Return DCHECK_IS_ON checks. Created 4 years, 8 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 String WebFrameSerializerImpl::preActionBeforeSerializeOpenTag( 123 String WebFrameSerializerImpl::preActionBeforeSerializeOpenTag(
124 const Element* element, SerializeDomParam* param, bool* needSkip) 124 const Element* element, SerializeDomParam* param, bool* needSkip)
125 { 125 {
126 StringBuilder result; 126 StringBuilder result;
127 127
128 *needSkip = false; 128 *needSkip = false;
129 if (param->isHTMLDocument) { 129 if (param->isHTMLDocument) {
130 // Skip the open tag of original META tag which declare charset since we 130 // Skip the open tag of original META tag which declare charset since we
131 // have overrided the META which have correct charset declaration after 131 // have overrided the META which have correct charset declaration after
132 // serializing open tag of HEAD element. 132 // serializing open tag of HEAD element.
133 ASSERT(element); 133 DCHECK(element);
134 if (isHTMLMetaElement(element) && toHTMLMetaElement(element)->computeEnc oding().isValid()) { 134 if (isHTMLMetaElement(element) && toHTMLMetaElement(element)->computeEnc oding().isValid()) {
135 // Found META tag declared charset, we need to skip it when 135 // Found META tag declared charset, we need to skip it when
136 // serializing DOM. 136 // serializing DOM.
137 param->skipMetaElement = element; 137 param->skipMetaElement = element;
138 *needSkip = true; 138 *needSkip = true;
139 } else if (isHTMLHtmlElement(*element)) { 139 } else if (isHTMLHtmlElement(*element)) {
140 // Check something before processing the open tag of HEAD element. 140 // Check something before processing the open tag of HEAD element.
141 // First we add doc type declaration if original document has it. 141 // First we add doc type declaration if original document has it.
142 if (!param->haveSeenDocType) { 142 if (!param->haveSeenDocType) {
143 param->haveSeenDocType = true; 143 param->haveSeenDocType = true;
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 WebFrameSerializerImpl::WebFrameSerializerImpl( 442 WebFrameSerializerImpl::WebFrameSerializerImpl(
443 WebLocalFrame* frame, 443 WebLocalFrame* frame,
444 WebFrameSerializerClient* client, 444 WebFrameSerializerClient* client,
445 WebFrameSerializer::LinkRewritingDelegate* delegate) 445 WebFrameSerializer::LinkRewritingDelegate* delegate)
446 : m_client(client) 446 : m_client(client)
447 , m_delegate(delegate) 447 , m_delegate(delegate)
448 , m_htmlEntities(false) 448 , m_htmlEntities(false)
449 , m_xmlEntities(true) 449 , m_xmlEntities(true)
450 { 450 {
451 // Must specify available webframe. 451 // Must specify available webframe.
452 ASSERT(frame); 452 DCHECK(frame);
453 m_specifiedWebLocalFrameImpl = toWebLocalFrameImpl(frame); 453 m_specifiedWebLocalFrameImpl = toWebLocalFrameImpl(frame);
454 // Make sure we have non null client and delegate. 454 // Make sure we have non null client and delegate.
455 ASSERT(client); 455 DCHECK(client);
456 ASSERT(delegate); 456 DCHECK(delegate);
457 457
458 ASSERT(m_dataBuffer.isEmpty()); 458 DCHECK(m_dataBuffer.isEmpty());
459 } 459 }
460 460
461 bool WebFrameSerializerImpl::serialize() 461 bool WebFrameSerializerImpl::serialize()
462 { 462 {
463 bool didSerialization = false; 463 bool didSerialization = false;
464 464
465 Document* document = m_specifiedWebLocalFrameImpl->frame()->document(); 465 Document* document = m_specifiedWebLocalFrameImpl->frame()->document();
466 const KURL& url = document->url(); 466 const KURL& url = document->url();
467 467
468 if (url.isValid()) { 468 if (url.isValid()) {
(...skipping 11 matching lines...) Expand all
480 if (documentElement) 480 if (documentElement)
481 buildContentForNode(documentElement, &param); 481 buildContentForNode(documentElement, &param);
482 482
483 encodeAndFlushBuffer(WebFrameSerializerClient::CurrentFrameIsFinished, & param, ForceFlush); 483 encodeAndFlushBuffer(WebFrameSerializerClient::CurrentFrameIsFinished, & param, ForceFlush);
484 } else { 484 } else {
485 // Report empty contents for invalid URLs. 485 // Report empty contents for invalid URLs.
486 m_client->didSerializeDataForFrame( 486 m_client->didSerializeDataForFrame(
487 WebCString(), WebFrameSerializerClient::CurrentFrameIsFinished); 487 WebCString(), WebFrameSerializerClient::CurrentFrameIsFinished);
488 } 488 }
489 489
490 ASSERT(m_dataBuffer.isEmpty()); 490 DCHECK(m_dataBuffer.isEmpty());
491 return didSerialization; 491 return didSerialization;
492 } 492 }
493 493
494 } // namespace blink 494 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameSerializer.cpp ('k') | third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698