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/platform/graphics/Image.h

Issue 2613853002: Phase III Step 2: Call imageNotifyFinished() and image load event after SVG loading completes (Closed)
Patch Set: Rebase Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, 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 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 virtual bool UsesContainerSize() const { return false; } 95 virtual bool UsesContainerSize() const { return false; }
96 virtual bool HasRelativeSize() const { return false; } 96 virtual bool HasRelativeSize() const { return false; }
97 97
98 virtual IntSize Size() const = 0; 98 virtual IntSize Size() const = 0;
99 IntRect Rect() const { return IntRect(IntPoint(), Size()); } 99 IntRect Rect() const { return IntRect(IntPoint(), Size()); }
100 int width() const { return Size().Width(); } 100 int width() const { return Size().Width(); }
101 int height() const { return Size().Height(); } 101 int height() const { return Size().Height(); }
102 virtual bool GetHotSpot(IntPoint&) const { return false; } 102 virtual bool GetHotSpot(IntPoint&) const { return false; }
103 103
104 enum SizeAvailability { kSizeAvailable, kSizeUnavailable }; 104 enum SizeAvailability {
fs 2017/05/05 10:52:42 uNit: Maybe order these in a sort of "lifecycle or
hiroshige 2017/05/08 17:22:07 Done.
105 kSizeAvailable,
106 kSizeUnavailable,
107 kSizeAvailableAndLoadingAsynchronously
108 };
109
110 // If setData() returns |SizeAvailableAndLoadingAsynchronously|:
111 // Image loading is continuing asynchronously
112 // (only when |this| is SVGImage and |allDataReceived| is true), and
fs 2017/05/05 10:52:42 Nit: The Blink Renaming means naming here (and in
hiroshige 2017/05/08 17:22:06 Done.
113 // ImageResourceObserver::loadCompleted() is called when finished.
114 // Otherwise:
115 // Image loading is completed synchronously.
116 // ImageResourceObserver::loadCompleted() is not called.
105 virtual SizeAvailability SetData(PassRefPtr<SharedBuffer> data, 117 virtual SizeAvailability SetData(PassRefPtr<SharedBuffer> data,
106 bool all_data_received); 118 bool all_data_received);
107 virtual SizeAvailability DataChanged(bool /*allDataReceived*/) { 119 virtual SizeAvailability DataChanged(bool /*allDataReceived*/) {
108 return kSizeUnavailable; 120 return kSizeUnavailable;
109 } 121 }
110 122
111 virtual String FilenameExtension() const { 123 virtual String FilenameExtension() const {
112 return String(); 124 return String();
113 } // null string if unknown 125 } // null string if unknown
114 126
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 bool image_observer_disabled_; 231 bool image_observer_disabled_;
220 }; 232 };
221 233
222 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ 234 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \
223 DEFINE_TYPE_CASTS(typeName, Image, image, image->Is##typeName(), \ 235 DEFINE_TYPE_CASTS(typeName, Image, image, image->Is##typeName(), \
224 image.Is##typeName()) 236 image.Is##typeName())
225 237
226 } // namespace blink 238 } // namespace blink
227 239
228 #endif 240 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698