Bug 1672420 - Initialise SyncObject in non-e10s mode. r=nical

We're not always in a content process!

Differential Revision: https://phabricator.services.mozilla.com/D94579
This commit is contained in:
Jean-Yves Avenard 2020-10-24 06:11:47 +00:00
Родитель 14a4c90302
Коммит c7420b1155
2 изменённых файлов: 24 добавлений и 22 удалений

Просмотреть файл

@ -7,9 +7,10 @@
#include "SyncObject.h"
#ifdef XP_WIN
# include "mozilla/layers/TextureD3D11.h"
# include "mozilla/gfx/DeviceManagerDx.h"
# include "mozilla/layers/TextureD3D11.h"
#endif
#include "nsIXULRuntime.h" // for BrowserTabsRemoteAutostart
namespace mozilla {
namespace layers {
@ -41,7 +42,7 @@ SyncObjectClient::CreateSyncObjectClientForContentDevice(SyncHandle aHandle) {
return nullptr;
}
MOZ_ASSERT(XRE_IsContentProcess());
MOZ_ASSERT(XRE_IsContentProcess() || !mozilla::BrowserTabsRemoteAutostart());
return MakeAndAddRef<SyncObjectD3D11ClientContentDevice>(aHandle);
#endif

Просмотреть файл

@ -4,43 +4,44 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "ClientLayerManager.h" // for ClientLayerManager
#include "ShadowLayers.h"
#include <set> // for _Rb_tree_const_iterator, etc
#include <vector> // for vector
#include "GeckoProfiler.h" // for AUTO_PROFILER_LABEL
#include "ISurfaceAllocator.h" // for IsSurfaceDescriptorValid
#include "Layers.h" // for Layer
#include "RenderTrace.h" // for RenderTraceScope
#include "gfx2DGlue.h" // for Moz2D transition helpers
#include "gfxPlatform.h" // for gfxImageFormat, gfxPlatform
//#include "gfxSharedImageSurface.h" // for gfxSharedImageSurface
#include "ipc/IPCMessageUtils.h" // for gfxContentType, null_t
#include <set> // for _Rb_tree_const_iterator, etc
#include <vector> // for vector
#include "ClientLayerManager.h" // for ClientLayerManager
#include "GeckoProfiler.h" // for AUTO_PROFILER_LABEL
#include "IPDLActor.h"
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/gfx/Point.h" // for IntSize
#include "ISurfaceAllocator.h" // for IsSurfaceDescriptorValid
#include "Layers.h" // for Layer
#include "RenderTrace.h" // for RenderTraceScope
#include "gfx2DGlue.h" // for Moz2D transition helpers
#include "gfxPlatform.h" // for gfxImageFormat, gfxPlatform
#include "ipc/IPCMessageUtils.h" // for gfxContentType, null_t
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/gfx/Point.h" // for IntSize
#include "mozilla/layers/CompositableClient.h" // for CompositableClient, etc
#include "mozilla/layers/CompositorBridgeChild.h"
#include "mozilla/layers/ContentClient.h"
#include "mozilla/layers/ImageDataSerializer.h"
#include "mozilla/layers/ImageBridgeChild.h"
#include "mozilla/layers/ImageDataSerializer.h"
#include "mozilla/layers/LayerTransactionChild.h"
#include "mozilla/layers/LayersMessages.h" // for Edit, etc
#include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor, etc
#include "mozilla/layers/LayersTypes.h" // for MOZ_LAYERS_LOG
#include "mozilla/layers/LayerTransactionChild.h"
#include "mozilla/layers/PTextureChild.h"
#include "mozilla/layers/SyncObject.h"
#ifdef XP_DARWIN
# include "mozilla/layers/TextureSync.h"
#endif
#include "ShadowLayerUtils.h"
#include "mozilla/layers/TextureClient.h" // for TextureClient
#include "mozilla/mozalloc.h" // for operator new, etc
#include "nsTArray.h" // for AutoTArray, nsTArray, etc
#include "nsXULAppAPI.h" // for XRE_GetProcessType, etc
#include "mozilla/ReentrantMonitor.h"
#include "mozilla/StaticPrefs_layers.h"
#include "mozilla/layers/TextureClient.h" // for TextureClient
#include "mozilla/mozalloc.h" // for operator new, etc
#include "nsIXULRuntime.h" // for BrowserTabsRemoteAutostart
#include "nsTArray.h" // for AutoTArray, nsTArray, etc
#include "nsXULAppAPI.h" // for XRE_GetProcessType, etc
namespace mozilla {
namespace ipc {
@ -146,7 +147,7 @@ void KnowsCompositor::IdentifyTextureHost(
const TextureFactoryIdentifier& aIdentifier) {
mTextureFactoryIdentifier = aIdentifier;
if (XRE_IsContentProcess()) {
if (XRE_IsContentProcess() || !mozilla::BrowserTabsRemoteAutostart()) {
mSyncObject = SyncObjectClient::CreateSyncObjectClientForContentDevice(
aIdentifier.mSyncHandle);
}