OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef ScriptResourceData_h | |
6 #define ScriptResourceData_h | |
7 | |
8 #include "core/CoreExport.h" | |
9 #include "platform/heap/Handle.h" | |
10 #include "platform/loader/fetch/AccessControlStatus.h" | |
11 #include "platform/loader/fetch/CachedMetadataHandler.h" | |
12 #include "platform/loader/fetch/ResourceLoaderOptions.h" | |
13 #include "platform/loader/fetch/ResourceResponse.h" | |
14 #include "platform/weborigin/KURL.h" | |
15 #include "platform/wtf/text/WTFString.h" | |
16 | |
17 namespace blink { | |
18 | |
19 class CORE_EXPORT ScriptResourceData final | |
kouhei (in TOK)
2017/05/15 20:56:32
Please write a class comment.
kinuko
2017/05/18 05:43:30
+1, also would be nice to explicitly note that thi
| |
20 : public GarbageCollectedFinalized<ScriptResourceData> { | |
21 public: | |
22 ScriptResourceData(const KURL& url, | |
23 const ResourceResponse& response, | |
24 bool error_occurred, | |
25 const AtomicString& source_text, | |
26 CachedMetadataHandler* cache_handler, | |
27 StoredCredentials stored_credentials) | |
28 : url_(url), | |
29 response_(response), | |
30 error_occurred_(error_occurred), | |
31 source_text_(source_text), | |
32 cache_handler_(cache_handler), | |
33 stored_credentials_(stored_credentials) {} | |
34 | |
35 DEFINE_INLINE_TRACE() { visitor->Trace(cache_handler_); } | |
36 | |
37 const KURL& Url() const { return url_; } | |
38 const ResourceResponse GetResponse() const { return response_; } | |
39 bool ErrorOccurred() const { return error_occurred_; } | |
40 const String& SourceText() const { return source_text_; } | |
41 CachedMetadataHandler* CacheHandler() const { return cache_handler_; } | |
42 StoredCredentials GetStoredCredentials() const { return stored_credentials_; } | |
43 | |
44 AccessControlStatus CalculateAccessControlStatus(const SecurityOrigin*) const; | |
45 | |
46 static bool MimeTypeAllowedByNosniff(const ResourceResponse&); | |
47 | |
48 private: | |
49 const KURL url_; | |
50 const ResourceResponse response_; | |
51 const bool error_occurred_; | |
52 const AtomicString source_text_; | |
53 const Member<CachedMetadataHandler> cache_handler_; | |
54 const StoredCredentials stored_credentials_; | |
55 }; | |
56 | |
57 } // namespace blink | |
58 | |
59 #endif | |
OLD | NEW |