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 ModuleScriptFetchRequest_h | |
6 #define ModuleScriptFetchRequest_h | |
7 | |
8 #include "platform/loader/fetch/ResourceLoaderOptions.h" | |
9 #include "platform/weborigin/KURL.h" | |
10 #include "platform/weborigin/Referrer.h" | |
11 #include "public/platform/WebURLRequest.h" | |
12 #include "wtf/text/WTFString.h" | |
13 | |
14 namespace blink { | |
15 | |
16 // A ModuleScriptFetchRequest is a "parameter object" for | |
17 // Modulator::fetch{,New}SingleModule to avoid the methods having too many | |
18 // arguments. | |
hiroshige
2017/01/27 20:47:08
Adding the part of CL description:
kouhei (in TOK)
2017/01/30 17:11:04
Done.
| |
19 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.
| |
20 public: | |
21 ModuleScriptFetchRequest(const KURL& url, | |
22 const String& nonce, | |
23 ParserDisposition parserState, | |
24 WebURLRequest::FetchCredentialsMode credentialsMode) | |
25 : ModuleScriptFetchRequest(url, | |
26 nonce, | |
27 parserState, | |
28 credentialsMode, | |
29 nullAtom) {} | |
30 ~ModuleScriptFetchRequest() = default; | |
31 | |
32 const KURL& url() const { return m_url; } | |
33 const String& nonce() const { return m_nonce; } | |
34 const ParserDisposition& parserState() const { return m_parserState; } | |
35 WebURLRequest::FetchCredentialsMode credentialsMode() const { | |
36 return m_credentialsMode; | |
37 } | |
38 const AtomicString& referrer() const { return m_referrer; } | |
39 | |
40 private: | |
41 // Referrer is set only for internal module script fetch algorithms triggered | |
42 // from ModuleTreeLinker to fetch descendant module scripts. | |
43 friend class ModuleTreeLinker; | |
44 ModuleScriptFetchRequest(const KURL& url, | |
45 const String& nonce, | |
46 ParserDisposition parserState, | |
47 WebURLRequest::FetchCredentialsMode credentialsMode, | |
48 const String& referrer) | |
49 : m_url(url), | |
50 m_nonce(nonce), | |
51 m_parserState(parserState), | |
52 m_credentialsMode(credentialsMode), | |
53 m_referrer(referrer) {} | |
54 | |
55 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.
| |
56 String m_nonce; | |
57 ParserDisposition m_parserState; | |
58 WebURLRequest::FetchCredentialsMode m_credentialsMode; | |
59 AtomicString m_referrer; | |
60 }; | |
61 | |
62 } // namespace blink | |
63 | |
64 #endif | |
OLD | NEW |