Chromium Code Reviews| Index: third_party/WebKit/Source/core/loader/resource/ScriptResourceData.h |
| diff --git a/third_party/WebKit/Source/core/loader/resource/ScriptResourceData.h b/third_party/WebKit/Source/core/loader/resource/ScriptResourceData.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..484836133ce514c0f2e8d280ad9c18ce79d23c5c |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/loader/resource/ScriptResourceData.h |
| @@ -0,0 +1,59 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef ScriptResourceData_h |
| +#define ScriptResourceData_h |
| + |
| +#include "core/CoreExport.h" |
| +#include "platform/heap/Handle.h" |
| +#include "platform/loader/fetch/AccessControlStatus.h" |
| +#include "platform/loader/fetch/CachedMetadataHandler.h" |
| +#include "platform/loader/fetch/ResourceLoaderOptions.h" |
| +#include "platform/loader/fetch/ResourceResponse.h" |
| +#include "platform/weborigin/KURL.h" |
| +#include "platform/wtf/text/WTFString.h" |
| + |
| +namespace blink { |
| + |
| +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
|
| + : public GarbageCollectedFinalized<ScriptResourceData> { |
| + public: |
| + ScriptResourceData(const KURL& url, |
| + const ResourceResponse& response, |
| + bool error_occurred, |
| + const AtomicString& source_text, |
| + CachedMetadataHandler* cache_handler, |
| + StoredCredentials stored_credentials) |
| + : url_(url), |
| + response_(response), |
| + error_occurred_(error_occurred), |
| + source_text_(source_text), |
| + cache_handler_(cache_handler), |
| + stored_credentials_(stored_credentials) {} |
| + |
| + DEFINE_INLINE_TRACE() { visitor->Trace(cache_handler_); } |
| + |
| + const KURL& Url() const { return url_; } |
| + const ResourceResponse GetResponse() const { return response_; } |
| + bool ErrorOccurred() const { return error_occurred_; } |
| + const String& SourceText() const { return source_text_; } |
| + CachedMetadataHandler* CacheHandler() const { return cache_handler_; } |
| + StoredCredentials GetStoredCredentials() const { return stored_credentials_; } |
| + |
| + AccessControlStatus CalculateAccessControlStatus(const SecurityOrigin*) const; |
| + |
| + static bool MimeTypeAllowedByNosniff(const ResourceResponse&); |
| + |
| + private: |
| + const KURL url_; |
| + const ResourceResponse response_; |
| + const bool error_occurred_; |
| + const AtomicString source_text_; |
| + const Member<CachedMetadataHandler> cache_handler_; |
| + const StoredCredentials stored_credentials_; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif |