mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 18:04:46 +00:00
Bug 1193762 part 4 - Avoid nsCOMPtr in ternary operator; r=froydnj
This commit is contained in:
parent
c3a56bf17e
commit
585263dafa
@ -159,7 +159,10 @@ public:
|
||||
// nullptr if the import is not yet ready.
|
||||
nsIDocument* GetImport()
|
||||
{
|
||||
return mReady ? mDocument : nullptr;
|
||||
if (!mReady) {
|
||||
return nullptr;
|
||||
}
|
||||
return mDocument;
|
||||
}
|
||||
|
||||
// There is only one referring link that is marked as primary link per
|
||||
@ -170,7 +173,10 @@ public:
|
||||
// a new import link is added to the manager.
|
||||
nsINode* GetMainReferrer()
|
||||
{
|
||||
return mLinks.IsEmpty() ? nullptr : mLinks[mMainReferrer];
|
||||
if (mLinks.IsEmpty()) {
|
||||
return nullptr;
|
||||
}
|
||||
return mLinks[mMainReferrer];
|
||||
}
|
||||
|
||||
// An import is not only blocked by its import children, but also
|
||||
|
@ -52,7 +52,10 @@ public:
|
||||
|
||||
static nsIGlobalObject* IncumbentGlobal() {
|
||||
ScriptSettingsStackEntry *entry = Top();
|
||||
return entry ? entry->mGlobalObject : nullptr;
|
||||
if (!entry) {
|
||||
return nullptr;
|
||||
}
|
||||
return entry->mGlobalObject;
|
||||
}
|
||||
|
||||
static ScriptSettingsStackEntry* EntryPoint() {
|
||||
@ -70,7 +73,10 @@ public:
|
||||
|
||||
static nsIGlobalObject* EntryGlobal() {
|
||||
ScriptSettingsStackEntry *entry = EntryPoint();
|
||||
return entry ? entry->mGlobalObject : nullptr;
|
||||
if (!entry) {
|
||||
return nullptr;
|
||||
}
|
||||
return entry->mGlobalObject;
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -2085,7 +2085,10 @@ nsIScriptContext *
|
||||
nsGlobalWindow::GetScriptContext()
|
||||
{
|
||||
nsGlobalWindow* outer = GetOuterWindowInternal();
|
||||
return outer ? outer->mContext : nullptr;
|
||||
if (!outer) {
|
||||
return nullptr;
|
||||
}
|
||||
return outer->mContext;
|
||||
}
|
||||
|
||||
JSObject *
|
||||
|
@ -548,7 +548,10 @@ nsXMLHttpRequest::GetResponseXML(ErrorResult& aRv)
|
||||
mWarnAboutSyncHtml = false;
|
||||
LogMessage("HTMLSyncXHRWarning", GetOwner());
|
||||
}
|
||||
return (XML_HTTP_REQUEST_DONE & mState) ? mResponseXML : nullptr;
|
||||
if (!(XML_HTTP_REQUEST_DONE & mState)) {
|
||||
return nullptr;
|
||||
}
|
||||
return mResponseXML;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -324,7 +324,11 @@ nsEditorEventListener::GetFocusedRootContent()
|
||||
nsIDocument* composedDoc = focusedContent->GetComposedDoc();
|
||||
NS_ENSURE_TRUE(composedDoc, nullptr);
|
||||
|
||||
return composedDoc->HasFlag(NODE_IS_EDITABLE) ? nullptr : focusedContent;
|
||||
if (composedDoc->HasFlag(NODE_IS_EDITABLE)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return focusedContent;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -465,7 +465,10 @@ public:
|
||||
inline nsIXPCFunctionThisTranslator* Find(REFNSIID iid)
|
||||
{
|
||||
auto entry = static_cast<Entry*>(mTable.Search(&iid));
|
||||
return entry ? entry->value : nullptr;
|
||||
if (!entry) {
|
||||
return nullptr;
|
||||
}
|
||||
return entry->value;
|
||||
}
|
||||
|
||||
inline nsIXPCFunctionThisTranslator* Add(REFNSIID iid,
|
||||
|
@ -191,7 +191,12 @@ public:
|
||||
*/
|
||||
static void EndSwapDocShells(nsISupports* aSupports, void*);
|
||||
|
||||
nsIWidget* GetWidget() override { return mInnerView ? mWidget : nullptr; }
|
||||
nsIWidget* GetWidget() override {
|
||||
if (!mInnerView) {
|
||||
return nullptr;
|
||||
}
|
||||
return mWidget;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjust the plugin's idea of its size, using aSize as its new size.
|
||||
|
Loading…
Reference in New Issue
Block a user