OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2009 Apple Inc. All Rights Reserved. |
3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 27 matching lines...) Expand all Loading... |
38 #include "wtf/text/StringBuilder.h" | 38 #include "wtf/text/StringBuilder.h" |
39 | 39 |
40 namespace WebCore { | 40 namespace WebCore { |
41 | 41 |
42 class ResourceRequest; | 42 class ResourceRequest; |
43 class ResourceResponse; | 43 class ResourceResponse; |
44 class ExecutionContext; | 44 class ExecutionContext; |
45 class TextResourceDecoder; | 45 class TextResourceDecoder; |
46 class WorkerScriptLoaderClient; | 46 class WorkerScriptLoaderClient; |
47 | 47 |
48 class WorkerScriptLoader : public RefCounted<WorkerScriptLoader>, public Thr
eadableLoaderClient { | 48 class WorkerScriptLoader FINAL : public RefCounted<WorkerScriptLoader>, publ
ic ThreadableLoaderClient { |
49 WTF_MAKE_FAST_ALLOCATED; | 49 WTF_MAKE_FAST_ALLOCATED; |
50 public: | 50 public: |
51 static PassRefPtr<WorkerScriptLoader> create() | 51 static PassRefPtr<WorkerScriptLoader> create() |
52 { | 52 { |
53 return adoptRef(new WorkerScriptLoader()); | 53 return adoptRef(new WorkerScriptLoader()); |
54 } | 54 } |
55 | 55 |
56 void loadSynchronously(ExecutionContext*, const KURL&, CrossOriginReques
tPolicy); | 56 void loadSynchronously(ExecutionContext*, const KURL&, CrossOriginReques
tPolicy); |
57 void loadAsynchronously(ExecutionContext*, const KURL&, CrossOriginReque
stPolicy, WorkerScriptLoaderClient*); | 57 void loadAsynchronously(ExecutionContext*, const KURL&, CrossOriginReque
stPolicy, WorkerScriptLoaderClient*); |
58 | 58 |
(...skipping 16 matching lines...) Expand all Loading... |
75 virtual void didFinishLoading(unsigned long identifier, double) OVERRIDE
; | 75 virtual void didFinishLoading(unsigned long identifier, double) OVERRIDE
; |
76 virtual void didFail(const ResourceError&) OVERRIDE; | 76 virtual void didFail(const ResourceError&) OVERRIDE; |
77 virtual void didFailRedirectCheck() OVERRIDE; | 77 virtual void didFailRedirectCheck() OVERRIDE; |
78 | 78 |
79 void setTargetType(ResourceRequest::TargetType targetType) { m_targetTyp
e = targetType; } | 79 void setTargetType(ResourceRequest::TargetType targetType) { m_targetTyp
e = targetType; } |
80 | 80 |
81 private: | 81 private: |
82 friend class WTF::RefCounted<WorkerScriptLoader>; | 82 friend class WTF::RefCounted<WorkerScriptLoader>; |
83 | 83 |
84 WorkerScriptLoader(); | 84 WorkerScriptLoader(); |
85 ~WorkerScriptLoader(); | 85 virtual ~WorkerScriptLoader(); |
86 | 86 |
87 PassOwnPtr<ResourceRequest> createResourceRequest(); | 87 PassOwnPtr<ResourceRequest> createResourceRequest(); |
88 void notifyFinished(); | 88 void notifyFinished(); |
89 | 89 |
90 WorkerScriptLoaderClient* m_client; | 90 WorkerScriptLoaderClient* m_client; |
91 RefPtr<ThreadableLoader> m_threadableLoader; | 91 RefPtr<ThreadableLoader> m_threadableLoader; |
92 String m_responseEncoding; | 92 String m_responseEncoding; |
93 OwnPtr<TextResourceDecoder> m_decoder; | 93 OwnPtr<TextResourceDecoder> m_decoder; |
94 StringBuilder m_script; | 94 StringBuilder m_script; |
95 KURL m_url; | 95 KURL m_url; |
96 KURL m_responseURL; | 96 KURL m_responseURL; |
97 bool m_failed; | 97 bool m_failed; |
98 unsigned long m_identifier; | 98 unsigned long m_identifier; |
99 bool m_finishing; | 99 bool m_finishing; |
100 ResourceRequest::TargetType m_targetType; | 100 ResourceRequest::TargetType m_targetType; |
101 }; | 101 }; |
102 | 102 |
103 } // namespace WebCore | 103 } // namespace WebCore |
104 | 104 |
105 #endif // WorkerScriptLoader_h | 105 #endif // WorkerScriptLoader_h |
OLD | NEW |