| 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 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 |
| 11 * notice, this list of conditions and the following disclaimer in the | 11 * notice, this list of conditions and the following disclaimer in the |
| 12 * documentation and/or other materials provided with the distribution. | 12 * documentation and/or other materials provided with the distribution. |
| 13 * | 13 * |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 public: | 46 public: |
| 47 explicit WorkerScriptLoader(ResourceRequestBase::TargetType); | 47 explicit WorkerScriptLoader(ResourceRequestBase::TargetType); |
| 48 | 48 |
| 49 void loadSynchronously(ScriptExecutionContext*, const KURL&, CrossOrigin
RequestPolicy); | 49 void loadSynchronously(ScriptExecutionContext*, const KURL&, CrossOrigin
RequestPolicy); |
| 50 void loadAsynchronously(ScriptExecutionContext*, const KURL&, CrossOrigi
nRequestPolicy, WorkerScriptLoaderClient*); | 50 void loadAsynchronously(ScriptExecutionContext*, const KURL&, CrossOrigi
nRequestPolicy, WorkerScriptLoaderClient*); |
| 51 | 51 |
| 52 void notifyError(); | 52 void notifyError(); |
| 53 | 53 |
| 54 const String& script() const { return m_script; } | 54 const String& script() const { return m_script; } |
| 55 const KURL& url() const { return m_url; } | 55 const KURL& url() const { return m_url; } |
| 56 const KURL& responseURL() const; |
| 56 bool failed() const { return m_failed; } | 57 bool failed() const { return m_failed; } |
| 57 unsigned long identifier() const { return m_identifier; } | 58 unsigned long identifier() const { return m_identifier; } |
| 58 | 59 |
| 59 virtual void didReceiveResponse(const ResourceResponse&); | 60 virtual void didReceiveResponse(const ResourceResponse&); |
| 60 virtual void didReceiveData(const char* data, int lengthReceived); | 61 virtual void didReceiveData(const char* data, int lengthReceived); |
| 61 virtual void didFinishLoading(unsigned long identifier); | 62 virtual void didFinishLoading(unsigned long identifier); |
| 62 virtual void didFail(const ResourceError&); | 63 virtual void didFail(const ResourceError&); |
| 63 virtual void didFailRedirectCheck(); | 64 virtual void didFailRedirectCheck(); |
| 64 virtual void didReceiveAuthenticationCancellation(const ResourceResponse
&); | 65 virtual void didReceiveAuthenticationCancellation(const ResourceResponse
&); |
| 65 | 66 |
| 66 private: | 67 private: |
| 67 PassOwnPtr<ResourceRequest> createResourceRequest(); | 68 PassOwnPtr<ResourceRequest> createResourceRequest(); |
| 68 void notifyFinished(); | 69 void notifyFinished(); |
| 69 | 70 |
| 70 WorkerScriptLoaderClient* m_client; | 71 WorkerScriptLoaderClient* m_client; |
| 71 RefPtr<ThreadableLoader> m_threadableLoader; | 72 RefPtr<ThreadableLoader> m_threadableLoader; |
| 72 String m_responseEncoding; | 73 String m_responseEncoding; |
| 73 RefPtr<TextResourceDecoder> m_decoder; | 74 RefPtr<TextResourceDecoder> m_decoder; |
| 74 String m_script; | 75 String m_script; |
| 75 KURL m_url; | 76 KURL m_url; |
| 77 KURL m_responseURL; |
| 76 bool m_failed; | 78 bool m_failed; |
| 77 unsigned long m_identifier; | 79 unsigned long m_identifier; |
| 78 ResourceRequestBase::TargetType m_targetType; | 80 ResourceRequestBase::TargetType m_targetType; |
| 79 }; | 81 }; |
| 80 | 82 |
| 81 } // namespace WebCore | 83 } // namespace WebCore |
| 82 | 84 |
| 83 #endif // ENABLE(WORKERS) | 85 #endif // ENABLE(WORKERS) |
| 84 | 86 |
| 85 #endif // WorkerScriptLoader_h | 87 #endif // WorkerScriptLoader_h |
| OLD | NEW |