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

Oilpan: move History to the oilpan heap.

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

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

git-svn-id: svn://svn.chromium.org/blink/trunk@169540 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 0f2cfb89
......@@ -48,7 +48,7 @@ PopStateEvent::PopStateEvent(const AtomicString& type, const PopStateEventInit&
ScriptWrappable::init(this);
}
PopStateEvent::PopStateEvent(PassRefPtr<SerializedScriptValue> serializedState, PassRefPtr<History> history)
PopStateEvent::PopStateEvent(PassRefPtr<SerializedScriptValue> serializedState, PassRefPtrWillBeRawPtr<History> history)
: Event(EventTypeNames::popstate, false, true)
, m_serializedState(serializedState)
, m_history(history)
......@@ -65,7 +65,7 @@ PassRefPtr<PopStateEvent> PopStateEvent::create()
return adoptRef(new PopStateEvent);
}
PassRefPtr<PopStateEvent> PopStateEvent::create(PassRefPtr<SerializedScriptValue> serializedState, PassRefPtr<History> history)
PassRefPtr<PopStateEvent> PopStateEvent::create(PassRefPtr<SerializedScriptValue> serializedState, PassRefPtrWillBeRawPtr<History> history)
{
return adoptRef(new PopStateEvent(serializedState, history));
}
......
......@@ -28,6 +28,7 @@
#define PopStateEvent_h
#include "core/events/Event.h"
#include "heap/Handle.h"
namespace WebCore {
......@@ -40,7 +41,7 @@ class PopStateEvent FINAL : public Event {
public:
virtual ~PopStateEvent();
static PassRefPtr<PopStateEvent> create();
static PassRefPtr<PopStateEvent> create(PassRefPtr<SerializedScriptValue>, PassRefPtr<History>);
static PassRefPtr<PopStateEvent> create(PassRefPtr<SerializedScriptValue>, PassRefPtrWillBeRawPtr<History>);
static PassRefPtr<PopStateEvent> create(const AtomicString&, const PopStateEventInit&);
SerializedScriptValue* serializedState() const { return m_serializedState.get(); }
......@@ -58,10 +59,10 @@ public:
private:
PopStateEvent();
PopStateEvent(const AtomicString&, const PopStateEventInit&);
explicit PopStateEvent(PassRefPtr<SerializedScriptValue>, PassRefPtr<History>);
PopStateEvent(PassRefPtr<SerializedScriptValue>, PassRefPtrWillBeRawPtr<History>);
RefPtr<SerializedScriptValue> m_serializedState;
RefPtr<History> m_history;
RefPtrWillBePersistent<History> m_history;
};
} // namespace WebCore
......
......@@ -344,7 +344,7 @@ enum PageshowEventPersistence {
HashSet<DOMWindowProperty*> m_properties;
mutable RefPtrWillBePersistent<Screen> m_screen;
mutable RefPtr<History> m_history;
mutable RefPtrWillBePersistent<History> m_history;
mutable RefPtr<BarProp> m_locationbar;
mutable RefPtr<BarProp> m_menubar;
mutable RefPtr<BarProp> m_personalbar;
......
......@@ -30,6 +30,7 @@
#include "bindings/v8/SerializedScriptValue.h"
#include "core/loader/FrameLoaderTypes.h"
#include "core/frame/DOMWindowProperty.h"
#include "heap/Handle.h"
#include "wtf/Forward.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
......@@ -41,9 +42,12 @@ class KURL;
class ExecutionContext;
class ExceptionState;
class History FINAL : public ScriptWrappable, public RefCounted<History>, public DOMWindowProperty {
class History FINAL : public RefCountedWillBeGarbageCollectedFinalized<History>, public ScriptWrappable, public DOMWindowProperty {
public:
static PassRefPtr<History> create(LocalFrame* frame) { return adoptRef(new History(frame)); }
static PassRefPtrWillBeRawPtr<History> create(LocalFrame* frame)
{
return adoptRefWillBeNoop(new History(frame));
}
unsigned length() const;
SerializedScriptValue* state();
......@@ -57,6 +61,8 @@ public:
void stateObjectAdded(PassRefPtr<SerializedScriptValue>, const String& title, const String& url, UpdateBackForwardListPolicy, ExceptionState&);
void trace(Visitor*) { }
private:
explicit History(LocalFrame*);
......
......@@ -23,7 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
interface History {
[
WillBeGarbageCollected,
] interface History {
readonly attribute unsigned long length;
[Custom=Getter] readonly attribute SerializedScriptValue state;
......
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