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

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

Issue 2024993003: Add CrossThreadCopier and isolatedCopy() to SourceLocation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 74cd28273101fc225ffce3a551613ee831454063..ea41a9f2c581d0d97fde24f51fca8a5eff61451b 100644
--- a/third_party/WebKit/Source/bindings/core/v8/SourceLocation.h
+++ b/third_party/WebKit/Source/bindings/core/v8/SourceLocation.h
@@ -6,6 +6,7 @@
#define SourceLocation_h
#include "core/CoreExport.h"
+#include "platform/CrossThreadCopier.h"
#include "platform/v8_inspector/public/V8StackTrace.h"
#include "wtf/Forward.h"
#include "wtf/PassOwnPtr.h"
@@ -38,6 +39,7 @@ public:
int scriptId() const { return m_scriptId; }
void toTracedValue(TracedValue*, const char* name) const;
PassOwnPtr<SourceLocation> clone() const;
+ PassOwnPtr<SourceLocation> isolatedCopy() const; // Safe to pass between threads.
private:
SourceLocation(const String& url, unsigned lineNumber, unsigned columnNumber, std::unique_ptr<V8StackTrace>, int scriptId);
@@ -50,6 +52,15 @@ private:
int m_scriptId;
};
+template <>
+struct CrossThreadCopier<PassOwnPtr<SourceLocation>> {
+ using Type = PassOwnPtr<SourceLocation>;
+ static Type copy(PassOwnPtr<SourceLocation> location)
+ {
+ return location ? location->isolatedCopy() : nullptr;
+ }
+};
+
} // namespace blink
#endif // SourceLocation_h

Powered by Google App Engine
This is Rietveld 408576698