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

Unified Diff: third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/modules/fetch/CrossThreadHolder.h
diff --git a/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h b/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h
index 12da6c70282ea9af4d53760561846089e14e530b..9492ba1fc109f26fdd64720c8c4c31f5ecdd43d5 100644
--- a/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h
+++ b/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h
@@ -10,11 +10,11 @@
#include "core/dom/ExecutionContext.h"
#include "public/platform/WebTraceLocation.h"
#include "wtf/Locker.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
#include "wtf/PassRefPtr.h"
-#include "wtf/PtrUtil.h"
#include "wtf/RefPtr.h"
#include "wtf/ThreadingPrimitives.h"
-#include <memory>
namespace blink {
@@ -33,10 +33,10 @@ public:
// Must be called on the thread where |obj| is created
// (== the thread of |executionContext|).
// The current thread must be attached to Oilpan.
- static std::unique_ptr<CrossThreadHolder<T>> create(ExecutionContext* executionContext, std::unique_ptr<T> obj)
+ static PassOwnPtr<CrossThreadHolder<T>> create(ExecutionContext* executionContext, PassOwnPtr<T> obj)
{
ASSERT(executionContext->isContextThread());
- return wrapUnique(new CrossThreadHolder(executionContext, std::move(obj)));
+ return adoptPtr(new CrossThreadHolder(executionContext, std::move(obj)));
}
// Can be called from any thread.
@@ -65,7 +65,7 @@ public:
private:
// Object graph:
// +------+ +-----------------+
- // T <-std::unique_ptr- |Bridge| ---------*-------------> |CrossThreadHolder|
+ // T <-OwnPtr- |Bridge| ---------*-------------> |CrossThreadHolder|
// | | <-CrossThreadPersistent- | |
// +------+ +-----------------+
// | |
@@ -93,7 +93,7 @@ private:
, public ActiveDOMObject {
USING_GARBAGE_COLLECTED_MIXIN(Bridge);
public:
- Bridge(ExecutionContext* executionContext, std::unique_ptr<T> obj, PassRefPtr<MutexWrapper> mutex, CrossThreadHolder* holder)
+ Bridge(ExecutionContext* executionContext, PassOwnPtr<T> obj, PassRefPtr<MutexWrapper> mutex, CrossThreadHolder* holder)
: ActiveDOMObject(executionContext)
, m_obj(std::move(obj))
, m_mutex(mutex)
@@ -145,7 +145,7 @@ private:
}
- std::unique_ptr<T> m_obj;
+ OwnPtr<T> m_obj;
// All accesses to |m_holder| must be protected by |m_mutex|.
RefPtr<MutexWrapper> m_mutex;
CrossThreadHolder* m_holder;
@@ -159,7 +159,7 @@ private:
m_bridge.clear();
}
- CrossThreadHolder(ExecutionContext* executionContext, std::unique_ptr<T> obj)
+ CrossThreadHolder(ExecutionContext* executionContext, PassOwnPtr<T> obj)
: m_mutex(MutexWrapper::create())
, m_bridge(new Bridge(executionContext, std::move(obj), m_mutex, this))
{

Powered by Google App Engine
This is Rietveld 408576698