Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / editing / Editor.h
index 4008c05..cb42d35 100644 (file)
 namespace blink {
 
 class CompositeEditCommand;
-class DataTransfer;
-class EditCommand;
 class EditCommandComposition;
 class EditorClient;
 class EditorInternalCommand;
 class LocalFrame;
-class HTMLElement;
 class HitTestResult;
 class KillRing;
 class Pasteboard;
-class SharedBuffer;
-class SimpleFontData;
 class SpellChecker;
 class StylePropertySet;
-class Text;
 class TextEvent;
 class UndoStack;
 
@@ -71,8 +65,6 @@ public:
 
     EditorClient& client() const;
 
-    LocalFrame& frame() const { return m_frame; }
-
     CompositeEditCommand* lastEditCommand() { return m_lastEditCommand.get(); }
 
     void handleKeyboardEvent(KeyboardEvent*);
@@ -130,9 +122,10 @@ public:
     bool shouldStyleWithCSS() const { return m_shouldStyleWithCSS; }
 
     class Command {
+        STACK_ALLOCATED();
     public:
         Command();
-        Command(const EditorInternalCommand*, EditorCommandSource, PassRefPtr<LocalFrame>);
+        Command(const EditorInternalCommand*, EditorCommandSource, PassRefPtrWillBeRawPtr<LocalFrame>);
 
         bool execute(const String& parameter = String(), Event* triggeringEvent = 0) const;
         bool execute(Event* triggeringEvent) const;
@@ -148,9 +141,15 @@ public:
         // Returns 0 if this Command is not supported.
         int idForHistogram() const;
     private:
+        LocalFrame& frame() const
+        {
+            ASSERT(m_frame);
+            return *m_frame;
+        }
+
         const EditorInternalCommand* m_command;
         EditorCommandSource m_source;
-        RefPtr<LocalFrame> m_frame;
+        RefPtrWillBeMember<LocalFrame> m_frame;
     };
     Command command(const String& commandName); // Command source is CommandFromMenuOrKeyBinding.
     Command command(const String& commandName, EditorCommandSource);
@@ -238,7 +237,7 @@ public:
     void trace(Visitor*);
 
 private:
-    LocalFrame& m_frame;
+    RawPtrWillBeMember<LocalFrame> m_frame;
     RefPtrWillBeMember<CompositeEditCommand> m_lastEditCommand;
     int m_preventRevealSelection;
     bool m_shouldStartNewKillRingSequence;
@@ -251,6 +250,12 @@ private:
 
     explicit Editor(LocalFrame&);
 
+    LocalFrame& frame() const
+    {
+        ASSERT(m_frame);
+        return *m_frame;
+    }
+
     bool canDeleteRange(Range*) const;
 
     UndoStack* undoStack() const;