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

Side by Side Diff: Source/core/css/MediaQueryEvaluator.cpp

Issue 170603003: Use nullptr_t for RefPtr, PassRefPtr and RawPtr. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Final rebase Created 6 years, 10 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 | « Source/core/css/FontFaceCache.cpp ('k') | Source/core/css/MediaQueryListListener.h » ('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 * CSS Media Query Evaluator 2 * CSS Media Query Evaluator
3 * 3 *
4 * Copyright (C) 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>. 4 * Copyright (C) 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>.
5 * Copyright (C) 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2013 Intel Corporation. All rights reserved. 6 * Copyright (C) 2013 Intel Corporation. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 using namespace MediaFeatureNames; 57 using namespace MediaFeatureNames;
58 58
59 enum MediaFeaturePrefix { MinPrefix, MaxPrefix, NoPrefix }; 59 enum MediaFeaturePrefix { MinPrefix, MaxPrefix, NoPrefix };
60 60
61 typedef bool (*EvalFunc)(CSSValue*, RenderStyle*, Frame*, MediaFeaturePrefix); 61 typedef bool (*EvalFunc)(CSSValue*, RenderStyle*, Frame*, MediaFeaturePrefix);
62 typedef HashMap<StringImpl*, EvalFunc> FunctionMap; 62 typedef HashMap<StringImpl*, EvalFunc> FunctionMap;
63 static FunctionMap* gFunctionMap; 63 static FunctionMap* gFunctionMap;
64 64
65 MediaQueryEvaluator::MediaQueryEvaluator(bool mediaFeatureResult) 65 MediaQueryEvaluator::MediaQueryEvaluator(bool mediaFeatureResult)
66 : m_frame(0) 66 : m_frame(0)
67 , m_style(0) 67 , m_style(nullptr)
68 , m_expResult(mediaFeatureResult) 68 , m_expResult(mediaFeatureResult)
69 { 69 {
70 } 70 }
71 71
72 MediaQueryEvaluator::MediaQueryEvaluator(const AtomicString& acceptedMediaType, bool mediaFeatureResult) 72 MediaQueryEvaluator::MediaQueryEvaluator(const AtomicString& acceptedMediaType, bool mediaFeatureResult)
73 : m_mediaType(acceptedMediaType) 73 : m_mediaType(acceptedMediaType)
74 , m_frame(0) 74 , m_frame(0)
75 , m_style(0) 75 , m_style(nullptr)
76 , m_expResult(mediaFeatureResult) 76 , m_expResult(mediaFeatureResult)
77 { 77 {
78 } 78 }
79 79
80 MediaQueryEvaluator::MediaQueryEvaluator(const char* acceptedMediaType, bool med iaFeatureResult) 80 MediaQueryEvaluator::MediaQueryEvaluator(const char* acceptedMediaType, bool med iaFeatureResult)
81 : m_mediaType(acceptedMediaType) 81 : m_mediaType(acceptedMediaType)
82 , m_frame(0) 82 , m_frame(0)
83 , m_style(0) 83 , m_style(nullptr)
84 , m_expResult(mediaFeatureResult) 84 , m_expResult(mediaFeatureResult)
85 { 85 {
86 } 86 }
87 87
88 MediaQueryEvaluator::MediaQueryEvaluator(const AtomicString& acceptedMediaType, Frame* frame, RenderStyle* style) 88 MediaQueryEvaluator::MediaQueryEvaluator(const AtomicString& acceptedMediaType, Frame* frame, RenderStyle* style)
89 : m_mediaType(acceptedMediaType) 89 : m_mediaType(acceptedMediaType)
90 , m_frame(frame) 90 , m_frame(frame)
91 , m_style(style) 91 , m_style(style)
92 , m_expResult(false) // Doesn't matter when we have m_frame and m_style. 92 , m_expResult(false) // Doesn't matter when we have m_frame and m_style.
93 { 93 {
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 // Call the media feature evaluation function. Assume no prefix and let 690 // Call the media feature evaluation function. Assume no prefix and let
691 // trampoline functions override the prefix if prefix is used. 691 // trampoline functions override the prefix if prefix is used.
692 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); 692 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl());
693 if (func) 693 if (func)
694 return func(expr->value(), m_style.get(), m_frame, NoPrefix); 694 return func(expr->value(), m_style.get(), m_frame, NoPrefix);
695 695
696 return false; 696 return false;
697 } 697 }
698 698
699 } // namespace 699 } // namespace
OLDNEW
« no previous file with comments | « Source/core/css/FontFaceCache.cpp ('k') | Source/core/css/MediaQueryListListener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698