зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1351777 - Remove aSuccess argument to RenderFrame constructor. r=dvander
Instead we can use the otherwise-unused function to check if initialization worked. Technically, because of the way RenderFrame construction works, whether or not initialization succeeds is exactly dependent on whether or not the frameloader is non-null, so we could even just use that to check success. But this feels slightly more readable/cleaner. MozReview-Commit-ID: CGiIAA1h6V7 --HG-- extra : rebase_source : 2d4504f7d5fde3c394edca14fe01840c1738d197
This commit is contained in:
Родитель
c44b0fcca0
Коммит
ec035abf34
|
@ -649,8 +649,8 @@ TabParent::InitRenderFrame()
|
|||
RefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
|
||||
MOZ_ASSERT(frameLoader);
|
||||
if (frameLoader) {
|
||||
bool success;
|
||||
RenderFrameParent* renderFrame = new RenderFrameParent(frameLoader, &success);
|
||||
RenderFrameParent* renderFrame = new RenderFrameParent(frameLoader);
|
||||
MOZ_ASSERT(renderFrame->IsInitted());
|
||||
uint64_t layersId = renderFrame->GetLayersId();
|
||||
AddTabParentToTable(layersId, this);
|
||||
if (!SendPRenderFrameConstructor(renderFrame)) {
|
||||
|
@ -2490,11 +2490,9 @@ TabParent::AllocPRenderFrameParent()
|
|||
{
|
||||
MOZ_ASSERT(ManagedPRenderFrameParent().IsEmpty());
|
||||
RefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
|
||||
bool success = false;
|
||||
|
||||
RenderFrameParent* rfp =
|
||||
new RenderFrameParent(frameLoader, &success);
|
||||
if (success) {
|
||||
RenderFrameParent* rfp = new RenderFrameParent(frameLoader);
|
||||
if (rfp->IsInitted()) {
|
||||
uint64_t layersId = rfp->GetLayersId();
|
||||
AddTabParentToTable(layersId, this);
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ GetFrom(nsFrameLoader* aFrameLoader)
|
|||
return nsContentUtils::LayerManagerForDocument(doc);
|
||||
}
|
||||
|
||||
RenderFrameParent::RenderFrameParent(nsFrameLoader* aFrameLoader, bool* aSuccess)
|
||||
RenderFrameParent::RenderFrameParent(nsFrameLoader* aFrameLoader)
|
||||
: mLayersId(0)
|
||||
, mFrameLoader(aFrameLoader)
|
||||
, mFrameLoaderDestroyed(false)
|
||||
|
@ -93,7 +93,6 @@ RenderFrameParent::RenderFrameParent(nsFrameLoader* aFrameLoader, bool* aSuccess
|
|||
, mInitted(false)
|
||||
{
|
||||
mInitted = Init(aFrameLoader);
|
||||
*aSuccess = mInitted;
|
||||
}
|
||||
|
||||
RenderFrameParent::~RenderFrameParent()
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
* chosen, then RenderFrameParent will watch input events and use
|
||||
* them to asynchronously pan and zoom.
|
||||
*/
|
||||
RenderFrameParent(nsFrameLoader* aFrameLoader, bool* aSuccess);
|
||||
explicit RenderFrameParent(nsFrameLoader* aFrameLoader);
|
||||
virtual ~RenderFrameParent();
|
||||
|
||||
bool Init(nsFrameLoader* aFrameLoader);
|
||||
|
|
Загрузка…
Ссылка в новой задаче