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: third_party/WebKit/Source/core/loader/ImageLoader.cpp

Issue 2326993002: Refactoring: Remove redundant assignments in ImageLoader (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv ed. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv ed.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 if (eventType == EventTypeNames::error) 554 if (eventType == EventTypeNames::error)
555 dispatchPendingErrorEvent(); 555 dispatchPendingErrorEvent();
556 } 556 }
557 557
558 void ImageLoader::dispatchPendingLoadEvent() 558 void ImageLoader::dispatchPendingLoadEvent()
559 { 559 {
560 if (!m_hasPendingLoadEvent) 560 if (!m_hasPendingLoadEvent)
561 return; 561 return;
562 if (!m_image) 562 if (!m_image)
563 return; 563 return;
564 m_hasPendingLoadEvent = false;
565 if (element()->document().frame()) 564 if (element()->document().frame())
566 dispatchLoadEvent(); 565 dispatchLoadEvent();
567 566
568 // Only consider updating the protection ref-count of the Element immediatel y before returning 567 // Only consider updating the protection ref-count of the Element immediatel y before returning
569 // from this function as doing so might result in the destruction of this Im ageLoader. 568 // from this function as doing so might result in the destruction of this Im ageLoader.
570 updatedHasPendingEvent(); 569 updatedHasPendingEvent();
571 } 570 }
572 571
573 void ImageLoader::dispatchPendingErrorEvent() 572 void ImageLoader::dispatchPendingErrorEvent()
574 { 573 {
575 if (!m_hasPendingErrorEvent) 574 if (!m_hasPendingErrorEvent)
576 return; 575 return;
577 m_hasPendingErrorEvent = false;
578 576
579 if (element()->document().frame()) 577 if (element()->document().frame())
580 element()->dispatchEvent(Event::create(EventTypeNames::error)); 578 element()->dispatchEvent(Event::create(EventTypeNames::error));
581 579
582 // Only consider updating the protection ref-count of the Element immediatel y before returning 580 // Only consider updating the protection ref-count of the Element immediatel y before returning
583 // from this function as doing so might result in the destruction of this Im ageLoader. 581 // from this function as doing so might result in the destruction of this Im ageLoader.
584 updatedHasPendingEvent(); 582 updatedHasPendingEvent();
585 } 583 }
586 584
587 bool ImageLoader::getImageAnimationPolicy(ImageAnimationPolicy& policy) 585 bool ImageLoader::getImageAnimationPolicy(ImageAnimationPolicy& policy)
(...skipping 17 matching lines...) Expand all
605 603
606 void ImageLoader::elementDidMoveToNewDocument() 604 void ImageLoader::elementDidMoveToNewDocument()
607 { 605 {
608 if (m_loadDelayCounter) 606 if (m_loadDelayCounter)
609 m_loadDelayCounter->documentChanged(m_element->document()); 607 m_loadDelayCounter->documentChanged(m_element->document());
610 clearFailedLoadURL(); 608 clearFailedLoadURL();
611 setImage(0); 609 setImage(0);
612 } 610 }
613 611
614 } // namespace blink 612 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698