OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 memcpy(buffer->data(), data, dataLength); | 59 memcpy(buffer->data(), data, dataLength); |
60 return buffer; | 60 return buffer; |
61 } | 61 } |
62 | 62 |
63 } // namespace | 63 } // namespace |
64 | 64 |
65 class WorkerThreadableLoader::AsyncTaskForwarder final | 65 class WorkerThreadableLoader::AsyncTaskForwarder final |
66 : public WorkerThreadableLoader::TaskForwarder { | 66 : public WorkerThreadableLoader::TaskForwarder { |
67 public: | 67 public: |
68 explicit AsyncTaskForwarder(PassRefPtr<WorkerLoaderProxy> loaderProxy) | 68 explicit AsyncTaskForwarder(PassRefPtr<WorkerLoaderProxy> loaderProxy) |
69 : m_loaderProxy(loaderProxy) { | 69 : m_loaderProxy(std::move(loaderProxy)) { |
70 DCHECK(isMainThread()); | 70 DCHECK(isMainThread()); |
71 } | 71 } |
72 ~AsyncTaskForwarder() override { DCHECK(isMainThread()); } | 72 ~AsyncTaskForwarder() override { DCHECK(isMainThread()); } |
73 | 73 |
74 void forwardTask(const WebTraceLocation& location, | 74 void forwardTask(const WebTraceLocation& location, |
75 std::unique_ptr<CrossThreadClosure> task) override { | 75 std::unique_ptr<CrossThreadClosure> task) override { |
76 DCHECK(isMainThread()); | 76 DCHECK(isMainThread()); |
77 m_loaderProxy->postTaskToWorkerGlobalScope(location, std::move(task)); | 77 m_loaderProxy->postTaskToWorkerGlobalScope(location, std::move(task)); |
78 } | 78 } |
79 void forwardTaskWithDoneSignal( | 79 void forwardTaskWithDoneSignal( |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 Vector<TaskWithLocation> m_tasks; | 155 Vector<TaskWithLocation> m_tasks; |
156 bool m_isAborted = false; | 156 bool m_isAborted = false; |
157 bool m_isSignalCalled = false; | 157 bool m_isSignalCalled = false; |
158 bool m_isWaitDone = false; | 158 bool m_isWaitDone = false; |
159 }; | 159 }; |
160 | 160 |
161 class WorkerThreadableLoader::SyncTaskForwarder final | 161 class WorkerThreadableLoader::SyncTaskForwarder final |
162 : public WorkerThreadableLoader::TaskForwarder { | 162 : public WorkerThreadableLoader::TaskForwarder { |
163 public: | 163 public: |
164 explicit SyncTaskForwarder(PassRefPtr<WaitableEventWithTasks> eventWithTasks) | 164 explicit SyncTaskForwarder(PassRefPtr<WaitableEventWithTasks> eventWithTasks) |
165 : m_eventWithTasks(eventWithTasks) { | 165 : m_eventWithTasks(std::move(eventWithTasks)) { |
166 DCHECK(isMainThread()); | 166 DCHECK(isMainThread()); |
167 } | 167 } |
168 ~SyncTaskForwarder() override { DCHECK(isMainThread()); } | 168 ~SyncTaskForwarder() override { DCHECK(isMainThread()); } |
169 | 169 |
170 void forwardTask(const WebTraceLocation& location, | 170 void forwardTask(const WebTraceLocation& location, |
171 std::unique_ptr<CrossThreadClosure> task) override { | 171 std::unique_ptr<CrossThreadClosure> task) override { |
172 DCHECK(isMainThread()); | 172 DCHECK(isMainThread()); |
173 m_eventWithTasks->append(TaskWithLocation(location, std::move(task))); | 173 m_eventWithTasks->append(TaskWithLocation(location, std::move(task))); |
174 } | 174 } |
175 void forwardTaskWithDoneSignal( | 175 void forwardTaskWithDoneSignal( |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 const ResourceLoaderOptions& originalResourceLoaderOptions) { | 667 const ResourceLoaderOptions& originalResourceLoaderOptions) { |
668 DCHECK(isMainThread()); | 668 DCHECK(isMainThread()); |
669 ResourceLoaderOptions resourceLoaderOptions = originalResourceLoaderOptions; | 669 ResourceLoaderOptions resourceLoaderOptions = originalResourceLoaderOptions; |
670 resourceLoaderOptions.requestInitiatorContext = WorkerContext; | 670 resourceLoaderOptions.requestInitiatorContext = WorkerContext; |
671 m_mainThreadLoader = DocumentThreadableLoader::create( | 671 m_mainThreadLoader = DocumentThreadableLoader::create( |
672 loadingContext, this, options, resourceLoaderOptions); | 672 loadingContext, this, options, resourceLoaderOptions); |
673 m_mainThreadLoader->start(ResourceRequest(request.get())); | 673 m_mainThreadLoader->start(ResourceRequest(request.get())); |
674 } | 674 } |
675 | 675 |
676 } // namespace blink | 676 } // namespace blink |
OLD | NEW |