Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1177)

Unified Diff: third_party/WebKit/Source/core/loader/WorkerThreadableLoader.h

Issue 2196833002: Propagate proper FROM_HERE to postTask() in worker code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/loader/WorkerThreadableLoader.h
diff --git a/third_party/WebKit/Source/core/loader/WorkerThreadableLoader.h b/third_party/WebKit/Source/core/loader/WorkerThreadableLoader.h
index efbb0748bbd3cdecbec230493d8d58a6300e663c..7e5c0854c2ed886ad07a685533debb5df05bb05e 100644
--- a/third_party/WebKit/Source/core/loader/WorkerThreadableLoader.h
+++ b/third_party/WebKit/Source/core/loader/WorkerThreadableLoader.h
@@ -137,8 +137,8 @@ private:
// The following methods are overridden by the subclasses to implement
// code to forward did.* method invocations to the worker context's
// thread which is specialized for sync and async case respectively.
- virtual void forwardTaskToWorker(std::unique_ptr<ExecutionContextTask>) = 0;
- virtual void forwardTaskToWorkerOnLoaderDone(std::unique_ptr<ExecutionContextTask>) = 0;
+ virtual void forwardTaskToWorker(const WebTraceLocation&, std::unique_ptr<ExecutionContextTask>) = 0;
+ virtual void forwardTaskToWorkerOnLoaderDone(const WebTraceLocation&, std::unique_ptr<ExecutionContextTask>) = 0;
// All executed on the main thread.
void mainThreadCreateLoader(ThreadableLoaderOptions, ResourceLoaderOptions, ExecutionContext*);
@@ -166,8 +166,8 @@ private:
private:
~MainThreadAsyncBridge() override;
- void forwardTaskToWorker(std::unique_ptr<ExecutionContextTask>) override;
- void forwardTaskToWorkerOnLoaderDone(std::unique_ptr<ExecutionContextTask>) override;
+ void forwardTaskToWorker(const WebTraceLocation&, std::unique_ptr<ExecutionContextTask>) override;
+ void forwardTaskToWorkerOnLoaderDone(const WebTraceLocation&, std::unique_ptr<ExecutionContextTask>) override;
};
class MainThreadSyncBridge final : public MainThreadBridgeBase {
@@ -176,17 +176,27 @@ private:
void start(const ResourceRequest&, const WorkerGlobalScope&) override;
private:
+ struct ClientTask {
+ WebTraceLocation m_location;
+ std::unique_ptr<ExecutionContextTask> m_task;
+
+ ClientTask(const WebTraceLocation&, std::unique_ptr<ExecutionContextTask>);
+ ~ClientTask();
+
+ ClientTask(ClientTask&&);
+ };
+
~MainThreadSyncBridge() override;
- void forwardTaskToWorker(std::unique_ptr<ExecutionContextTask>) override;
- void forwardTaskToWorkerOnLoaderDone(std::unique_ptr<ExecutionContextTask>) override;
+ void forwardTaskToWorker(const WebTraceLocation&, std::unique_ptr<ExecutionContextTask>) override;
+ void forwardTaskToWorkerOnLoaderDone(const WebTraceLocation&, std::unique_ptr<ExecutionContextTask>) override;
bool m_done;
std::unique_ptr<WaitableEvent> m_loaderDoneEvent;
// Thread-safety: |m_clientTasks| can be written (i.e. Closures are added)
// on the main thread only before |m_loaderDoneEvent| is signaled and can be read
// on the worker context thread only after |m_loaderDoneEvent| is signaled.
- Vector<std::unique_ptr<ExecutionContextTask>> m_clientTasks;
+ Vector<ClientTask> m_clientTasks;
Mutex m_lock;
};

Powered by Google App Engine
This is Rietveld 408576698