Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: third_party/WebKit/Source/core/loader/resource/ScriptResourceData.h

Issue 2724673002: [WIP] Introduce ScriptResourceData
Patch Set: Compile fix Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 #include "public/platform/CORSStatus.h"
17 #include "public/platform/WebURLRequest.h"
18
19 namespace blink {
20
21 class CORE_EXPORT ScriptResourceData final
22 : public GarbageCollectedFinalized<ScriptResourceData> {
23 public:
24 ScriptResourceData(const KURL& url,
25 WebURLRequest::FetchCredentialsMode fetch_credentials_mode,
26 const ResourceResponse& response,
27 bool error_occurred,
28 const AtomicString& source_text,
29 CachedMetadataHandler* cache_handler,
30 CORSStatus cors_status)
31 : url_(url),
32 fetch_credentials_mode_(fetch_credentials_mode),
33 response_(response),
34 error_occurred_(error_occurred),
35 source_text_(source_text),
36 cache_handler_(cache_handler),
37 cors_status_(cors_status) {}
38
39 DEFINE_INLINE_TRACE() { visitor->Trace(cache_handler_); }
40
41 const KURL& Url() const { return url_; }
42 const ResourceResponse GetResponse() const { return response_; }
43 bool ErrorOccurred() const { return error_occurred_; }
44 const String& SourceText() const { return source_text_; }
45 CachedMetadataHandler* CacheHandler() const { return cache_handler_; }
46 WebURLRequest::FetchCredentialsMode GetFetchCredentialsMode() const {
47 return fetch_credentials_mode_;
48 }
49
50 AccessControlStatus CalculateAccessControlStatus() const;
51
52 static bool MimeTypeAllowedByNosniff(const ResourceResponse&);
53
54 private:
55 const KURL url_;
56 const WebURLRequest::FetchCredentialsMode fetch_credentials_mode_;
57
58 const ResourceResponse response_;
59
60 const bool error_occurred_;
61
62 const AtomicString source_text_;
63
64 const Member<CachedMetadataHandler> cache_handler_;
65
66 const CORSStatus cors_status_;
67 };
68
69 } // namespace blink
70
71 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698