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

Side by Side Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2469873002: [ImageResource 4] Split ImageResource into Resource and Image parts (Closed)
Patch Set: comments Created 4 years 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 double deltaTimeInSeconds, 586 double deltaTimeInSeconds,
587 ExceptionState& exceptionState) { 587 ExceptionState& exceptionState) {
588 ASSERT(image); 588 ASSERT(image);
589 if (deltaTimeInSeconds < 0) { 589 if (deltaTimeInSeconds < 0) {
590 exceptionState.throwDOMException( 590 exceptionState.throwDOMException(
591 InvalidAccessError, ExceptionMessages::indexExceedsMinimumBound( 591 InvalidAccessError, ExceptionMessages::indexExceedsMinimumBound(
592 "deltaTimeInSeconds", deltaTimeInSeconds, 0.0)); 592 "deltaTimeInSeconds", deltaTimeInSeconds, 0.0));
593 return; 593 return;
594 } 594 }
595 595
596 ImageResource* resource = nullptr; 596 ImageResourceContent* resource = nullptr;
597 if (isHTMLImageElement(*image)) { 597 if (isHTMLImageElement(*image)) {
598 resource = toHTMLImageElement(*image).cachedImage(); 598 resource = toHTMLImageElement(*image).cachedImage();
599 } else if (isSVGImageElement(*image)) { 599 } else if (isSVGImageElement(*image)) {
600 resource = toSVGImageElement(*image).cachedImage(); 600 resource = toSVGImageElement(*image).cachedImage();
601 } else { 601 } else {
602 exceptionState.throwDOMException( 602 exceptionState.throwDOMException(
603 InvalidAccessError, "The element provided is not a image element."); 603 InvalidAccessError, "The element provided is not a image element.");
604 return; 604 return;
605 } 605 }
606 606
(...skipping 10 matching lines...) Expand all
617 return; 617 return;
618 } 618 }
619 619
620 imageData->advanceTime(deltaTimeInSeconds); 620 imageData->advanceTime(deltaTimeInSeconds);
621 } 621 }
622 622
623 void Internals::advanceImageAnimation(Element* image, 623 void Internals::advanceImageAnimation(Element* image,
624 ExceptionState& exceptionState) { 624 ExceptionState& exceptionState) {
625 ASSERT(image); 625 ASSERT(image);
626 626
627 ImageResource* resource = nullptr; 627 ImageResourceContent* resource = nullptr;
628 if (isHTMLImageElement(*image)) { 628 if (isHTMLImageElement(*image)) {
629 resource = toHTMLImageElement(*image).cachedImage(); 629 resource = toHTMLImageElement(*image).cachedImage();
630 } else if (isSVGImageElement(*image)) { 630 } else if (isSVGImageElement(*image)) {
631 resource = toSVGImageElement(*image).cachedImage(); 631 resource = toSVGImageElement(*image).cachedImage();
632 } else { 632 } else {
633 exceptionState.throwDOMException( 633 exceptionState.throwDOMException(
634 InvalidAccessError, "The element provided is not a image element."); 634 InvalidAccessError, "The element provided is not a image element.");
635 return; 635 return;
636 } 636 }
637 637
(...skipping 2460 matching lines...) Expand 10 before | Expand all | Expand 10 after
3098 3098
3099 void Internals::crash() { 3099 void Internals::crash() {
3100 CHECK(false) << "Intentional crash"; 3100 CHECK(false) << "Intentional crash";
3101 } 3101 }
3102 3102
3103 void Internals::setIsLowEndDevice(bool isLowEndDevice) { 3103 void Internals::setIsLowEndDevice(bool isLowEndDevice) {
3104 MemoryCoordinator::setIsLowEndDeviceForTesting(isLowEndDevice); 3104 MemoryCoordinator::setIsLowEndDeviceForTesting(isLowEndDevice);
3105 } 3105 }
3106 3106
3107 } // namespace blink 3107 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698