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

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

Issue 418253003: Don't dereference null pointer in FastTextAutosizer::getTentativeClusterRoots() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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 | « 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 206
207 // Fingerprints are computed during style recalc, for (some subset of) 207 // Fingerprints are computed during style recalc, for (some subset of)
208 // blocks that will become cluster roots. 208 // blocks that will become cluster roots.
209 class FingerprintMapper { 209 class FingerprintMapper {
210 public: 210 public:
211 void add(const RenderObject*, Fingerprint); 211 void add(const RenderObject*, Fingerprint);
212 void addTentativeClusterRoot(const RenderBlock*, Fingerprint); 212 void addTentativeClusterRoot(const RenderBlock*, Fingerprint);
213 // Returns true if any BlockSet was modified or freed by the removal. 213 // Returns true if any BlockSet was modified or freed by the removal.
214 bool remove(const RenderObject*); 214 bool remove(const RenderObject*);
215 Fingerprint get(const RenderObject*); 215 Fingerprint get(const RenderObject*);
216 BlockSet& getTentativeClusterRoots(Fingerprint); 216 BlockSet* getTentativeClusterRoots(Fingerprint);
217 private: 217 private:
218 typedef HashMap<const RenderObject*, Fingerprint> FingerprintMap; 218 typedef HashMap<const RenderObject*, Fingerprint> FingerprintMap;
219 typedef HashMap<Fingerprint, OwnPtr<BlockSet> > ReverseFingerprintMap; 219 typedef HashMap<Fingerprint, OwnPtr<BlockSet> > ReverseFingerprintMap;
220 220
221 FingerprintMap m_fingerprints; 221 FingerprintMap m_fingerprints;
222 ReverseFingerprintMap m_blocksForFingerprint; 222 ReverseFingerprintMap m_blocksForFingerprint;
223 #if ENABLE(ASSERT) 223 #if ENABLE(ASSERT)
224 void assertMapsAreConsistent(); 224 void assertMapsAreConsistent();
225 #endif 225 #endif
226 }; 226 };
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 FingerprintMapper m_fingerprintMapper; 301 FingerprintMapper m_fingerprintMapper;
302 Vector<RefPtr<RenderStyle> > m_stylesRetainedDuringLayout; 302 Vector<RefPtr<RenderStyle> > m_stylesRetainedDuringLayout;
303 // FIXME: All frames should share the same m_pageInfo instance. 303 // FIXME: All frames should share the same m_pageInfo instance.
304 PageInfo m_pageInfo; 304 PageInfo m_pageInfo;
305 bool m_updatePageInfoDeferred; 305 bool m_updatePageInfoDeferred;
306 }; 306 };
307 307
308 } // namespace blink 308 } // namespace blink
309 309
310 #endif // FastTextAutosizer_h 310 #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