| 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 Headers_h | 5 #ifndef Headers_h |
| 6 #define Headers_h | 6 #define Headers_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
| 9 #include "modules/serviceworkers/FetchHeaderList.h" | 9 #include "modules/serviceworkers/FetchHeaderList.h" |
| 10 #include "wtf/Forward.h" | 10 #include "wtf/Forward.h" |
| 11 #include "wtf/PassOwnPtr.h" | 11 #include "wtf/PassOwnPtr.h" |
| 12 #include "wtf/RefCounted.h" | 12 #include "wtf/RefCounted.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 class Dictionary; | 16 class Dictionary; |
| 17 class ExceptionState; | 17 class ExceptionState; |
| 18 class HeadersForEachCallback; | 18 class HeadersForEachCallback; |
| 19 class ScriptValue; | 19 class ScriptValue; |
| 20 | 20 |
| 21 // http://fetch.spec.whatwg.org/#headers-class | 21 // http://fetch.spec.whatwg.org/#headers-class |
| 22 class Headers FINAL : public RefCountedWillBeGarbageCollected<Headers>, public S
criptWrappable { | 22 class Headers FINAL : public RefCountedWillBeGarbageCollected<Headers>, public S
criptWrappable { |
| 23 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(Headers); | 23 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(Headers); |
| 24 DEFINE_WRAPPERTYPEINFO(); |
| 24 public: | 25 public: |
| 25 enum Guard { ImmutableGuard, RequestGuard, RequestNoCORSGuard, ResponseGuard
, NoneGuard }; | 26 enum Guard { ImmutableGuard, RequestGuard, RequestNoCORSGuard, ResponseGuard
, NoneGuard }; |
| 26 | 27 |
| 27 static PassRefPtrWillBeRawPtr<Headers> create(); | 28 static PassRefPtrWillBeRawPtr<Headers> create(); |
| 28 static PassRefPtrWillBeRawPtr<Headers> create(ExceptionState&); | 29 static PassRefPtrWillBeRawPtr<Headers> create(ExceptionState&); |
| 29 static PassRefPtrWillBeRawPtr<Headers> create(const Headers*, ExceptionState
&); | 30 static PassRefPtrWillBeRawPtr<Headers> create(const Headers*, ExceptionState
&); |
| 30 static PassRefPtrWillBeRawPtr<Headers> create(const Dictionary&, ExceptionSt
ate&); | 31 static PassRefPtrWillBeRawPtr<Headers> create(const Dictionary&, ExceptionSt
ate&); |
| 31 | 32 |
| 32 // Shares the FetchHeaderList. Called when creating a Request or Response. | 33 // Shares the FetchHeaderList. Called when creating a Request or Response. |
| 33 static PassRefPtrWillBeRawPtr<Headers> create(FetchHeaderList*); | 34 static PassRefPtrWillBeRawPtr<Headers> create(FetchHeaderList*); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 60 explicit Headers(FetchHeaderList*); | 61 explicit Headers(FetchHeaderList*); |
| 61 void forEachInternal(PassOwnPtrWillBeRawPtr<HeadersForEachCallback>, const S
criptValue*); | 62 void forEachInternal(PassOwnPtrWillBeRawPtr<HeadersForEachCallback>, const S
criptValue*); |
| 62 | 63 |
| 63 RefPtrWillBeMember<FetchHeaderList> m_headerList; | 64 RefPtrWillBeMember<FetchHeaderList> m_headerList; |
| 64 Guard m_guard; | 65 Guard m_guard; |
| 65 }; | 66 }; |
| 66 | 67 |
| 67 } // namespace blink | 68 } // namespace blink |
| 68 | 69 |
| 69 #endif // Headers_h | 70 #endif // Headers_h |
| OLD | NEW |