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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/CallbackPromiseAdapter.h

Issue 1865913005: Nuke WebPassOwnPtr<T> and replace it with std::unique_ptr<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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/bindings/core/v8/CallbackPromiseAdapter.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/CallbackPromiseAdapter.h b/third_party/WebKit/Source/bindings/core/v8/CallbackPromiseAdapter.h
index baabc3c37811466b77deb74dd465f2f096f396b9..65e9b93019679b598ef0fdd77bd4bef7b80e6a00 100644
--- a/third_party/WebKit/Source/bindings/core/v8/CallbackPromiseAdapter.h
+++ b/third_party/WebKit/Source/bindings/core/v8/CallbackPromiseAdapter.h
@@ -33,11 +33,12 @@
#include "bindings/core/v8/ScriptPromiseResolver.h"
#include "public/platform/WebCallbacks.h"
-#include "public/platform/WebPassOwnPtr.h"
#include "wtf/OwnPtr.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/TypeTraits.h"
+#include <memory>
+
namespace blink {
// CallbackPromiseAdapter is a WebCallbacks subclass and resolves / rejects the
@@ -50,7 +51,7 @@ namespace blink {
// CallbackPromiseAdapter<bool, void> is a subclass of
// WebCallbacks<bool, void>.
// - If a WebType is OwnPtr<T>, its corresponding type parameter on
-// WebCallbacks is WebPassOwnPtr<T>, because WebCallbacks must be exposed to
+// WebCallbacks is std::unique_ptr<T>, because WebCallbacks must be exposed to
// Chromium.
//
// When onSuccess is called with a S::WebType value, the value is passed to
@@ -81,7 +82,7 @@ namespace blink {
// }
// ...
// };
-// OwnPtr<WebCallbacks<WebPassOwnPtr<WebMyClass>, const WebMyErrorClass&>>
+// OwnPtr<WebCallbacks<std::unique_ptr<WebMyClass>, const WebMyErrorClass&>>
// callbacks = adoptPtr(new CallbackPromiseAdapter<MyClass, MyErrorClass>(
// resolver));
// ...
@@ -133,12 +134,13 @@ private:
};
template <typename T>
struct WebPassTypeImpl<OwnPtr<T>> {
- using Type = WebPassOwnPtr<T>;
+ using Type = std::unique_ptr<T>;
};
template <typename T> using PassType = typename PassTypeImpl<T>::Type;
template <typename T> using WebPassType = typename WebPassTypeImpl<T>::Type;
template <typename T> static T& adopt(T& x) { return x; }
- template <typename T> static PassOwnPtr<T> adopt(WebPassOwnPtr<T>& x) { return x.release(); }
+ template <typename T>
+ static PassOwnPtr<T> adopt(std::unique_ptr<T>& x) { return adoptPtr(x.release()); }
template <typename T> static PassType<T> pass(T& x) { return x; }
template <typename T> static PassOwnPtr<T> pass(OwnPtr<T>& x) { return x.release(); }
« no previous file with comments | « content/renderer/usb/web_usb_device_impl.cc ('k') | third_party/WebKit/Source/modules/background_sync/SyncCallbacks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698