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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/FontFallbackList.h

Issue 2807913002: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/fonts (Closed)
Patch Set: rebase Created 3 years, 8 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, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // FIXME: It should be possible to combine fontSelectorVersion and generation. 56 // FIXME: It should be possible to combine fontSelectorVersion and generation.
57 unsigned FontSelectorVersion() const { return font_selector_version_; } 57 unsigned FontSelectorVersion() const { return font_selector_version_; }
58 unsigned Generation() const { return generation_; } 58 unsigned Generation() const { return generation_; }
59 59
60 ShapeCache* GetShapeCache(const FontDescription& font_description) const { 60 ShapeCache* GetShapeCache(const FontDescription& font_description) const {
61 if (!shape_cache_) { 61 if (!shape_cache_) {
62 FallbackListCompositeKey key = CompositeKey(font_description); 62 FallbackListCompositeKey key = CompositeKey(font_description);
63 shape_cache_ = 63 shape_cache_ =
64 FontCache::GetFontCache()->GetShapeCache(key)->GetWeakPtr(); 64 FontCache::GetFontCache()->GetShapeCache(key)->GetWeakPtr();
65 } 65 }
66 ASSERT(shape_cache_); 66 DCHECK(shape_cache_);
67 if (GetFontSelector()) 67 if (GetFontSelector())
68 shape_cache_->ClearIfVersionChanged(GetFontSelector()->Version()); 68 shape_cache_->ClearIfVersionChanged(GetFontSelector()->Version());
69 return shape_cache_.get(); 69 return shape_cache_.get();
70 } 70 }
71 71
72 const SimpleFontData* PrimarySimpleFontData( 72 const SimpleFontData* PrimarySimpleFontData(
73 const FontDescription& font_description) { 73 const FontDescription& font_description) {
74 ASSERT(IsMainThread()); 74 DCHECK(IsMainThread());
75 if (!cached_primary_simple_font_data_) { 75 if (!cached_primary_simple_font_data_) {
76 cached_primary_simple_font_data_ = 76 cached_primary_simple_font_data_ =
77 DeterminePrimarySimpleFontData(font_description); 77 DeterminePrimarySimpleFontData(font_description);
78 ASSERT(cached_primary_simple_font_data_); 78 DCHECK(cached_primary_simple_font_data_);
79 } 79 }
80 return cached_primary_simple_font_data_; 80 return cached_primary_simple_font_data_;
81 } 81 }
82 const FontData* FontDataAt(const FontDescription&, unsigned index) const; 82 const FontData* FontDataAt(const FontDescription&, unsigned index) const;
83 83
84 FallbackListCompositeKey CompositeKey(const FontDescription&) const; 84 FallbackListCompositeKey CompositeKey(const FontDescription&) const;
85 85
86 private: 86 private:
87 FontFallbackList(); 87 FontFallbackList();
88 88
(...skipping 11 matching lines...) Expand all
100 unsigned font_selector_version_; 100 unsigned font_selector_version_;
101 mutable int family_index_; 101 mutable int family_index_;
102 unsigned short generation_; 102 unsigned short generation_;
103 mutable bool has_loading_fallback_ : 1; 103 mutable bool has_loading_fallback_ : 1;
104 mutable WeakPtr<ShapeCache> shape_cache_; 104 mutable WeakPtr<ShapeCache> shape_cache_;
105 }; 105 };
106 106
107 } // namespace blink 107 } // namespace blink
108 108
109 #endif 109 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698