Various fixes for nsChildView, including uninitialized member pointer. b=553702 r=roc

This commit is contained in:
Josh Aas 2010-03-20 11:05:47 -04:00
parent d3946e8eb6
commit 05b617eb69
2 changed files with 9 additions and 2 deletions

View File

@ -70,6 +70,7 @@ class nsChildView;
class nsCocoaWindow;
union nsPluginPort;
#ifndef NP_NO_CARBON
enum {
// Currently focused ChildView (while this TSM document is active).
// Transient (only set while TSMProcessRawKeyEvent() is processing a key
@ -90,6 +91,7 @@ enum {
// (PluginKeyEventsHandler()) to catch these events and pass them to Gecko
// (which in turn passes them to the plugin).
extern "C" long TSMProcessRawKeyEvent(EventRef carbonEvent);
#endif // NP_NO_CARBON
@interface NSEvent (Undocumented)
@ -151,11 +153,13 @@ extern "C" long TSMProcessRawKeyEvent(EventRef carbonEvent);
// re-establish the connection to the service manager many times per second
// when handling |draggingUpdated:| messages.
nsIDragService* mDragService;
#ifndef NP_NO_CARBON
// For use with plugins, so that we can support IME in them. We can't use
// Cocoa TSM documents (those created and managed by the NSTSMInputContext
// class) -- for some reason TSMProcessRawKeyEvent() doesn't work with them.
TSMDocumentID mPluginTSMDoc;
#endif
// Simple gestures support
//

View File

@ -463,6 +463,7 @@ nsChildView::nsChildView() : nsBaseWidget()
, mDrawing(PR_FALSE)
, mPluginDrawing(PR_FALSE)
, mPluginIsCG(PR_FALSE)
, mPluginInstanceOwner(nsnull)
{
#ifdef PR_LOGGING
if (!sCocoaLog) {
@ -2173,7 +2174,9 @@ NSEvent* gLastDragMouseDownEvent = nil;
mLastMouseDownEvent = nil;
mDragService = nsnull;
#ifndef NP_NO_CARBON
mPluginTSMDoc = nil;
#endif
mGestureState = eGestureState_None;
mCumulativeMagnification = 0.0;
@ -5076,7 +5079,7 @@ static const char* ToEscapedString(NSString* aString, nsCAutoString& aBuf)
// Firefox) create a TSM document that (somehow) makes the input window behave
// badly when it contains more than one kind of input (say Hiragana and
// Romaji). (We can't just use the per-NSView TSM documents that Cocoa
// provices (those created and managed by the NSTSMInputContext class) -- for
// provides (those created and managed by the NSTSMInputContext class) -- for
// some reason TSMProcessRawKeyEvent() doesn't work with them.)
- (void)activatePluginTSMDoc
{