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

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

Issue 2225733002: Revert of Move ThreadableLoader to Oilpan heap (3/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@onheap-threadable-loader
Patch Set: Created 4 years, 4 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 bcd683ee70200ca7ee1dabb3a5192b027c35b007..02c0d8af0a64be25a73a7c945f3d0e9015760461 100644
--- a/third_party/WebKit/Source/core/loader/WorkerThreadableLoader.h
+++ b/third_party/WebKit/Source/core/loader/WorkerThreadableLoader.h
@@ -56,31 +56,9 @@
struct CrossThreadResourceRequestData;
struct CrossThreadResourceTimingInfoData;
-// A WorkerThreadableLoader is a ThreadableLoader implementation intended to
-// be used in a WebWorker thread. Because Blink's ResourceFetcher and
-// ResourceLoader work only in the main thread, a WorkerThreadableLoader holds
-// a ThreadableLoader in the main thread and delegates tasks asynchronously
-// to the loader.
-//
-// CTP: CrossThreadPersistent
-// CTWP: CrossThreadWeakPersistent
-//
-// ----------------------------------------------------------------
-// +------------------------+
-// raw ptr | ThreadableLoaderClient |
-// +--------> | worker thread |
-// | +------------------------+
-// |
-// +----+------------------+ CTP +------------------------+
-// + WorkerThreadableLoader|<--------+ MainThreadLoaderHolder |
-// | worker thread +-------->| main thread |
-// +-----------------------+ CTWP +----------------------+-+
-// |
-// +------------------+ | Member
-// | ThreadableLoader | <---+
-// | main thread |
-// +------------------+
-//
+// TODO(yhirano): Draw a diagram to illustrate the class relationship.
+// TODO(yhirano): Rename inner classes so that readers can see in which thread
+// they are living easily.
class WorkerThreadableLoader final : public ThreadableLoader {
public:
static void loadResourceSynchronously(WorkerGlobalScope&, const ResourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&, const ResourceLoaderOptions&);
@@ -123,8 +101,8 @@
// ThreadableLoaderClient for a DocumentThreadableLoader and forward
// notifications to the associated WorkerThreadableLoader living in the
// worker thread.
- class MainThreadLoaderHolder final : public GarbageCollectedFinalized<MainThreadLoaderHolder>, public ThreadableLoaderClient, public WorkerThreadLifecycleObserver {
- USING_GARBAGE_COLLECTED_MIXIN(MainThreadLoaderHolder);
+ class Peer final : public GarbageCollectedFinalized<Peer>, public ThreadableLoaderClient, public WorkerThreadLifecycleObserver {
+ USING_GARBAGE_COLLECTED_MIXIN(Peer);
public:
static void createAndStart(
WorkerThreadableLoader*,
@@ -135,7 +113,7 @@
const ResourceLoaderOptions&,
PassRefPtr<WaitableEventWithTasks>,
ExecutionContext*);
- ~MainThreadLoaderHolder() override;
+ ~Peer() override;
void overrideTimeout(unsigned long timeoutMillisecond);
void cancel();
@@ -156,7 +134,7 @@
DECLARE_TRACE();
private:
- MainThreadLoaderHolder(TaskForwarder*, WorkerThreadLifecycleContext*);
+ Peer(TaskForwarder*, WorkerThreadLifecycleContext*);
void start(Document&, std::unique_ptr<CrossThreadResourceRequestData>, const ThreadableLoaderOptions&, const ResourceLoaderOptions&);
Member<TaskForwarder> m_forwarder;
@@ -167,7 +145,7 @@
};
WorkerThreadableLoader(WorkerGlobalScope&, ThreadableLoaderClient*, const ThreadableLoaderOptions&, const ResourceLoaderOptions&, BlockingBehavior);
- void didStart(MainThreadLoaderHolder*);
+ void didStart(Peer*);
void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent);
void didReceiveResponse(unsigned long identifier, std::unique_ptr<CrossThreadResourceResponseData>, std::unique_ptr<WebDataConsumerHandle>);
@@ -188,8 +166,8 @@
ResourceLoaderOptions m_resourceLoaderOptions;
BlockingBehavior m_blockingBehavior;
- // |*m_mainThreadLoaderHolder| lives in the main thread.
- CrossThreadPersistent<MainThreadLoaderHolder> m_mainThreadLoaderHolder;
+ // |*m_peer| lives in the main thread.
+ CrossThreadPersistent<Peer> m_peer;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698