Index: third_party/WebKit/Source/core/frame/Deprecation.cpp |
diff --git a/third_party/WebKit/Source/core/fetch/FetchInitiatorInfo.h b/third_party/WebKit/Source/core/frame/Deprecation.cpp |
similarity index 51% |
copy from third_party/WebKit/Source/core/fetch/FetchInitiatorInfo.h |
copy to third_party/WebKit/Source/core/frame/Deprecation.cpp |
index a9490a48debeacfcc707d7db9ec86653070981b3..484b6131008657172ad863fed43ce3014b369df0 100644 |
--- a/third_party/WebKit/Source/core/fetch/FetchInitiatorInfo.h |
+++ b/third_party/WebKit/Source/core/frame/Deprecation.cpp |
@@ -1,5 +1,5 @@ |
/* |
- * Copyright (C) 2013 Google, Inc. All rights reserved. |
+ * Copyright (C) 2016 Google, Inc. All rights reserved. |
Timothy Loh
2016/01/25 00:40:00
short license?
nainar
2016/01/25 03:48:24
Done.
|
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
@@ -23,55 +23,48 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef FetchInitiatorInfo_h |
-#define FetchInitiatorInfo_h |
+#include "core/frame/Deprecation.h" |
-#include "wtf/Allocator.h" |
-#include "wtf/text/AtomicString.h" |
-#include "wtf/text/TextPosition.h" |
+#include "core/frame/FrameConsole.h" |
+#include "core/frame/FrameHost.h" |
+#include "core/frame/LocalFrame.h" |
+#include "core/frame/UseCounter.h" |
+#include "core/inspector/ConsoleMessage.h" |
namespace blink { |
-struct FetchInitiatorInfo { |
- DISALLOW_NEW(); |
- FetchInitiatorInfo() |
- : name() |
- , position(TextPosition::belowRangePosition()) |
- , startTime(0.0) |
- { |
- } |
+Deprecation::Deprecation() |
+{ |
+ m_CSSPropertyDeprecationBits.ensureSize(lastUnresolvedCSSProperty + 1); |
+ m_CSSPropertyDeprecationBits.clearAll(); |
+} |
- // When adding members, CrossThreadFetchInitiatorInfoData should be |
- // updated. |
- AtomicString name; |
- TextPosition position; |
- double startTime; |
-}; |
+Deprecation::~Deprecation() |
+{ |
+ m_CSSPropertyDeprecationBits.clearAll(); |
+} |
-// Encode AtomicString as String to cross threads. |
-struct CrossThreadFetchInitiatorInfoData { |
- DISALLOW_NEW(); |
- explicit CrossThreadFetchInitiatorInfoData(const FetchInitiatorInfo& info) |
- : name(info.name.string().isolatedCopy()) |
- , position(info.position) |
- , startTime(info.startTime) |
- { |
- } |
+void Deprecation::showConsoleWarning(const LocalFrame* frame, CSSPropertyID propertyID) |
+{ |
+ FrameHost* host = frame ? frame->host() : nullptr; |
+ if (!frame && frame->host() && !host->deprecation().isSuppressed(propertyID)) |
Timothy Loh
2016/01/25 00:40:00
this condition makes no sense :/
alancutter (OOO until 2018)
2016/01/25 03:13:36
I think you want:
if (!host || host->deprecation(
nainar
2016/01/25 03:48:24
Fixed.
|
+ return; |
- operator FetchInitiatorInfo() const |
- { |
- FetchInitiatorInfo info; |
- info.name = AtomicString(name); |
- info.position = position; |
- info.startTime = startTime; |
- return info; |
+ String message = deprecationMessage(propertyID); |
+ if (!message.isEmpty()) { |
+ host->deprecation().suppress(propertyID); |
+ frame->console().addMessage(ConsoleMessage::create(DeprecationMessageSource, WarningMessageLevel, message)); |
} |
+} |
- String name; |
- TextPosition position; |
- double startTime; |
-}; |
+String Deprecation::deprecationMessage(CSSPropertyID cssPropertyID) |
+{ |
+ switch (cssPropertyID) { |
+ case CSSPropertyWebkitBackgroundComposite: |
+ return UseCounter::willBeRemoved("'-webkit-background-composite'", 51, "6607299456008192"); |
+ default: |
+ return emptyString(); |
+ } |
+} |
} // namespace blink |
- |
-#endif |