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

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

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. Created 4 years, 6 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 e30a4bda11d4b673c53a2acf6aa3c9d6c49b820a..d84154970d9e144862c2f5d725c67abd2ccaa5e3 100644
--- a/third_party/WebKit/Source/core/loader/WorkerThreadableLoader.h
+++ b/third_party/WebKit/Source/core/loader/WorkerThreadableLoader.h
@@ -37,14 +37,14 @@
#include "platform/heap/Handle.h"
#include "platform/weborigin/Referrer.h"
#include "wtf/Functional.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
#include "wtf/PassRefPtr.h"
+#include "wtf/PtrUtil.h"
#include "wtf/RefPtr.h"
#include "wtf/Threading.h"
#include "wtf/ThreadingPrimitives.h"
#include "wtf/Vector.h"
#include "wtf/text/WTFString.h"
+#include <memory>
namespace blink {
@@ -61,9 +61,9 @@ class WorkerThreadableLoader final : public ThreadableLoader, private Threadable
USING_FAST_MALLOC(WorkerThreadableLoader);
public:
static void loadResourceSynchronously(WorkerGlobalScope&, const ResourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&, const ResourceLoaderOptions&);
- static PassOwnPtr<WorkerThreadableLoader> create(WorkerGlobalScope& workerGlobalScope, ThreadableLoaderClient* client, const ThreadableLoaderOptions& options, const ResourceLoaderOptions& resourceLoaderOptions)
+ static std::unique_ptr<WorkerThreadableLoader> create(WorkerGlobalScope& workerGlobalScope, ThreadableLoaderClient* client, const ThreadableLoaderOptions& options, const ResourceLoaderOptions& resourceLoaderOptions)
{
- return adoptPtr(new WorkerThreadableLoader(workerGlobalScope, client, options, resourceLoaderOptions, LoadAsynchronously));
+ return wrapUnique(new WorkerThreadableLoader(workerGlobalScope, client, options, resourceLoaderOptions, LoadAsynchronously));
}
~WorkerThreadableLoader() override;
@@ -110,7 +110,7 @@ private:
// All executed on the main thread.
void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) final;
- void didReceiveResponse(unsigned long identifier, const ResourceResponse&, PassOwnPtr<WebDataConsumerHandle>) final;
+ void didReceiveResponse(unsigned long identifier, const ResourceResponse&, std::unique_ptr<WebDataConsumerHandle>) final;
void didReceiveData(const char*, unsigned dataLength) final;
void didDownloadData(int dataLength) final;
void didReceiveCachedMetadata(const char*, int dataLength) final;
@@ -142,13 +142,13 @@ private:
// All executed on the main thread.
void mainThreadCreateLoader(ThreadableLoaderOptions, ResourceLoaderOptions, ExecutionContext*);
- void mainThreadStart(PassOwnPtr<CrossThreadResourceRequestData>);
+ void mainThreadStart(std::unique_ptr<CrossThreadResourceRequestData>);
void mainThreadDestroy(ExecutionContext*);
void mainThreadOverrideTimeout(unsigned long timeoutMilliseconds, ExecutionContext*);
void mainThreadCancel(ExecutionContext*);
// Only to be used on the main thread.
- OwnPtr<ThreadableLoader> m_mainThreadLoader;
+ std::unique_ptr<ThreadableLoader> m_mainThreadLoader;
// ThreadableLoaderClientWrapper is to be used on the worker context thread.
// The ref counting is done on either thread:
@@ -185,7 +185,7 @@ private:
void forwardTaskToWorkerOnLoaderDone(std::unique_ptr<ExecutionContextTask>) override;
bool m_done;
- OwnPtr<WaitableEvent> m_loaderDoneEvent;
+ 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.

Powered by Google App Engine
This is Rietveld 408576698