Chromium Code Reviews| Index: third_party/WebKit/Source/core/frame/Deprecation.h |
| diff --git a/third_party/WebKit/Source/core/fetch/FetchInitiatorInfo.h b/third_party/WebKit/Source/core/frame/Deprecation.h |
| similarity index 54% |
| copy from third_party/WebKit/Source/core/fetch/FetchInitiatorInfo.h |
| copy to third_party/WebKit/Source/core/frame/Deprecation.h |
| index a9490a48debeacfcc707d7db9ec86653070981b3..cf846038113dcd37d5fce775037df093f24dfa24 100644 |
| --- a/third_party/WebKit/Source/core/fetch/FetchInitiatorInfo.h |
| +++ b/third_party/WebKit/Source/core/frame/Deprecation.h |
| @@ -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,49 @@ |
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| */ |
| -#ifndef FetchInitiatorInfo_h |
| -#define FetchInitiatorInfo_h |
| +#ifndef Deprecation_h |
| +#define Deprecation_h |
| -#include "wtf/Allocator.h" |
| -#include "wtf/text/AtomicString.h" |
| -#include "wtf/text/TextPosition.h" |
| +#include "core/CSSPropertyNames.h" |
| +#include "core/CoreExport.h" |
| +#include "wtf/BitVector.h" |
| +#include "wtf/Noncopyable.h" |
| +#include "wtf/OwnPtr.h" |
| +#include "wtf/PassOwnPtr.h" |
| +#include "wtf/text/WTFString.h" |
| +#include <v8.h> |
| namespace blink { |
| -struct FetchInitiatorInfo { |
| - DISALLOW_NEW(); |
| - FetchInitiatorInfo() |
| - : name() |
| - , position(TextPosition::belowRangePosition()) |
| - , startTime(0.0) |
| - { |
| - } |
| +class LocalFrame; |
| - // When adding members, CrossThreadFetchInitiatorInfoData should be |
| - // updated. |
| - AtomicString name; |
| - TextPosition position; |
| - double startTime; |
| -}; |
| - |
| -// Encode AtomicString as String to cross threads. |
| -struct CrossThreadFetchInitiatorInfoData { |
| +class Deprecation { |
| DISALLOW_NEW(); |
| - explicit CrossThreadFetchInitiatorInfoData(const FetchInitiatorInfo& info) |
| - : name(info.name.string().isolatedCopy()) |
| - , position(info.position) |
| - , startTime(info.startTime) |
| + WTF_MAKE_NONCOPYABLE(Deprecation); |
| +public: |
| + Deprecation(); |
| + ~Deprecation(); |
| + |
| + void suppress(CSSPropertyID propertyID) |
| { |
| + ASSERT(propertyID >= firstCSSProperty); |
| + ASSERT(propertyID <= lastUnresolvedCSSProperty); |
| + m_CSSPropertyDeprecationBits.quickSet(propertyID); |
| } |
| - |
| - operator FetchInitiatorInfo() const |
| + bool isSuppressed(CSSPropertyID propertyID) |
| { |
| - FetchInitiatorInfo info; |
| - info.name = AtomicString(name); |
| - info.position = position; |
| - info.startTime = startTime; |
| - return info; |
| + ASSERT(propertyID >= firstCSSProperty); |
| + ASSERT(propertyID <= lastUnresolvedCSSProperty); |
| + return m_CSSPropertyDeprecationBits.quickGet(propertyID); |
| } |
| + static void showDeprecationWarning(const LocalFrame*, CSSPropertyID); |
|
alancutter (OOO until 2018)
2016/01/21 02:45:57
showConsoleWarning()?
nainar
2016/01/21 02:55:47
Done.
|
| + // CSSPropertyIDs that aren't deprecated return an empty string. |
| + static String deprecationMessage(CSSPropertyID); |
| - String name; |
| - TextPosition position; |
| - double startTime; |
| +protected: |
| + BitVector m_CSSPropertyDeprecationBits; |
| }; |
| } // namespace blink |
| -#endif |
| +#endif // Deprecation_h |