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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSColorValue.cpp

Issue 2796183002: Introduce the nested namespace ::blink::cssvalue, start with CSSColorValue. (Closed)
Patch Set: Use the least possible namespace scoping when aliasing. 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/CSSColorValue.h" 5 #include "core/css/CSSColorValue.h"
6 6
7 #include "core/css/CSSValuePool.h" 7 #include "core/css/CSSValuePool.h"
8 8
9 namespace blink { 9 namespace blink {
10 namespace cssvalue {
10 11
11 CSSColorValue* CSSColorValue::create(RGBA32 color) { 12 CSSColorValue* CSSColorValue::create(RGBA32 color) {
12 // These are the empty and deleted values of the hash table. 13 // These are the empty and deleted values of the hash table.
13 if (color == Color::transparent) 14 if (color == Color::transparent)
14 return cssValuePool().transparentColor(); 15 return cssValuePool().transparentColor();
15 if (color == Color::white) 16 if (color == Color::white)
16 return cssValuePool().whiteColor(); 17 return cssValuePool().whiteColor();
17 // Just because it is common. 18 // Just because it is common.
18 if (color == Color::black) 19 if (color == Color::black)
19 return cssValuePool().blackColor(); 20 return cssValuePool().blackColor();
20 21
21 CSSValuePool::ColorValueCache::AddResult entry = 22 CSSValuePool::ColorValueCache::AddResult entry =
22 cssValuePool().getColorCacheEntry(color); 23 cssValuePool().getColorCacheEntry(color);
23 if (entry.isNewEntry) 24 if (entry.isNewEntry)
24 entry.storedValue->value = new CSSColorValue(color); 25 entry.storedValue->value = new CSSColorValue(color);
25 return entry.storedValue->value; 26 return entry.storedValue->value;
26 } 27 }
27 28
29 } // namespace cssvalue
28 } // namespace blink 30 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSColorValue.h ('k') | third_party/WebKit/Source/core/css/CSSValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698