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

Unified Diff: content/common/font_cache_dispatcher_win.cc

Issue 649533003: C++11 declares a type safe null pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Presubmit errors Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/cursors/webcursor_ozone.cc ('k') | content/common/font_config_ipc_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/font_cache_dispatcher_win.cc
diff --git a/content/common/font_cache_dispatcher_win.cc b/content/common/font_cache_dispatcher_win.cc
index 2181a08f98d92d73415941c3cdf92deb25a7acbd..2bdf7c2ca5380514fef52b45fa4b2419a88dc4d0 100644
--- a/content/common/font_cache_dispatcher_win.cc
+++ b/content/common/font_cache_dispatcher_win.cc
@@ -30,12 +30,12 @@ class FontCache {
// Fetch the font into memory.
// No matter the font is cached or not, we load it to avoid GDI swapping out
// that font file.
- HDC hdc = GetDC(NULL);
+ HDC hdc = GetDC(nullptr);
HFONT font_handle = CreateFontIndirect(&font);
- DCHECK(NULL != font_handle);
+ DCHECK(nullptr != font_handle);
HGDIOBJ old_font = SelectObject(hdc, font_handle);
- DCHECK(NULL != old_font);
+ DCHECK(nullptr != old_font);
TEXTMETRIC tm;
BOOL ret = GetTextMetrics(hdc, &tm);
@@ -59,7 +59,7 @@ class FontCache {
} else { // Requested font is already in cache, release old handles.
SelectObject(cache_[font_name].dc_, cache_[font_name].old_font_);
DeleteObject(cache_[font_name].font_);
- ReleaseDC(NULL, cache_[font_name].dc_);
+ ReleaseDC(nullptr, cache_[font_name].dc_);
}
cache_[font_name].font_ = font_handle;
cache_[font_name].dc_ = hdc;
@@ -100,7 +100,7 @@ class FontCache {
private:
struct CacheElement {
CacheElement()
- : font_(NULL), old_font_(NULL), dc_(NULL), ref_count_(0) {
+ : font_(nullptr), old_font_(nullptr), dc_(nullptr), ref_count_(0) {
}
~CacheElement() {
@@ -111,7 +111,7 @@ class FontCache {
DeleteObject(font_);
}
if (dc_) {
- ReleaseDC(NULL, dc_);
+ ReleaseDC(nullptr, dc_);
}
}
@@ -135,7 +135,7 @@ class FontCache {
}
FontCacheDispatcher::FontCacheDispatcher()
- : sender_(NULL) {
+ : sender_(nullptr) {
}
FontCacheDispatcher::~FontCacheDispatcher() {
@@ -157,7 +157,7 @@ bool FontCacheDispatcher::OnMessageReceived(const IPC::Message& message) {
}
void FontCacheDispatcher::OnChannelClosing() {
- sender_ = NULL;
+ sender_ = nullptr;
}
bool FontCacheDispatcher::Send(IPC::Message* message) {
« no previous file with comments | « content/common/cursors/webcursor_ozone.cc ('k') | content/common/font_config_ipc_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698