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

Unified 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 default return value 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/cssom/CSSResourceValue.h
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSResourceValue.h b/third_party/WebKit/Source/core/css/cssom/CSSResourceValue.h
new file mode 100644
index 0000000000000000000000000000000000000000..50d0993cde3725641692cd5c4d4cc70f1f3b13d7
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/cssom/CSSResourceValue.h
@@ -0,0 +1,53 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CSSResourceValue_h
+#define CSSResourceValue_h
+
+#include "core/css/cssom/CSSStyleValue.h"
+
+#include "core/fetch/Resource.h"
+
+namespace blink {
+
+class CORE_EXPORT CSSResourceValue : public CSSStyleValue {
+ WTF_MAKE_NONCOPYABLE(CSSResourceValue);
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ virtual ~CSSResourceValue() { }
+
+ StyleValueType type() const override { return ResourceType; }
+
+ const String state() const
+ {
+ switch (status()) {
+ case Resource::Status::NotStarted:
+ return "unloaded";
+ case Resource::Status::Pending:
+ return "loading";
+ case Resource::Status::Cached:
+ return "loaded";
+ case Resource::Status::LoadError:
+ case Resource::Status::DecodeError:
+ return "error";
+ default:
+ NOTREACHED();
+ return "";
+ }
+ }
+
+ DEFINE_INLINE_VIRTUAL_TRACE()
+ {
+ CSSStyleValue::trace(visitor);
+ }
+
+protected:
+ CSSResourceValue() { }
+
+ virtual Resource::Status status() const = 0;
+};
+
+} // namespace blink
+
+#endif // CSSResourceValue_h

Powered by Google App Engine
This is Rietveld 408576698