| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 // All executed on the main thread. | 99 // All executed on the main thread. |
| 100 static void mainThreadDestroy(ExecutionContext*, MainThreadBridge*); | 100 static void mainThreadDestroy(ExecutionContext*, MainThreadBridge*); |
| 101 virtual ~MainThreadBridge(); | 101 virtual ~MainThreadBridge(); |
| 102 | 102 |
| 103 static void mainThreadCreateLoader(ExecutionContext*, MainThreadBrid
ge*, PassOwnPtr<CrossThreadResourceRequestData>, ThreadableLoaderOptions, Resour
ceLoaderOptions, const String& outgoingReferrer); | 103 static void mainThreadCreateLoader(ExecutionContext*, MainThreadBrid
ge*, PassOwnPtr<CrossThreadResourceRequestData>, ThreadableLoaderOptions, Resour
ceLoaderOptions, const String& outgoingReferrer); |
| 104 static void mainThreadOverrideTimeout(ExecutionContext*, MainThreadB
ridge*, unsigned long timeoutMilliseconds); | 104 static void mainThreadOverrideTimeout(ExecutionContext*, MainThreadB
ridge*, unsigned long timeoutMilliseconds); |
| 105 static void mainThreadCancel(ExecutionContext*, MainThreadBridge*); | 105 static void mainThreadCancel(ExecutionContext*, MainThreadBridge*); |
| 106 virtual void didSendData(unsigned long long bytesSent, unsigned long
long totalBytesToBeSent) OVERRIDE; | 106 virtual void didSendData(unsigned long long bytesSent, unsigned long
long totalBytesToBeSent) OVERRIDE; |
| 107 virtual void didReceiveResponse(unsigned long identifier, const Reso
urceResponse&) OVERRIDE; | 107 virtual void didReceiveResponse(unsigned long identifier, const Reso
urceResponse&) OVERRIDE; |
| 108 virtual void didReceiveData(const char*, int dataLength) OVERRIDE; | 108 virtual void didReceiveData(const char*, unsigned dataLength) OVERRI
DE; |
| 109 virtual void didDownloadData(int dataLength) OVERRIDE; | 109 virtual void didDownloadData(int dataLength) OVERRIDE; |
| 110 virtual void didReceiveCachedMetadata(const char*, int dataLength) O
VERRIDE; | 110 virtual void didReceiveCachedMetadata(const char*, int dataLength) O
VERRIDE; |
| 111 virtual void didFinishLoading(unsigned long identifier, double finis
hTime) OVERRIDE; | 111 virtual void didFinishLoading(unsigned long identifier, double finis
hTime) OVERRIDE; |
| 112 virtual void didFail(const ResourceError&) OVERRIDE; | 112 virtual void didFail(const ResourceError&) OVERRIDE; |
| 113 virtual void didFailAccessControlCheck(const ResourceError&) OVERRID
E; | 113 virtual void didFailAccessControlCheck(const ResourceError&) OVERRID
E; |
| 114 virtual void didFailRedirectCheck() OVERRIDE; | 114 virtual void didFailRedirectCheck() OVERRIDE; |
| 115 | 115 |
| 116 // Only to be used on the main thread. | 116 // Only to be used on the main thread. |
| 117 RefPtr<ThreadableLoader> m_mainThreadLoader; | 117 RefPtr<ThreadableLoader> m_mainThreadLoader; |
| 118 OwnPtr<ThreadableLoaderClient> m_clientBridge; | 118 OwnPtr<ThreadableLoaderClient> m_clientBridge; |
| 119 | 119 |
| 120 // ThreadableLoaderClientWrapper is to be used on the worker context
thread. | 120 // ThreadableLoaderClientWrapper is to be used on the worker context
thread. |
| 121 // The ref counting is done on either thread. | 121 // The ref counting is done on either thread. |
| 122 RefPtr<ThreadableLoaderClientWrapper> m_workerClientWrapper; | 122 RefPtr<ThreadableLoaderClientWrapper> m_workerClientWrapper; |
| 123 | 123 |
| 124 // Used on the worker context thread. | 124 // Used on the worker context thread. |
| 125 WorkerLoaderProxy& m_loaderProxy; | 125 WorkerLoaderProxy& m_loaderProxy; |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 WorkerThreadableLoader(WorkerGlobalScope&, PassRefPtr<ThreadableLoaderCl
ientWrapper>, PassOwnPtr<ThreadableLoaderClient>, const ResourceRequest&, const
ThreadableLoaderOptions&, const ResourceLoaderOptions&); | 128 WorkerThreadableLoader(WorkerGlobalScope&, PassRefPtr<ThreadableLoaderCl
ientWrapper>, PassOwnPtr<ThreadableLoaderClient>, const ResourceRequest&, const
ThreadableLoaderOptions&, const ResourceLoaderOptions&); |
| 129 | 129 |
| 130 RefPtrWillBePersistent<WorkerGlobalScope> m_workerGlobalScope; | 130 RefPtrWillBePersistent<WorkerGlobalScope> m_workerGlobalScope; |
| 131 RefPtr<ThreadableLoaderClientWrapper> m_workerClientWrapper; | 131 RefPtr<ThreadableLoaderClientWrapper> m_workerClientWrapper; |
| 132 MainThreadBridge& m_bridge; | 132 MainThreadBridge& m_bridge; |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 } // namespace blink | 135 } // namespace blink |
| 136 | 136 |
| 137 #endif // WorkerThreadableLoader_h | 137 #endif // WorkerThreadableLoader_h |
| OLD | NEW |