Chromium Code Reviews| 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..f23a9e66001137526fce68d98dc2bc8d0de2c39f 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. |
| * |
| * Redistribution and use in source and binary forms, with or without |
| * modification, are permitted provided that the following conditions |
| @@ -23,55 +23,50 @@ |
| * 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::showDeprecationWarning(const LocalFrame* frame, CSSPropertyID propertyID) |
| +{ |
| + if (!frame) |
| + return; |
| + FrameHost* host = frame->host(); |
| + if (!host) |
| + return; |
|
alancutter (OOO until 2018)
2016/01/21 02:45:57
These ifs can be combined, I'd put isSuppressed()
nainar
2016/01/21 02:55:47
Done.
|
| - operator FetchInitiatorInfo() const |
| - { |
| - FetchInitiatorInfo info; |
| - info.name = AtomicString(name); |
| - info.position = position; |
| - info.startTime = startTime; |
| - return info; |
| + String message = deprecationMessage(propertyID); |
| + if (!host->deprecation().isSuppressed(propertyID) && !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 |