| 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 29 matching lines...) Expand all Loading... |
| 40 #include "public/platform/WebTraceLocation.h" | 40 #include "public/platform/WebTraceLocation.h" |
| 41 #include "wtf/PassRefPtr.h" | 41 #include "wtf/PassRefPtr.h" |
| 42 #include "wtf/RefPtr.h" | 42 #include "wtf/RefPtr.h" |
| 43 #include "wtf/Threading.h" | 43 #include "wtf/Threading.h" |
| 44 #include "wtf/Vector.h" | 44 #include "wtf/Vector.h" |
| 45 #include "wtf/text/WTFString.h" | 45 #include "wtf/text/WTFString.h" |
| 46 #include <memory> | 46 #include <memory> |
| 47 | 47 |
| 48 namespace blink { | 48 namespace blink { |
| 49 | 49 |
| 50 class ThreadableLoadingContext; |
| 50 class ResourceError; | 51 class ResourceError; |
| 51 class ResourceRequest; | 52 class ResourceRequest; |
| 52 class ResourceResponse; | 53 class ResourceResponse; |
| 53 class WorkerGlobalScope; | 54 class WorkerGlobalScope; |
| 54 class WorkerLoaderProxy; | 55 class WorkerLoaderProxy; |
| 55 struct CrossThreadResourceRequestData; | 56 struct CrossThreadResourceRequestData; |
| 56 struct CrossThreadResourceTimingInfoData; | 57 struct CrossThreadResourceTimingInfoData; |
| 57 | 58 |
| 58 // A WorkerThreadableLoader is a ThreadableLoader implementation intended to | 59 // A WorkerThreadableLoader is a ThreadableLoader implementation intended to |
| 59 // be used in a WebWorker thread. Because Blink's ResourceFetcher and | 60 // be used in a WebWorker thread. Because Blink's ResourceFetcher and |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 void didFailAccessControlCheck(const ResourceError&) override; | 166 void didFailAccessControlCheck(const ResourceError&) override; |
| 166 void didFailRedirectCheck() override; | 167 void didFailRedirectCheck() override; |
| 167 void didReceiveResourceTiming(const ResourceTimingInfo&) override; | 168 void didReceiveResourceTiming(const ResourceTimingInfo&) override; |
| 168 | 169 |
| 169 void contextDestroyed(WorkerThreadLifecycleContext*) override; | 170 void contextDestroyed(WorkerThreadLifecycleContext*) override; |
| 170 | 171 |
| 171 DECLARE_TRACE(); | 172 DECLARE_TRACE(); |
| 172 | 173 |
| 173 private: | 174 private: |
| 174 MainThreadLoaderHolder(TaskForwarder*, WorkerThreadLifecycleContext*); | 175 MainThreadLoaderHolder(TaskForwarder*, WorkerThreadLifecycleContext*); |
| 175 void start(Document&, | 176 void start(ThreadableLoadingContext&, |
| 176 std::unique_ptr<CrossThreadResourceRequestData>, | 177 std::unique_ptr<CrossThreadResourceRequestData>, |
| 177 const ThreadableLoaderOptions&, | 178 const ThreadableLoaderOptions&, |
| 178 const ResourceLoaderOptions&); | 179 const ResourceLoaderOptions&); |
| 179 | 180 |
| 180 Member<TaskForwarder> m_forwarder; | 181 Member<TaskForwarder> m_forwarder; |
| 181 Member<ThreadableLoader> m_mainThreadLoader; | 182 Member<ThreadableLoader> m_mainThreadLoader; |
| 182 | 183 |
| 183 // |*m_workerLoader| lives in the worker thread. | 184 // |*m_workerLoader| lives in the worker thread. |
| 184 CrossThreadWeakPersistent<WorkerThreadableLoader> m_workerLoader; | 185 CrossThreadWeakPersistent<WorkerThreadableLoader> m_workerLoader; |
| 185 }; | 186 }; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 215 ResourceLoaderOptions m_resourceLoaderOptions; | 216 ResourceLoaderOptions m_resourceLoaderOptions; |
| 216 BlockingBehavior m_blockingBehavior; | 217 BlockingBehavior m_blockingBehavior; |
| 217 | 218 |
| 218 // |*m_mainThreadLoaderHolder| lives in the main thread. | 219 // |*m_mainThreadLoaderHolder| lives in the main thread. |
| 219 CrossThreadPersistent<MainThreadLoaderHolder> m_mainThreadLoaderHolder; | 220 CrossThreadPersistent<MainThreadLoaderHolder> m_mainThreadLoaderHolder; |
| 220 }; | 221 }; |
| 221 | 222 |
| 222 } // namespace blink | 223 } // namespace blink |
| 223 | 224 |
| 224 #endif // WorkerThreadableLoader_h | 225 #endif // WorkerThreadableLoader_h |
| OLD | NEW |