 Chromium Code Reviews
 Chromium Code Reviews Issue 2660663002:
  [ES6 Modules] Introduce ModuleScriptFetchRequest  (Closed)
    
  
    Issue 2660663002:
  [ES6 Modules] Introduce ModuleScriptFetchRequest  (Closed) 
  | Index: third_party/WebKit/Source/core/loader/modulescript/ModuleScriptFetchRequest.h | 
| diff --git a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptFetchRequest.h b/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptFetchRequest.h | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..2f9aac5ff72528983d7f1f58433d201d06ee6b50 | 
| --- /dev/null | 
| +++ b/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptFetchRequest.h | 
| @@ -0,0 +1,64 @@ | 
| +// 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 ModuleScriptFetchRequest_h | 
| +#define ModuleScriptFetchRequest_h | 
| + | 
| +#include "platform/loader/fetch/ResourceLoaderOptions.h" | 
| +#include "platform/weborigin/KURL.h" | 
| +#include "platform/weborigin/Referrer.h" | 
| +#include "public/platform/WebURLRequest.h" | 
| +#include "wtf/text/WTFString.h" | 
| + | 
| +namespace blink { | 
| + | 
| +// A ModuleScriptFetchRequest is a "parameter object" for | 
| +// Modulator::fetch{,New}SingleModule to avoid the methods having too many | 
| +// arguments. | 
| 
hiroshige
2017/01/27 20:47:08
Adding the part of CL description:
 
kouhei (in TOK)
2017/01/30 17:11:04
Done.
 | 
| +class ModuleScriptFetchRequest { | 
| 
hiroshige
2017/01/27 20:47:08
If this should work only as a parameter object, ca
 
hiroshige
2017/01/27 20:47:09
Add final.
 
kouhei (in TOK)
2017/01/30 17:11:04
Done.
 
kouhei (in TOK)
2017/01/30 17:11:04
Done.
 | 
| + public: | 
| + ModuleScriptFetchRequest(const KURL& url, | 
| + const String& nonce, | 
| + ParserDisposition parserState, | 
| + WebURLRequest::FetchCredentialsMode credentialsMode) | 
| + : ModuleScriptFetchRequest(url, | 
| + nonce, | 
| + parserState, | 
| + credentialsMode, | 
| + nullAtom) {} | 
| + ~ModuleScriptFetchRequest() = default; | 
| + | 
| + const KURL& url() const { return m_url; } | 
| + const String& nonce() const { return m_nonce; } | 
| + const ParserDisposition& parserState() const { return m_parserState; } | 
| + WebURLRequest::FetchCredentialsMode credentialsMode() const { | 
| + return m_credentialsMode; | 
| + } | 
| + const AtomicString& referrer() const { return m_referrer; } | 
| + | 
| + private: | 
| + // Referrer is set only for internal module script fetch algorithms triggered | 
| + // from ModuleTreeLinker to fetch descendant module scripts. | 
| + friend class ModuleTreeLinker; | 
| + ModuleScriptFetchRequest(const KURL& url, | 
| + const String& nonce, | 
| + ParserDisposition parserState, | 
| + WebURLRequest::FetchCredentialsMode credentialsMode, | 
| + const String& referrer) | 
| + : m_url(url), | 
| + m_nonce(nonce), | 
| + m_parserState(parserState), | 
| + m_credentialsMode(credentialsMode), | 
| + m_referrer(referrer) {} | 
| + | 
| + KURL m_url; | 
| 
hiroshige
2017/01/27 20:47:09
Can we specify |const| for these members?
 
kouhei (in TOK)
2017/01/30 17:11:04
Done.
 | 
| + String m_nonce; | 
| + ParserDisposition m_parserState; | 
| + WebURLRequest::FetchCredentialsMode m_credentialsMode; | 
| + AtomicString m_referrer; | 
| +}; | 
| + | 
| +} // namespace blink | 
| + | 
| +#endif |