OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2013 Google Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 } | 46 } |
47 | 47 |
48 bool isSafeToSendToAnotherThread() const; | 48 bool isSafeToSendToAnotherThread() const; |
49 | 49 |
50 FetchRequest resourceRequest(Document*); | 50 FetchRequest resourceRequest(Document*); |
51 | 51 |
52 const String& charset() const { return m_charset; } | 52 const String& charset() const { return m_charset; } |
53 const String& media() const { return m_mediaAttribute; } | 53 const String& media() const { return m_mediaAttribute; } |
54 double discoveryTime() const { return m_discoveryTime; } | 54 double discoveryTime() const { return m_discoveryTime; } |
55 void setCharset(const String& charset) { m_charset = charset.isolatedCopy();
} | 55 void setCharset(const String& charset) { m_charset = charset.isolatedCopy();
} |
56 void setCrossOriginModeAllowsCookies(bool allowsCookies) { m_crossOriginMode
AllowsCookies = allowsCookies; } | 56 void setCrossOriginEnabled(StoredCredentials allowCredentials) |
| 57 { |
| 58 m_isCORSEnabled = true; |
| 59 m_allowCredentials = allowCredentials; |
| 60 } |
| 61 |
57 Resource::Type resourceType() const { return m_resourceType; } | 62 Resource::Type resourceType() const { return m_resourceType; } |
58 | 63 |
59 private: | 64 private: |
60 PreloadRequest(const String& initiatorName, const TextPosition& initiatorPos
ition, const String& resourceURL, const KURL& baseURL, Resource::Type resourceTy
pe, const String& mediaAttribute) | 65 PreloadRequest(const String& initiatorName, const TextPosition& initiatorPos
ition, const String& resourceURL, const KURL& baseURL, Resource::Type resourceTy
pe, const String& mediaAttribute) |
61 : m_initiatorName(initiatorName) | 66 : m_initiatorName(initiatorName) |
62 , m_initiatorPosition(initiatorPosition) | 67 , m_initiatorPosition(initiatorPosition) |
63 , m_resourceURL(resourceURL.isolatedCopy()) | 68 , m_resourceURL(resourceURL.isolatedCopy()) |
64 , m_baseURL(baseURL.copy()) | 69 , m_baseURL(baseURL.copy()) |
65 , m_resourceType(resourceType) | 70 , m_resourceType(resourceType) |
66 , m_mediaAttribute(mediaAttribute.isolatedCopy()) | 71 , m_mediaAttribute(mediaAttribute.isolatedCopy()) |
67 , m_crossOriginModeAllowsCookies(false) | 72 , m_isCORSEnabled(false) |
| 73 , m_allowCredentials(DoNotAllowStoredCredentials) |
68 , m_discoveryTime(monotonicallyIncreasingTime()) | 74 , m_discoveryTime(monotonicallyIncreasingTime()) |
69 { | 75 { |
70 } | 76 } |
71 | 77 |
72 KURL completeURL(Document*); | 78 KURL completeURL(Document*); |
73 | 79 |
74 String m_initiatorName; | 80 String m_initiatorName; |
75 TextPosition m_initiatorPosition; | 81 TextPosition m_initiatorPosition; |
76 String m_resourceURL; | 82 String m_resourceURL; |
77 KURL m_baseURL; | 83 KURL m_baseURL; |
78 String m_charset; | 84 String m_charset; |
79 Resource::Type m_resourceType; | 85 Resource::Type m_resourceType; |
80 String m_mediaAttribute; | 86 String m_mediaAttribute; |
81 bool m_crossOriginModeAllowsCookies; | 87 bool m_isCORSEnabled; |
| 88 StoredCredentials m_allowCredentials; |
82 double m_discoveryTime; | 89 double m_discoveryTime; |
83 }; | 90 }; |
84 | 91 |
85 typedef Vector<OwnPtr<PreloadRequest> > PreloadRequestStream; | 92 typedef Vector<OwnPtr<PreloadRequest> > PreloadRequestStream; |
86 | 93 |
87 class HTMLResourcePreloader { | 94 class HTMLResourcePreloader { |
88 WTF_MAKE_NONCOPYABLE(HTMLResourcePreloader); WTF_MAKE_FAST_ALLOCATED; | 95 WTF_MAKE_NONCOPYABLE(HTMLResourcePreloader); WTF_MAKE_FAST_ALLOCATED; |
89 public: | 96 public: |
90 explicit HTMLResourcePreloader(Document* document) | 97 explicit HTMLResourcePreloader(Document* document) |
91 : m_document(document) | 98 : m_document(document) |
92 { | 99 { |
93 } | 100 } |
94 | 101 |
95 void takeAndPreload(PreloadRequestStream&); | 102 void takeAndPreload(PreloadRequestStream&); |
96 void preload(PassOwnPtr<PreloadRequest>); | 103 void preload(PassOwnPtr<PreloadRequest>); |
97 | 104 |
98 private: | 105 private: |
99 Document* m_document; | 106 Document* m_document; |
100 }; | 107 }; |
101 | 108 |
102 } | 109 } |
103 | 110 |
104 #endif | 111 #endif |
OLD | NEW |