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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/SourceLocation.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/bindings/core/v8/SourceLocation.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/SourceLocation.h b/third_party/WebKit/Source/bindings/core/v8/SourceLocation.h
index 5581621db18841928b34af677f8a512f0569ff59..d5b6baf867a7b46a0a82370061cc8cd62f9ee5de 100644
--- a/third_party/WebKit/Source/bindings/core/v8/SourceLocation.h
+++ b/third_party/WebKit/Source/bindings/core/v8/SourceLocation.h
@@ -9,8 +9,8 @@
#include "platform/CrossThreadCopier.h"
#include "platform/v8_inspector/public/V8StackTrace.h"
#include "wtf/Forward.h"
+#include "wtf/PassOwnPtr.h"
#include "wtf/text/WTFString.h"
-#include <memory>
namespace blink {
@@ -23,19 +23,19 @@ namespace protocol { namespace Runtime { class StackTrace; }}
class CORE_EXPORT SourceLocation {
public:
// Zero lineNumber and columnNumber mean unknown. Captures current stack trace.
- static std::unique_ptr<SourceLocation> capture(const String& url, unsigned lineNumber, unsigned columnNumber);
+ static PassOwnPtr<SourceLocation> capture(const String& url, unsigned lineNumber, unsigned columnNumber);
// Shortcut when location is unknown. Tries to capture call stack or parsing location if available.
- static std::unique_ptr<SourceLocation> capture(ExecutionContext* = nullptr);
+ static PassOwnPtr<SourceLocation> capture(ExecutionContext* = nullptr);
- static std::unique_ptr<SourceLocation> fromMessage(v8::Isolate*, v8::Local<v8::Message>, ExecutionContext*);
+ static PassOwnPtr<SourceLocation> fromMessage(v8::Isolate*, v8::Local<v8::Message>, ExecutionContext*);
- static std::unique_ptr<SourceLocation> fromFunction(v8::Local<v8::Function>);
+ static PassOwnPtr<SourceLocation> fromFunction(v8::Local<v8::Function>);
// Forces full stack trace.
- static std::unique_ptr<SourceLocation> captureWithFullStackTrace();
+ static PassOwnPtr<SourceLocation> captureWithFullStackTrace();
- static std::unique_ptr<SourceLocation> create(const String& url, unsigned lineNumber, unsigned columnNumber, std::unique_ptr<V8StackTrace>, int scriptId = 0);
+ static PassOwnPtr<SourceLocation> create(const String& url, unsigned lineNumber, unsigned columnNumber, std::unique_ptr<V8StackTrace>, int scriptId = 0);
~SourceLocation();
bool isUnknown() const { return m_url.isNull() && !m_scriptId && !m_lineNumber; }
@@ -44,8 +44,8 @@ public:
unsigned columnNumber() const { return m_columnNumber; }
int scriptId() const { return m_scriptId; }
- std::unique_ptr<SourceLocation> clone() const;
- std::unique_ptr<SourceLocation> isolatedCopy() const; // Safe to pass between threads.
+ PassOwnPtr<SourceLocation> clone() const;
+ PassOwnPtr<SourceLocation> isolatedCopy() const; // Safe to pass between threads.
// No-op when stack trace is unknown.
void toTracedValue(TracedValue*, const char* name) const;
@@ -58,7 +58,7 @@ public:
private:
SourceLocation(const String& url, unsigned lineNumber, unsigned columnNumber, std::unique_ptr<V8StackTrace>, int scriptId);
- static std::unique_ptr<SourceLocation> createFromNonEmptyV8StackTrace(std::unique_ptr<V8StackTrace>, int scriptId);
+ static PassOwnPtr<SourceLocation> createFromNonEmptyV8StackTrace(std::unique_ptr<V8StackTrace>, int scriptId);
String m_url;
unsigned m_lineNumber;
@@ -68,9 +68,9 @@ private:
};
template <>
-struct CrossThreadCopier<std::unique_ptr<SourceLocation>> {
- using Type = std::unique_ptr<SourceLocation>;
- static Type copy(std::unique_ptr<SourceLocation> location)
+struct CrossThreadCopier<PassOwnPtr<SourceLocation>> {
+ using Type = PassOwnPtr<SourceLocation>;
+ static Type copy(PassOwnPtr<SourceLocation> location)
{
return location ? location->isolatedCopy() : nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698