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

Side by Side Diff: third_party/WebKit/Source/core/css/cssom/CSSResourceValue.h

Issue 2190543004: [Typed-OM] Add CSSResourceValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add to global interface listing Created 4 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CSSResourceValue_h
6 #define CSSResourceValue_h
7
8 #include "core/css/cssom/CSSStyleValue.h"
9
10 #include "core/fetch/Resource.h"
11
12 namespace blink {
13
14 class CORE_EXPORT CSSResourceValue : public CSSStyleValue {
15 WTF_MAKE_NONCOPYABLE(CSSResourceValue);
16 DEFINE_WRAPPERTYPEINFO();
17 public:
18 virtual ~CSSResourceValue() { }
19
20 StyleValueType type() const override { return ResourceStateType; }
21
22 const String state() const
23 {
24 switch (status()) {
25 case Resource::Status::NotStarted:
26 return "unloaded";
27 case Resource::Status::Pending:
28 return "loading";
29 case Resource::Status::Cached:
30 return "loaded";
31 case Resource::Status::LoadError:
32 case Resource::Status::DecodeError:
33 return "error";
34 default: NOTREACHED();
35 }
36 }
37
38 DEFINE_INLINE_VIRTUAL_TRACE()
39 {
40 CSSStyleValue::trace(visitor);
41 }
42
43 protected:
44 CSSResourceValue() { }
45
46 virtual Resource::Status status() const = 0;
47 };
48
49 } // namespace blink
50
51 #endif // CSSResourceValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698