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

Side by Side Diff: third_party/WebKit/Source/core/svg/graphics/SVGImage.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 Eric Seidel <eric@webkit.org> 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org>
3 * Copyright (C) 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2009 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 * 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 PaintFlags&, 176 PaintFlags&,
177 const SkMatrix& local_matrix); 177 const SkMatrix& local_matrix);
178 bool ApplyShaderInternal(PaintFlags&, 178 bool ApplyShaderInternal(PaintFlags&,
179 const SkMatrix& local_matrix, 179 const SkMatrix& local_matrix,
180 const KURL&); 180 const KURL&);
181 181
182 void StopAnimation(); 182 void StopAnimation();
183 void ScheduleTimelineRewind(); 183 void ScheduleTimelineRewind();
184 void FlushPendingTimelineRewind(); 184 void FlushPendingTimelineRewind();
185 185
186 void LoadCompleted();
187
188 class SVGImageLocalFrameClient;
189
186 Persistent<SVGImageChromeClient> chrome_client_; 190 Persistent<SVGImageChromeClient> chrome_client_;
187 Persistent<Page> page_; 191 Persistent<Page> page_;
188 std::unique_ptr<PaintController> paint_controller_; 192 std::unique_ptr<PaintController> paint_controller_;
189 193
190 // When an SVG image has no intrinsic size, the size depends on the default 194 // When an SVG image has no intrinsic size, the size depends on the default
191 // object size, which in turn depends on the container. One SVGImage may 195 // object size, which in turn depends on the container. One SVGImage may
192 // belong to multiple containers so the final image size can't be known in 196 // belong to multiple containers so the final image size can't be known in
193 // SVGImage. SVGImageForContainer carries the final image size, also called 197 // SVGImage. SVGImageForContainer carries the final image size, also called
194 // the "concrete object size". For more, see: SVGImageForContainer.h 198 // the "concrete object size". For more, see: SVGImageForContainer.h
195 IntSize intrinsic_size_; 199 IntSize intrinsic_size_;
196 bool has_pending_timeline_rewind_; 200 bool has_pending_timeline_rewind_;
201
202 enum LoadState {
203 kDataChangedNotStarted,
204 kInDataChanged,
205 kWaitingForAsyncLoadCompletion,
206 kLoadCompleted,
207 };
208
209 LoadState load_state_ = kDataChangedNotStarted;
210
211 Persistent<SVGImageLocalFrameClient> frame_client_;
197 }; 212 };
198 213
199 DEFINE_IMAGE_TYPE_CASTS(SVGImage); 214 DEFINE_IMAGE_TYPE_CASTS(SVGImage);
200 215
201 class ImageObserverDisabler { 216 class ImageObserverDisabler {
202 STACK_ALLOCATED(); 217 STACK_ALLOCATED();
203 WTF_MAKE_NONCOPYABLE(ImageObserverDisabler); 218 WTF_MAKE_NONCOPYABLE(ImageObserverDisabler);
204 219
205 public: 220 public:
206 ImageObserverDisabler(Image* image) : image_(image) { 221 ImageObserverDisabler(Image* image) : image_(image) {
207 image_->SetImageObserverDisabled(true); 222 image_->SetImageObserverDisabled(true);
208 } 223 }
209 224
210 ~ImageObserverDisabler() { image_->SetImageObserverDisabled(false); } 225 ~ImageObserverDisabler() { image_->SetImageObserverDisabled(false); }
211 226
212 private: 227 private:
213 Image* image_; 228 Image* image_;
214 }; 229 };
215 230
216 } // namespace blink 231 } // namespace blink
217 232
218 #endif // SVGImage_h 233 #endif // SVGImage_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698