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

Side by Side Diff: Source/core/html/ime/InputMethodContext.h

Issue 307433003: Oilpan: Allocate all EventTarget derived types on the manged heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 28 matching lines...) Expand all
39 #include "wtf/RefPtr.h" 39 #include "wtf/RefPtr.h"
40 #include "wtf/text/AtomicString.h" 40 #include "wtf/text/AtomicString.h"
41 #include "wtf/text/WTFString.h" 41 #include "wtf/text/WTFString.h"
42 42
43 namespace WebCore { 43 namespace WebCore {
44 44
45 class ExecutionContext; 45 class ExecutionContext;
46 class InputMethodController; 46 class InputMethodController;
47 class Node; 47 class Node;
48 48
49 class InputMethodContext FINAL : public ScriptWrappable, public EventTargetWithI nlineData { 49 class InputMethodContext FINAL : public NoBaseWillBeRefCountedGarbageCollected<I nputMethodContext>, public ScriptWrappable, public EventTargetWithInlineData {
50 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(InputMethodContext);
50 public: 51 public:
51 static PassOwnPtr<InputMethodContext> create(HTMLElement*); 52 static PassOwnPtrWillBeRawPtr<InputMethodContext> create(HTMLElement*);
52 virtual ~InputMethodContext(); 53 virtual ~InputMethodContext();
53 54
55 #if ENABLE(OILPAN)
56 using RefCountedGarbageCollected<InputMethodContext>::ref;
57 using RefCountedGarbageCollected<InputMethodContext>::deref;
58 #else
54 void ref() { m_element->ref(); } 59 void ref() { m_element->ref(); }
55 void deref() { m_element->deref(); } 60 void deref() { m_element->deref(); }
61 #endif
haraken 2014/05/27 01:39:19 Can you avoid writing this by using REFCOUNTED_EVE
zerny-chromium 2014/05/27 07:34:33 Not without some #if hacking since InputMethodCont
56 62
57 String locale() const; 63 String locale() const;
58 HTMLElement* target() const; 64 HTMLElement* target() const;
59 unsigned compositionStartOffset(); 65 unsigned compositionStartOffset();
60 unsigned compositionEndOffset(); 66 unsigned compositionEndOffset();
61 void confirmComposition(); 67 void confirmComposition();
62 68
63 String compositionText() const; 69 String compositionText() const;
64 int selectionStart() const; 70 int selectionStart() const;
65 int selectionEnd() const; 71 int selectionEnd() const;
66 const Vector<unsigned>& segments(); 72 const Vector<unsigned>& segments();
67 73
68 virtual const AtomicString& interfaceName() const OVERRIDE; 74 virtual const AtomicString& interfaceName() const OVERRIDE;
69 virtual ExecutionContext* executionContext() const OVERRIDE; 75 virtual ExecutionContext* executionContext() const OVERRIDE;
70 76
71 DEFINE_ATTRIBUTE_EVENT_LISTENER(candidatewindowshow); 77 DEFINE_ATTRIBUTE_EVENT_LISTENER(candidatewindowshow);
72 DEFINE_ATTRIBUTE_EVENT_LISTENER(candidatewindowupdate); 78 DEFINE_ATTRIBUTE_EVENT_LISTENER(candidatewindowupdate);
73 DEFINE_ATTRIBUTE_EVENT_LISTENER(candidatewindowhide); 79 DEFINE_ATTRIBUTE_EVENT_LISTENER(candidatewindowhide);
74 80
75 void dispatchCandidateWindowShowEvent(); 81 void dispatchCandidateWindowShowEvent();
76 void dispatchCandidateWindowUpdateEvent(); 82 void dispatchCandidateWindowUpdateEvent();
77 void dispatchCandidateWindowHideEvent(); 83 void dispatchCandidateWindowHideEvent();
78 84
85 virtual void trace(Visitor*) OVERRIDE;
86
79 private: 87 private:
80 InputMethodContext(HTMLElement*); 88 InputMethodContext(HTMLElement*);
81 bool hasFocus() const; 89 bool hasFocus() const;
82 CompositionUnderline selectedSegment() const; 90 CompositionUnderline selectedSegment() const;
83 InputMethodController& inputMethodController() const; 91 InputMethodController& inputMethodController() const;
84 92
85 virtual void refEventTarget() OVERRIDE { ref(); } 93 virtual void refEventTarget() OVERRIDE { ref(); }
86 virtual void derefEventTarget() OVERRIDE { deref(); } 94 virtual void derefEventTarget() OVERRIDE { deref(); }
87 95
88 HTMLElement* m_element; 96 RawPtrWillBeMember<HTMLElement> m_element;
89 Vector<unsigned> m_segments; 97 Vector<unsigned> m_segments;
90 }; 98 };
91 99
92 } // namespace WebCore 100 } // namespace WebCore
93 101
94 #endif // InputMethodContext_h 102 #endif // InputMethodContext_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698