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

Side by Side Diff: Source/core/rendering/FastTextAutosizer.h

Issue 274463002: Speculative fix for crash accessing a supercluster root. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/rendering/FastTextAutosizer.cpp » ('j') | 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 typedef unsigned Fingerprint; 194 typedef unsigned Fingerprint;
195 typedef HashMap<Fingerprint, OwnPtr<Supercluster> > SuperclusterMap; 195 typedef HashMap<Fingerprint, OwnPtr<Supercluster> > SuperclusterMap;
196 typedef Vector<OwnPtr<Cluster> > ClusterStack; 196 typedef Vector<OwnPtr<Cluster> > ClusterStack;
197 197
198 // Fingerprints are computed during style recalc, for (some subset of) 198 // Fingerprints are computed during style recalc, for (some subset of)
199 // blocks that will become cluster roots. 199 // blocks that will become cluster roots.
200 class FingerprintMapper { 200 class FingerprintMapper {
201 public: 201 public:
202 void add(const RenderObject*, Fingerprint); 202 void add(const RenderObject*, Fingerprint);
203 void addTentativeClusterRoot(const RenderBlock*, Fingerprint); 203 void addTentativeClusterRoot(const RenderBlock*, Fingerprint);
204 void remove(const RenderObject*); 204 // Returns true if any BlockSet was modified or freed by the removal.
205 bool remove(const RenderObject*);
205 Fingerprint get(const RenderObject*); 206 Fingerprint get(const RenderObject*);
206 BlockSet& getTentativeClusterRoots(Fingerprint); 207 BlockSet& getTentativeClusterRoots(Fingerprint);
207 private: 208 private:
208 typedef HashMap<const RenderObject*, Fingerprint> FingerprintMap; 209 typedef HashMap<const RenderObject*, Fingerprint> FingerprintMap;
209 typedef HashMap<Fingerprint, OwnPtr<BlockSet> > ReverseFingerprintMap; 210 typedef HashMap<Fingerprint, OwnPtr<BlockSet> > ReverseFingerprintMap;
210 211
211 FingerprintMap m_fingerprints; 212 FingerprintMap m_fingerprints;
212 ReverseFingerprintMap m_blocksForFingerprint; 213 ReverseFingerprintMap m_blocksForFingerprint;
213 #ifndef NDEBUG 214 #ifndef NDEBUG
214 void assertMapsAreConsistent(); 215 void assertMapsAreConsistent();
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 FingerprintMapper m_fingerprintMapper; 293 FingerprintMapper m_fingerprintMapper;
293 Vector<RefPtr<RenderStyle> > m_stylesRetainedDuringLayout; 294 Vector<RefPtr<RenderStyle> > m_stylesRetainedDuringLayout;
294 // FIXME: All frames should share the same m_pageInfo instance. 295 // FIXME: All frames should share the same m_pageInfo instance.
295 PageInfo m_pageInfo; 296 PageInfo m_pageInfo;
296 bool m_updatePageInfoDeferred; 297 bool m_updatePageInfoDeferred;
297 }; 298 };
298 299
299 } // namespace WebCore 300 } // namespace WebCore
300 301
301 #endif // FastTextAutosizer_h 302 #endif // FastTextAutosizer_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/FastTextAutosizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698