Commit e0d02532 authored by sigbjornf@opera.com's avatar sigbjornf@opera.com

Oilpan: move WebKitPoint to the oilpan heap.

R=wibling@chromium.org,haraken@chromium.org
BUG=340522

Review URL: https://codereview.chromium.org/214563004

git-svn-id: svn://svn.chromium.org/blink/trunk@170199 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 2d64e034
......@@ -54,7 +54,7 @@ void V8WebKitPoint::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>&
y = 0;
}
}
RefPtr<DOMPoint> point = DOMPoint::create(x, y);
RefPtrWillBeRawPtr<DOMPoint> point = DOMPoint::create(x, y);
v8::Handle<v8::Object> wrapper = info.Holder();
V8DOMWrapper::associateObjectWithWrapper<V8WebKitPoint>(point.release(), &wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
info.GetReturnValue().Set(wrapper);
......
......@@ -27,20 +27,21 @@
#define DOMPoint_h
#include "bindings/v8/ScriptWrappable.h"
#include "heap/Handle.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
namespace WebCore {
class DOMPoint : public RefCounted<DOMPoint>, public ScriptWrappable {
class DOMPoint FINAL : public RefCountedWillBeGarbageCollectedFinalized<DOMPoint>, public ScriptWrappable {
public:
static PassRefPtr<DOMPoint> create()
static PassRefPtrWillBeRawPtr<DOMPoint> create()
{
return adoptRef(new DOMPoint());
return adoptRefWillBeNoop(new DOMPoint());
}
static PassRefPtr<DOMPoint> create(float x, float y)
static PassRefPtrWillBeRawPtr<DOMPoint> create(float x, float y)
{
return adoptRef(new DOMPoint(x, y));
return adoptRefWillBeNoop(new DOMPoint(x, y));
}
float x() const { return m_x; }
......@@ -49,6 +50,8 @@ public:
void setX(float x) { m_x = x; }
void setY(float y) { m_y = y; }
void trace(Visitor*) { }
private:
DOMPoint(float x = 0, float y = 0)
: m_x(x)
......
......@@ -1317,7 +1317,7 @@ PassRefPtrWillBeRawPtr<CSSRuleList> DOMWindow::getMatchedCSSRules(Element* eleme
return m_frame->document()->ensureStyleResolver().pseudoCSSRulesForElement(element, pseudoId, rulesToInclude);
}
PassRefPtr<DOMPoint> DOMWindow::webkitConvertPointFromNodeToPage(Node* node, const DOMPoint* p) const
PassRefPtrWillBeRawPtr<DOMPoint> DOMWindow::webkitConvertPointFromNodeToPage(Node* node, const DOMPoint* p) const
{
if (!node || !p)
return nullptr;
......@@ -1332,7 +1332,7 @@ PassRefPtr<DOMPoint> DOMWindow::webkitConvertPointFromNodeToPage(Node* node, con
return DOMPoint::create(pagePoint.x(), pagePoint.y());
}
PassRefPtr<DOMPoint> DOMWindow::webkitConvertPointFromPageToNode(Node* node, const DOMPoint* p) const
PassRefPtrWillBeRawPtr<DOMPoint> DOMWindow::webkitConvertPointFromPageToNode(Node* node, const DOMPoint* p) const
{
if (!node || !p)
return nullptr;
......
......@@ -219,8 +219,8 @@ enum PageshowEventPersistence {
PassRefPtrWillBeRawPtr<CSSRuleList> getMatchedCSSRules(Element*, const String& pseudoElt) const;
double devicePixelRatio() const;
PassRefPtr<DOMPoint> webkitConvertPointFromPageToNode(Node*, const DOMPoint*) const;
PassRefPtr<DOMPoint> webkitConvertPointFromNodeToPage(Node*, const DOMPoint*) const;
PassRefPtrWillBeRawPtr<DOMPoint> webkitConvertPointFromPageToNode(Node*, const DOMPoint*) const;
PassRefPtrWillBeRawPtr<DOMPoint> webkitConvertPointFromNodeToPage(Node*, const DOMPoint*) const;
Console& console() const;
PageConsole* pageConsole() const;
......
......@@ -27,6 +27,7 @@
CustomConstructor,
CustomConstructor(float x, float y),
ImplementedAs=DOMPoint,
WillBeGarbageCollected,
] interface WebKitPoint {
attribute float x;
attribute float y;
......
......@@ -1127,7 +1127,7 @@ String Internals::rangeAsText(const Range* range, ExceptionState& exceptionState
return range->text();
}
PassRefPtr<DOMPoint> Internals::touchPositionAdjustedToBestClickableNode(long x, long y, long width, long height, Document* document, ExceptionState& exceptionState)
PassRefPtrWillBeRawPtr<DOMPoint> Internals::touchPositionAdjustedToBestClickableNode(long x, long y, long width, long height, Document* document, ExceptionState& exceptionState)
{
if (!document || !document->frame()) {
exceptionState.throwDOMException(InvalidAccessError, document ? "The document's frame cannot be retrieved." : "The document provided is invalid.");
......@@ -1167,7 +1167,7 @@ Node* Internals::touchNodeAdjustedToBestClickableNode(long x, long y, long width
return targetNode;
}
PassRefPtr<DOMPoint> Internals::touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document* document, ExceptionState& exceptionState)
PassRefPtrWillBeRawPtr<DOMPoint> Internals::touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document* document, ExceptionState& exceptionState)
{
if (!document || !document->frame()) {
exceptionState.throwDOMException(InvalidAccessError, document ? "The document's frame cannot be retrieved." : "The document provided is invalid.");
......
......@@ -171,9 +171,9 @@ public:
unsigned lengthFromRange(Element* scope, const Range*, ExceptionState&);
String rangeAsText(const Range*, ExceptionState&);
PassRefPtr<DOMPoint> touchPositionAdjustedToBestClickableNode(long x, long y, long width, long height, Document*, ExceptionState&);
PassRefPtrWillBeRawPtr<DOMPoint> touchPositionAdjustedToBestClickableNode(long x, long y, long width, long height, Document*, ExceptionState&);
Node* touchNodeAdjustedToBestClickableNode(long x, long y, long width, long height, Document*, ExceptionState&);
PassRefPtr<DOMPoint> touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document*, ExceptionState&);
PassRefPtrWillBeRawPtr<DOMPoint> touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document*, ExceptionState&);
Node* touchNodeAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document*, ExceptionState&);
PassRefPtr<ClientRect> bestZoomableAreaForTouchPoint(long x, long y, long width, long height, Document*, ExceptionState&);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment