| OLD | NEW | 
|   1 // Copyright 2014 The Chromium Authors. All rights reserved. |   1 // Copyright 2014 The Chromium Authors. All rights reserved. | 
|   2 // Use of this source code is governed by a BSD-style license that can be |   2 // Use of this source code is governed by a BSD-style license that can be | 
|   3 // found in the LICENSE file. |   3 // found in the LICENSE file. | 
|   4  |   4  | 
|   5 #ifndef CSPDirective_h |   5 #ifndef CSPDirective_h | 
|   6 #define CSPDirective_h |   6 #define CSPDirective_h | 
|   7  |   7  | 
|   8 #include "platform/heap/Handle.h" |   8 #include "platform/heap/Handle.h" | 
|   9 #include "wtf/text/WTFString.h" |   9 #include "wtf/text/WTFString.h" | 
|  10  |  10  | 
|  11 namespace blink { |  11 namespace blink { | 
|  12  |  12  | 
|  13 class ContentSecurityPolicy; |  13 class ContentSecurityPolicy; | 
|  14  |  14  | 
|  15 class CSPDirective : public NoBaseWillBeGarbageCollectedFinalized<CSPDirective> 
    { |  15 class CSPDirective : public GarbageCollectedFinalized<CSPDirective> { | 
|  16     USING_FAST_MALLOC_WILL_BE_REMOVED(CSPDirective); |  | 
|  17     WTF_MAKE_NONCOPYABLE(CSPDirective); |  16     WTF_MAKE_NONCOPYABLE(CSPDirective); | 
|  18 public: |  17 public: | 
|  19     CSPDirective(const String& name, const String& value, ContentSecurityPolicy*
     policy) |  18     CSPDirective(const String& name, const String& value, ContentSecurityPolicy*
     policy) | 
|  20         : m_name(name) |  19         : m_name(name) | 
|  21         , m_text(name + ' ' + value) |  20         , m_text(name + ' ' + value) | 
|  22         , m_policy(policy) |  21         , m_policy(policy) | 
|  23     { |  22     { | 
|  24     } |  23     } | 
|  25     virtual ~CSPDirective() { } |  24     virtual ~CSPDirective() { } | 
|  26     DEFINE_INLINE_VIRTUAL_TRACE() { visitor->trace(m_policy); } |  25     DEFINE_INLINE_VIRTUAL_TRACE() { visitor->trace(m_policy); } | 
|  27  |  26  | 
|  28     const String& text() const { return m_text; } |  27     const String& text() const { return m_text; } | 
|  29  |  28  | 
|  30 protected: |  29 protected: | 
|  31     ContentSecurityPolicy* policy() const { return m_policy; } |  30     ContentSecurityPolicy* policy() const { return m_policy; } | 
|  32  |  31  | 
|  33 private: |  32 private: | 
|  34     String m_name; |  33     String m_name; | 
|  35     String m_text; |  34     String m_text; | 
|  36     RawPtrWillBeMember<ContentSecurityPolicy> m_policy; |  35     Member<ContentSecurityPolicy> m_policy; | 
|  37 }; |  36 }; | 
|  38  |  37  | 
|  39 } // namespace blink |  38 } // namespace blink | 
|  40  |  39  | 
|  41 #endif |  40 #endif | 
| OLD | NEW |