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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/Image.h

Issue 2905833003: Make Image::image_observer_ WeakPersistent (Closed)
Patch Set: Reflect comments Created 3 years, 6 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 | « third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp ('k') | 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) 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 SkBlendMode, 222 SkBlendMode,
223 const FloatRect&, 223 const FloatRect&,
224 const FloatSize& repeat_spacing = FloatSize()); 224 const FloatSize& repeat_spacing = FloatSize());
225 225
226 private: 226 private:
227 bool image_observer_disabled_; 227 bool image_observer_disabled_;
228 RefPtr<SharedBuffer> encoded_image_data_; 228 RefPtr<SharedBuffer> encoded_image_data_;
229 // TODO(Oilpan): consider having Image on the Oilpan heap and 229 // TODO(Oilpan): consider having Image on the Oilpan heap and
230 // turn this into a Member<>. 230 // turn this into a Member<>.
231 // 231 //
232 // The observer (an ImageResourceContent) is an untraced member, with the 232 // The observer (an ImageResourceContent) is responsible for clearing
233 // ImageResourceContent being responsible for clearing itself out. 233 // itself out when it switches to another Image.
234 UntracedMember<ImageObserver> image_observer_; 234 // When the ImageResourceContent is garbage collected while Image is still
235 // alive, |image_observer_| is cleared by WeakPersistent mechanism.
236 WeakPersistent<ImageObserver> image_observer_;
235 PaintImage::Id stable_image_id_; 237 PaintImage::Id stable_image_id_;
236 }; 238 };
237 239
238 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ 240 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \
239 DEFINE_TYPE_CASTS(typeName, Image, image, image->Is##typeName(), \ 241 DEFINE_TYPE_CASTS(typeName, Image, image, image->Is##typeName(), \
240 image.Is##typeName()) 242 image.Is##typeName())
241 243
242 } // namespace blink 244 } // namespace blink
243 245
244 #endif 246 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698