Skip to content

Commit

Permalink
Change nsRefPtrs to RefPtrs
Browse files Browse the repository at this point in the history
  • Loading branch information
rainemak committed Dec 19, 2016
1 parent 281380d commit 5c3acc6
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 24 deletions.
Expand Up @@ -97,7 +97,7 @@ WebBrowserPersistDocumentParent::AllocPWebBrowserPersistResourcesParent()
bool
WebBrowserPersistDocumentParent::DeallocPWebBrowserPersistResourcesParent(PWebBrowserPersistResourcesParent* aActor)
{
// Turn the ref held by IPC back into an nsRefPtr.
// Turn the ref held by IPC back into an RefPtr.
RefPtr<WebBrowserPersistResourcesParent> actor =
already_AddRefed<WebBrowserPersistResourcesParent>(
static_cast<WebBrowserPersistResourcesParent*>(aActor));
Expand Down
Expand Up @@ -290,7 +290,7 @@ struct DelayedDeleteContentParentTask : public nsRunnable
// No-op
NS_IMETHODIMP Run() { return NS_OK; }

nsRefPtr<EmbedLiteAppProcessParent> mObj;
RefPtr<EmbedLiteAppProcessParent> mObj;
};

}
Expand Down
Expand Up @@ -51,7 +51,7 @@ EmbedLiteCompositorProcessParent::Create(Transport* aTransport, ProcessId aOther
gfxPlatform::InitLayersIPC();
gfxPrefs::GetSingleton();

nsRefPtr<EmbedLiteCompositorProcessParent> cpcp =
RefPtr<EmbedLiteCompositorProcessParent> cpcp =
new EmbedLiteCompositorProcessParent(aTransport, aOtherProcess, aSurfaceWidth, aSurfaceHeight, id);
ProcessHandle handle;
if (!base::OpenProcessHandle(aOtherProcess, &handle)) {
Expand Down
Expand Up @@ -111,18 +111,18 @@ class EmbedLiteCompositorProcessParent final : public PCompositorParent,
// There can be many CPCPs, and IPDL-generated code doesn't hold a
// reference to top-level actors. So we hold a reference to
// ourself. This is released (deferred) in ActorDestroy().
nsRefPtr<EmbedLiteCompositorProcessParent> mSelfRef;
RefPtr<EmbedLiteCompositorProcessParent> mSelfRef;
Transport* mTransport;
// Child side's process Id.
base::ProcessId mChildProcessId;

nsRefPtr<CompositorThreadHolder> mCompositorThreadHolder;
RefPtr<CompositorThreadHolder> mCompositorThreadHolder;
// If true, we should send a RemotePaintIsReady message when the layer transaction
// is received
bool mNotifyAfterRemotePaint;

nsRefPtr<LayerManagerComposite> mLayerManager;
nsRefPtr<Compositor> mCompositor;
RefPtr<LayerManagerComposite> mLayerManager;
RefPtr<Compositor> mCompositor;
RefPtr<AsyncCompositionManager> mCompositionManager;
uint64_t mCompositorID;
nsIntSize mEGLSurfaceSize;
Expand Down
6 changes: 3 additions & 3 deletions embedding/embedlite/embedshared/EmbedLitePuppetWidget.cpp
Expand Up @@ -524,7 +524,7 @@ EmbedLitePuppetWidget::RemoveIMEComposition()
view->ResetInputState();
}

nsRefPtr<EmbedLitePuppetWidget> kungFuDeathGrip(this);
RefPtr<EmbedLitePuppetWidget> kungFuDeathGrip(this);

WidgetCompositionEvent textEvent(true, NS_COMPOSITION_CHANGE, this);
textEvent.time = PR_Now() / 1000;
Expand All @@ -547,7 +547,7 @@ EmbedLitePuppetWidget::GetGLContext() const
void* surface = nullptr;
if (window && window->GetListener()->RequestGLContext(context, surface)) {
MOZ_ASSERT(context && surface);
nsRefPtr<GLContext> mozContext = GLContextProvider::CreateWrappingExisting(context, surface);
RefPtr<GLContext> mozContext = GLContextProvider::CreateWrappingExisting(context, surface);
if (!mozContext || !mozContext->Init()) {
NS_ERROR("Failed to initialize external GL context!");
return nullptr;
Expand Down Expand Up @@ -714,7 +714,7 @@ void EmbedLitePuppetWidget::CreateCompositor(int aWidth, int aHeight)

mCompositorParent = NewCompositorParent(aWidth, aHeight);
MessageChannel* parentChannel = mCompositorParent->GetIPCChannel();
nsRefPtr<ClientLayerManager> lm = new ClientLayerManager(this);
RefPtr<ClientLayerManager> lm = new ClientLayerManager(this);
MessageLoop* childMessageLoop = CompositorParent::CompositorLoop();
mCompositorChild = new CompositorChild(lm);
mCompositorChild->Open(parentChannel, childMessageLoop, ipc::ChildSide);
Expand Down
2 changes: 1 addition & 1 deletion embedding/embedlite/embedshared/EmbedLiteViewBaseChild.cpp
Expand Up @@ -1191,7 +1191,7 @@ EmbedLiteViewBaseChild::GetPresShellResolution() const
if (!shell) {
return 1.0f;
}
return shell->GetXResolution();
return shell->GetResolution();
}

already_AddRefed<nsIDocument>
Expand Down
4 changes: 2 additions & 2 deletions embedding/embedlite/embedshared/EmbedLiteViewBaseChild.h
Expand Up @@ -187,15 +187,15 @@ class EmbedLiteViewBaseChild : public PEmbedLiteViewChild,
EmbedLiteWindowBaseChild* mWindow; // Not owned
nsCOMPtr<nsIWidget> mWidget;
nsCOMPtr<nsIWebBrowser> mWebBrowser;
nsRefPtr<WebBrowserChrome> mChrome;
RefPtr<WebBrowserChrome> mChrome;
nsCOMPtr<nsIDOMWindow> mDOMWindow;
nsCOMPtr<nsIWebNavigation> mWebNavigation;
bool mViewResized;
bool mWindowObserverRegistered;
bool mIsFocused;
nsIntMargin mMargins;

nsRefPtr<TabChildHelper> mHelper;
RefPtr<TabChildHelper> mHelper;
bool mIMEComposing;
uint64_t mPendingTouchPreventedBlockId;
CancelableTask* mInitWindowTask;
Expand Down
2 changes: 1 addition & 1 deletion embedding/embedlite/embedshared/EmbedLiteViewBaseParent.h
Expand Up @@ -142,7 +142,7 @@ class EmbedLiteViewBaseParent : public PEmbedLiteViewParent,

uint64_t mRootLayerTreeId;
GLuint mUploadTexture;
nsRefPtr<EmbedContentController> mController;
RefPtr<EmbedContentController> mController;

DISALLOW_EVIL_CONSTRUCTORS(EmbedLiteViewBaseParent);
};
Expand Down
2 changes: 1 addition & 1 deletion embedding/embedlite/embedthread/EmbedContentController.h
Expand Up @@ -73,7 +73,7 @@ class EmbedContentController : public mozilla::layers::GeckoContentController

public:
// todo: make this a member variable as prep for multiple views
nsRefPtr<mozilla::layers::APZCTreeManager> mAPZC;
RefPtr<mozilla::layers::APZCTreeManager> mAPZC;
};

}}
Expand Down
2 changes: 1 addition & 1 deletion embedding/embedlite/modules/EmbedLiteAppService.cpp
Expand Up @@ -47,7 +47,7 @@ namespace
{
protected:
nsCString mName;
nsRefPtr<EmbedLiteAppService> mService;
RefPtr<EmbedLiteAppService> mService;
nsCOMPtr<nsIEmbedMessageListener> mListener;
public:
AsyncArrayRemove(EmbedLiteAppService* service, const char* name, nsIEmbedMessageListener* aListener)
Expand Down
2 changes: 1 addition & 1 deletion embedding/embedlite/modules/EmbedLiteJSON.cpp
Expand Up @@ -31,7 +31,7 @@ NS_IMPL_ISUPPORTS(EmbedLiteJSON, nsIEmbedLiteJSON)
nsresult
CreateObjectStatic(nsIWritablePropertyBag2 * *aObject)
{
nsRefPtr<nsHashPropertyBag> hpb = new nsHashPropertyBag();
RefPtr<nsHashPropertyBag> hpb = new nsHashPropertyBag();
if (!hpb) {
return NS_ERROR_OUT_OF_MEMORY;
}
Expand Down
12 changes: 6 additions & 6 deletions embedding/embedlite/utils/TabChildHelper.cpp
Expand Up @@ -136,7 +136,7 @@ class EmbedUnloadScriptEvent : public nsRunnable
return NS_OK;
}

nsRefPtr<TabChildHelper> mTabChild;
RefPtr<TabChildHelper> mTabChild;
TabChildGlobal* mTabChildGlobal;
};

Expand Down Expand Up @@ -181,7 +181,7 @@ TabChildHelper::InitTabChildGlobal()
do_QueryInterface(window->GetChromeEventHandler());
NS_ENSURE_TRUE(chromeHandler, false);

nsRefPtr<TabChildGlobal> scope = new TabChildGlobal(this);
RefPtr<TabChildGlobal> scope = new TabChildGlobal(this);
NS_ENSURE_TRUE(scope, false);

mTabChildGlobal = scope;
Expand Down Expand Up @@ -366,14 +366,14 @@ TabChildHelper::DoSendAsyncMessage(JSContext* aCx,
{
nsCOMPtr<nsIMessageBroadcaster> globalIMessageManager =
do_GetService("@mozilla.org/globalmessagemanager;1");
nsRefPtr<nsFrameMessageManager> globalMessageManager =
RefPtr<nsFrameMessageManager> globalMessageManager =
static_cast<nsFrameMessageManager*>(globalIMessageManager.get());
nsRefPtr<nsFrameMessageManager> contentFrameMessageManager =
RefPtr<nsFrameMessageManager> contentFrameMessageManager =
static_cast<nsFrameMessageManager*>(mTabChildGlobal->mMessageManager.get());

nsCOMPtr<nsPIDOMWindow> pwindow = do_GetInterface(WebNavigation());
nsCOMPtr<nsIDOMWindow> window = do_QueryInterface(pwindow);
nsRefPtr<EmbedFrame> embedFrame = new EmbedFrame();
RefPtr<EmbedFrame> embedFrame = new EmbedFrame();
embedFrame->mWindow = window;
embedFrame->mMessageManager = mTabChildGlobal;
SameProcessCpowHolder cpows(js::GetRuntime(aCx), aCpows);
Expand Down Expand Up @@ -448,7 +448,7 @@ TabChildHelper::GetPresContext()
NS_ENSURE_TRUE(window, nullptr);
nsIDocShell* docShell = window->GetDocShell();
NS_ENSURE_TRUE(docShell, nullptr);
nsRefPtr<nsPresContext> presContext;
RefPtr<nsPresContext> presContext;
docShell->GetPresContext(getter_AddRefs(presContext));
return presContext;
}
Expand Down
2 changes: 1 addition & 1 deletion embedding/embedlite/utils/WebBrowserChrome.h
Expand Up @@ -80,7 +80,7 @@ class WebBrowserChrome : public nsIWebBrowserChrome2,
nsCOMPtr<nsIObserverService> mObserverService;
nsIEmbedBrowserChromeListener* mListener;
nsString mTitle;
nsRefPtr<mozilla::embedlite::TabChildHelper> mHelper;
RefPtr<mozilla::embedlite::TabChildHelper> mHelper;
};

#endif /* Header guard */
Expand Down

0 comments on commit 5c3acc6

Please sign in to comment.