Bug 1062053 part.2 Rename nsTextStore::sTsfClientId to nsTextStore::sClientId r=jimm
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 11 Sep 2014 12:56:10 +0900
changeset 204726 47d2dd4ecad1ddd3b05a064c4b2c261e9b75db6e
parent 204725 ad0c990e9fdc79f17809a7bba822bd656fa99da4
child 204727 f68c40ef23276ca3e6f4d612046545afc77a7334
push id48986
push usermasayuki@d-toybox.com
push dateThu, 11 Sep 2014 03:56:41 +0000
treeherdermozilla-inbound@47d2dd4ecad1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1062053
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1062053 part.2 Rename nsTextStore::sTsfClientId to nsTextStore::sClientId r=jimm
widget/windows/nsTextStore.cpp
widget/windows/nsTextStore.h
--- a/widget/windows/nsTextStore.cpp
+++ b/widget/windows/nsTextStore.cpp
@@ -1144,18 +1144,18 @@ TSFStaticSink::IsTIPCategoryKeyboard(REF
 StaticRefPtr<ITfThreadMgr> nsTextStore::sThreadMgr;
 StaticRefPtr<ITfMessagePump> nsTextStore::sMessagePump;
 StaticRefPtr<ITfKeystrokeMgr> nsTextStore::sKeystrokeMgr;
 StaticRefPtr<ITfDisplayAttributeMgr> nsTextStore::sDisplayAttrMgr;
 StaticRefPtr<ITfCategoryMgr> nsTextStore::sCategoryMgr;
 StaticRefPtr<ITfDocumentMgr> nsTextStore::sDisabledDocumentMgr;
 StaticRefPtr<ITfContext> nsTextStore::sDisabledContext;
 StaticRefPtr<ITfInputProcessorProfiles> nsTextStore::sInputProcessorProfiles;
-DWORD         nsTextStore::sTsfClientId  = 0;
 StaticRefPtr<nsTextStore> nsTextStore::sEnabledTextStore;
+DWORD nsTextStore::sClientId  = 0;
 
 bool nsTextStore::sCreateNativeCaretForATOK = false;
 bool nsTextStore::sDoNotReturnNoLayoutErrorToFreeChangJie = false;
 bool nsTextStore::sDoNotReturnNoLayoutErrorToEasyChangjei = false;
 
 #define TIP_NAME_BEGINS_WITH_ATOK \
   (NS_LITERAL_STRING("ATOK "))
 // NOTE: Free ChangJie 2010 missspells its name...
@@ -1219,17 +1219,17 @@ nsTextStore::Init(nsWindowBase* aWidget)
     PR_LOG(sTextStoreLog, PR_LOG_ERROR,
       ("TSF: 0x%p   nsTextStore::Init() FAILED to create DocumentMgr "
        "(0x%08X)", this, hr));
     return false;
   }
   mWidget = aWidget;
 
   // Create context and add it to document manager
-  hr = mDocumentMgr->CreateContext(sTsfClientId, 0,
+  hr = mDocumentMgr->CreateContext(sClientId, 0,
                                    static_cast<ITextStoreACP*>(this),
                                    getter_AddRefs(mContext), &mEditCookie);
   if (FAILED(hr)) {
     PR_LOG(sTextStoreLog, PR_LOG_ERROR,
       ("TSF: 0x%p   nsTextStore::Init() FAILED to create the context "
        "(0x%08X)", this, hr));
     mDocumentMgr = nullptr;
     return false;
@@ -4410,17 +4410,17 @@ nsTextStore::SetIMEOpenState(bool aState
 
   VARIANT variant;
   variant.vt = VT_I4;
   variant.lVal = aState;
   PR_LOG(sTextStoreLog, PR_LOG_DEBUG,
          ("TSF:   nsTextStore::SetIMEOpenState(), setting "
           "0x%04X to GUID_COMPARTMENT_KEYBOARD_OPENCLOSE...",
           variant.lVal));
-  comp->SetValue(sTsfClientId, &variant);
+  comp->SetValue(sClientId, &variant);
 }
 
 // static
 bool
 nsTextStore::GetIMEOpenState(void)
 {
   nsRefPtr<ITfCompartment> comp;
   if (!GetCompartment(sThreadMgr,
@@ -4486,17 +4486,17 @@ nsTextStore::MarkContextAsKeyboardDisabl
             "aContext=0x%p...", aContext));
     return;
   }
 
   PR_LOG(sTextStoreLog, PR_LOG_DEBUG,
          ("TSF: nsTextStore::MarkContextAsKeyboardDisabled(), setting "
           "to disable context 0x%p...",
           aContext));
-  comp->SetValue(sTsfClientId, &variant_int4_value1);
+  comp->SetValue(sClientId, &variant_int4_value1);
 }
 
 // static
 void
 nsTextStore::MarkContextAsEmpty(ITfContext* aContext)
 {
   VARIANT variant_int4_value1;
   variant_int4_value1.vt = VT_I4;
@@ -4510,17 +4510,17 @@ nsTextStore::MarkContextAsEmpty(ITfConte
            ("TSF: nsTextStore::MarkContextAsEmpty() failed"
             "aContext=0x%p...", aContext));
     return;
   }
 
   PR_LOG(sTextStoreLog, PR_LOG_DEBUG,
          ("TSF: nsTextStore::MarkContextAsEmpty(), setting "
           "to mark empty context 0x%p...", aContext));
-  comp->SetValue(sTsfClientId, &variant_int4_value1);
+  comp->SetValue(sClientId, &variant_int4_value1);
 }
 
 // static
 void
 nsTextStore::Initialize()
 {
 #ifdef PR_LOGGING
   if (!sTextStoreLog) {
@@ -4590,17 +4590,17 @@ nsTextStore::Initialize()
                                  getter_AddRefs(keystrokeMgr));
   if (FAILED(hr) || !keystrokeMgr) {
     PR_LOG(sTextStoreLog, PR_LOG_ERROR,
       ("TSF:   nsTextStore::Initialize() FAILED to "
        "QI keystroke manager from the thread manager, hr=0x%08X", hr));
     return;
   }
 
-  hr = threadMgr->Activate(&sTsfClientId);
+  hr = threadMgr->Activate(&sClientId);
   if (FAILED(hr)) {
     PR_LOG(sTextStoreLog, PR_LOG_ERROR,
       ("TSF:   nsTextStore::Initialize() FAILED to activate, hr=0x%08X", hr));
     return;
   }
 
   nsRefPtr<ITfDisplayAttributeMgr> displayAttributeMgr;
   hr = ::CoCreateInstance(CLSID_TF_DisplayAttributeMgr, nullptr,
@@ -4630,17 +4630,17 @@ nsTextStore::Initialize()
     PR_LOG(sTextStoreLog, PR_LOG_ERROR,
       ("TSF:   nsTextStore::Initialize() FAILED to create "
        "a document manager for disabled mode, hr=0x%08X", hr));
     return;
   }
 
   nsRefPtr<ITfContext> disabledContext;
   DWORD editCookie = 0;
-  hr = disabledDocumentMgr->CreateContext(sTsfClientId, 0, nullptr,
+  hr = disabledDocumentMgr->CreateContext(sClientId, 0, nullptr,
                                           getter_AddRefs(disabledContext),
                                           &editCookie);
   if (FAILED(hr) || !disabledContext) {
     PR_LOG(sTextStoreLog, PR_LOG_ERROR,
       ("TSF:   nsTextStore::Initialize() FAILED to create "
        "a context for disabled mode, hr=0x%08X", hr));
     return;
   }
@@ -4675,22 +4675,22 @@ nsTextStore::Initialize()
     Preferences::GetBool(
       "intl.tsf.hack.free_chang_jie.do_not_return_no_layout_error", true);
   sDoNotReturnNoLayoutErrorToEasyChangjei =
     Preferences::GetBool(
       "intl.tsf.hack.easy_changjei.do_not_return_no_layout_error", true);
 
   PR_LOG(sTextStoreLog, PR_LOG_ALWAYS,
     ("TSF:   nsTextStore::Initialize(), sThreadMgr=0x%p, "
-     "sTsfClientId=0x%08X, sDisplayAttrMgr=0x%p, "
+     "sClientId=0x%08X, sDisplayAttrMgr=0x%p, "
      "sCategoryMgr=0x%p, sDisabledDocumentMgr=0x%p, sDisabledContext=%p, "
      "sCreateNativeCaretForATOK=%s, "
      "sDoNotReturnNoLayoutErrorToFreeChangJie=%s, "
      "sDoNotReturnNoLayoutErrorToEasyChangjei=%s",
-     sThreadMgr.get(), sTsfClientId, sDisplayAttrMgr.get(),
+     sThreadMgr.get(), sClientId, sDisplayAttrMgr.get(),
      sCategoryMgr.get(), sDisabledDocumentMgr.get(), sDisabledContext.get(),
      GetBoolName(sCreateNativeCaretForATOK),
      GetBoolName(sDoNotReturnNoLayoutErrorToFreeChangJie),
      GetBoolName(sDoNotReturnNoLayoutErrorToEasyChangjei)));
 }
 
 // static
 void
@@ -4701,17 +4701,17 @@ nsTextStore::Terminate(void)
   TSFStaticSink::Shutdown();
 
   sDisplayAttrMgr = nullptr;
   sCategoryMgr = nullptr;
   sEnabledTextStore = nullptr;
   sDisabledDocumentMgr = nullptr;
   sDisabledContext = nullptr;
   sInputProcessorProfiles = nullptr;
-  sTsfClientId = 0;
+  sClientId = 0;
   if (sThreadMgr) {
     sThreadMgr->Deactivate();
     sThreadMgr = nullptr;
     sMessagePump = nullptr;
     sKeystrokeMgr = nullptr;
   }
 }
 
--- a/widget/windows/nsTextStore.h
+++ b/widget/windows/nsTextStore.h
@@ -745,30 +745,31 @@ protected:
   static mozilla::StaticRefPtr<ITfMessagePump> sMessagePump;
   // sKeystrokeMgr is QI'ed from sThreadMgr
   static mozilla::StaticRefPtr<ITfKeystrokeMgr> sKeystrokeMgr;
   // TSF display attribute manager
   static mozilla::StaticRefPtr<ITfDisplayAttributeMgr> sDisplayAttrMgr;
   // TSF category manager
   static mozilla::StaticRefPtr<ITfCategoryMgr> sCategoryMgr;
 
-  // TSF client ID for the current application
-  static DWORD          sTsfClientId;
   // Current text store which is managing a keyboard enabled editor (i.e.,
   // editable editor).  Currently only ONE nsTextStore instance is ever used,
   // although Create is called when an editor is focused and Destroy called
   // when the focused editor is blurred.
   static mozilla::StaticRefPtr<nsTextStore> sEnabledTextStore;
 
   // For IME (keyboard) disabled state:
   static mozilla::StaticRefPtr<ITfDocumentMgr> sDisabledDocumentMgr;
   static mozilla::StaticRefPtr<ITfContext> sDisabledContext;
 
   static mozilla::StaticRefPtr<ITfInputProcessorProfiles>
     sInputProcessorProfiles;
 
+  // TSF client ID for the current application
+  static DWORD sClientId;
+
   // Enables/Disables hack for specific TIP.
   static bool sCreateNativeCaretForATOK;
   static bool sDoNotReturnNoLayoutErrorToFreeChangJie;
   static bool sDoNotReturnNoLayoutErrorToEasyChangjei;
 };
 
 #endif /*NSTEXTSTORE_H_*/