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

Oilpan: move Console objects to the oilpan heap.

Turn the ConsoleBase object into a garbage collected object if Oilpan
is enabled, avoiding its ref forwarding to either Console or WorkerConsole.

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

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

git-svn-id: svn://svn.chromium.org/blink/trunk@169670 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent d2cb8136
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "bindings/v8/ScriptWrappable.h" #include "bindings/v8/ScriptWrappable.h"
#include "core/frame/ConsoleBase.h" #include "core/frame/ConsoleBase.h"
#include "core/frame/DOMWindowProperty.h" #include "core/frame/DOMWindowProperty.h"
#include "heap/Handle.h"
#include "wtf/Forward.h" #include "wtf/Forward.h"
#include "wtf/PassRefPtr.h" #include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h" #include "wtf/RefCounted.h"
...@@ -44,25 +45,24 @@ class MemoryInfo; ...@@ -44,25 +45,24 @@ class MemoryInfo;
class Page; class Page;
class ScriptArguments; class ScriptArguments;
class Console FINAL : public RefCounted<Console>, public ConsoleBase, public ScriptWrappable, public DOMWindowProperty { class Console FINAL : public ConsoleBase, public ScriptWrappable, public DOMWindowProperty {
public: public:
using RefCounted<Console>::ref; static PassRefPtrWillBeRawPtr<Console> create(LocalFrame* frame)
using RefCounted<Console>::deref; {
return adoptRefWillBeNoop(new Console(frame));
static PassRefPtr<Console> create(LocalFrame* frame) { return adoptRef(new Console(frame)); } }
virtual ~Console(); virtual ~Console();
PassRefPtrWillBeRawPtr<MemoryInfo> memory() const; PassRefPtrWillBeRawPtr<MemoryInfo> memory() const;
void trace(Visitor*) { }
protected: protected:
virtual ExecutionContext* context() OVERRIDE; virtual ExecutionContext* context() OVERRIDE;
virtual void reportMessageToClient(MessageLevel, const String& message, PassRefPtr<ScriptCallStack>) OVERRIDE; virtual void reportMessageToClient(MessageLevel, const String& message, PassRefPtr<ScriptCallStack>) OVERRIDE;
private: private:
explicit Console(LocalFrame*); explicit Console(LocalFrame*);
virtual void refConsole() OVERRIDE { ref(); }
virtual void derefConsole() OVERRIDE { deref(); }
}; };
} // namespace WebCore } // namespace WebCore
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "core/inspector/ScriptCallStack.h" #include "core/inspector/ScriptCallStack.h"
#include "core/frame/ConsoleTypes.h" #include "core/frame/ConsoleTypes.h"
#include "core/frame/DOMWindowProperty.h" #include "core/frame/DOMWindowProperty.h"
#include "heap/Handle.h"
#include "wtf/Forward.h" #include "wtf/Forward.h"
#include "wtf/PassRefPtr.h" #include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h" #include "wtf/RefCounted.h"
...@@ -44,11 +45,8 @@ namespace WebCore { ...@@ -44,11 +45,8 @@ namespace WebCore {
class ScriptArguments; class ScriptArguments;
class ConsoleBase { class ConsoleBase : public RefCountedWillBeGarbageCollectedFinalized<ConsoleBase> {
public: public:
void ref() { refConsole(); }
void deref() { derefConsole(); }
void debug(ScriptState*, PassRefPtr<ScriptArguments>); void debug(ScriptState*, PassRefPtr<ScriptArguments>);
void error(ScriptState*, PassRefPtr<ScriptArguments>); void error(ScriptState*, PassRefPtr<ScriptArguments>);
void info(ScriptState*, PassRefPtr<ScriptArguments>); void info(ScriptState*, PassRefPtr<ScriptArguments>);
...@@ -73,15 +71,15 @@ public: ...@@ -73,15 +71,15 @@ public:
void groupCollapsed(ScriptState*, PassRefPtr<ScriptArguments>); void groupCollapsed(ScriptState*, PassRefPtr<ScriptArguments>);
void groupEnd(); void groupEnd();
protected: virtual void trace(Visitor*) = 0;
virtual ~ConsoleBase(); virtual ~ConsoleBase();
protected:
virtual ExecutionContext* context() = 0; virtual ExecutionContext* context() = 0;
virtual void reportMessageToClient(MessageLevel, const String& message, PassRefPtr<ScriptCallStack>) = 0; virtual void reportMessageToClient(MessageLevel, const String& message, PassRefPtr<ScriptCallStack>) = 0;
private: private:
virtual void refConsole() = 0;
virtual void derefConsole() = 0;
void internalAddMessage(MessageType, MessageLevel, ScriptState*, PassRefPtr<ScriptArguments>, bool acceptNoArguments = false, bool printTrace = false); void internalAddMessage(MessageType, MessageLevel, ScriptState*, PassRefPtr<ScriptArguments>, bool acceptNoArguments = false, bool printTrace = false);
}; };
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
[ [
NoInterfaceObject, NoInterfaceObject,
WillBeGarbageCollected,
] interface ConsoleBase { ] interface ConsoleBase {
[CallWith=ScriptArguments&ScriptState] void debug(); [CallWith=ScriptArguments&ScriptState] void debug();
[CallWith=ScriptArguments&ScriptState] void error(); [CallWith=ScriptArguments&ScriptState] void error();
......
...@@ -351,7 +351,7 @@ enum PageshowEventPersistence { ...@@ -351,7 +351,7 @@ enum PageshowEventPersistence {
mutable RefPtr<BarProp> m_scrollbars; mutable RefPtr<BarProp> m_scrollbars;
mutable RefPtr<BarProp> m_statusbar; mutable RefPtr<BarProp> m_statusbar;
mutable RefPtr<BarProp> m_toolbar; mutable RefPtr<BarProp> m_toolbar;
mutable RefPtr<Console> m_console; mutable RefPtrWillBePersistent<Console> m_console;
mutable RefPtrWillBePersistent<Navigator> m_navigator; mutable RefPtrWillBePersistent<Navigator> m_navigator;
mutable RefPtrWillBePersistent<Location> m_location; mutable RefPtrWillBePersistent<Location> m_location;
mutable RefPtr<StyleMedia> m_media; mutable RefPtr<StyleMedia> m_media;
......
...@@ -44,14 +44,11 @@ namespace WebCore { ...@@ -44,14 +44,11 @@ namespace WebCore {
class ScriptArguments; class ScriptArguments;
class WorkerConsole FINAL : public RefCountedWillBeRefCountedGarbageCollected<WorkerConsole>, public ConsoleBase, public ScriptWrappable { class WorkerConsole FINAL : public ConsoleBase, public ScriptWrappable {
public: public:
using RefCountedWillBeRefCountedGarbageCollected<WorkerConsole>::ref;
using RefCountedWillBeRefCountedGarbageCollected<WorkerConsole>::deref;
static PassRefPtrWillBeRawPtr<WorkerConsole> create(WorkerGlobalScope* scope) static PassRefPtrWillBeRawPtr<WorkerConsole> create(WorkerGlobalScope* scope)
{ {
return adoptRefWillBeRefCountedGarbageCollected(new WorkerConsole(scope)); return adoptRefWillBeNoop(new WorkerConsole(scope));
} }
virtual ~WorkerConsole(); virtual ~WorkerConsole();
...@@ -64,9 +61,6 @@ protected: ...@@ -64,9 +61,6 @@ protected:
private: private:
explicit WorkerConsole(WorkerGlobalScope*); explicit WorkerConsole(WorkerGlobalScope*);
virtual void refConsole() OVERRIDE { ref(); }
virtual void derefConsole() OVERRIDE { deref(); }
RawPtrWillBeMember<WorkerGlobalScope> m_scope; RawPtrWillBeMember<WorkerGlobalScope> m_scope;
}; };
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
*/ */
[ [
NoInterfaceObject, NoInterfaceObject
WillBeGarbageCollected
] interface WorkerConsole : ConsoleBase { ] interface WorkerConsole : ConsoleBase {
}; };
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