зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1333968 - Label the DidComposite message (r=dvander)
MozReview-Commit-ID: 7cW7apxUJu0
This commit is contained in:
Родитель
5203251704
Коммит
30b9639c6e
|
@ -163,6 +163,7 @@ static const char BEFORE_FIRST_PAINT[] = "before-first-paint";
|
|||
|
||||
typedef nsDataHashtable<nsUint64HashKey, TabChild*> TabChildMap;
|
||||
static TabChildMap* sTabChildren;
|
||||
StaticMutex sTabChildrenMutex;
|
||||
|
||||
TabChildBase::TabChildBase()
|
||||
: mTabChildGlobal(nullptr)
|
||||
|
@ -1089,6 +1090,8 @@ TabChild::DestroyWindow()
|
|||
|
||||
|
||||
if (mLayersId != 0) {
|
||||
StaticMutexAutoLock lock(sTabChildrenMutex);
|
||||
|
||||
MOZ_ASSERT(sTabChildren);
|
||||
sTabChildren->Remove(mLayersId);
|
||||
if (!sTabChildren->Count()) {
|
||||
|
@ -2654,6 +2657,9 @@ TabChild::InitRenderingState(const TextureFactoryIdentifier& aTextureFactoryIden
|
|||
return;
|
||||
}
|
||||
|
||||
// Cache the TabGroup so it can be fetched off the main thread.
|
||||
TabGroup();
|
||||
|
||||
MOZ_ASSERT(aLayersId != 0);
|
||||
mTextureFactoryIdentifier = aTextureFactoryIdentifier;
|
||||
|
||||
|
@ -2669,6 +2675,8 @@ TabChild::InitRenderingState(const TextureFactoryIdentifier& aTextureFactoryIden
|
|||
|
||||
mRemoteFrame = static_cast<RenderFrameChild*>(aRenderFrame);
|
||||
if (aLayersId != 0) {
|
||||
StaticMutexAutoLock lock(sTabChildrenMutex);
|
||||
|
||||
if (!sTabChildren) {
|
||||
sTabChildren = new TabChildMap;
|
||||
}
|
||||
|
@ -2958,6 +2966,8 @@ TabChild::DoSendAsyncMessage(JSContext* aCx,
|
|||
/* static */ nsTArray<RefPtr<TabChild>>
|
||||
TabChild::GetAll()
|
||||
{
|
||||
StaticMutexAutoLock lock(sTabChildrenMutex);
|
||||
|
||||
nsTArray<RefPtr<TabChild>> list;
|
||||
if (!sTabChildren) {
|
||||
return list;
|
||||
|
@ -2984,6 +2994,7 @@ TabChild::GetFrom(nsIPresShell* aPresShell)
|
|||
TabChild*
|
||||
TabChild::GetFrom(uint64_t aLayersId)
|
||||
{
|
||||
StaticMutexAutoLock lock(sTabChildrenMutex);
|
||||
if (!sTabChildren) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -3333,9 +3344,15 @@ TabChildSHistoryListener::SHistoryDidUpdate(bool aTruncate /* = false */)
|
|||
mozilla::dom::TabGroup*
|
||||
TabChild::TabGroup()
|
||||
{
|
||||
if (mTabGroup) {
|
||||
return mTabGroup;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
nsCOMPtr<nsPIDOMWindowOuter> window = do_GetInterface(WebNavigation());
|
||||
MOZ_ASSERT(window);
|
||||
return window->TabGroup();
|
||||
mTabGroup = window->TabGroup();
|
||||
return mTabGroup;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
|
@ -769,6 +769,7 @@ private:
|
|||
|
||||
TextureFactoryIdentifier mTextureFactoryIdentifier;
|
||||
nsCOMPtr<nsIWebNavigation> mWebNav;
|
||||
RefPtr<mozilla::dom::TabGroup> mTabGroup;
|
||||
RefPtr<PuppetWidget> mPuppetWidget;
|
||||
nsCOMPtr<nsIURI> mLastURI;
|
||||
RenderFrameChild* mRemoteFrame;
|
||||
|
|
|
@ -927,6 +927,27 @@ CompositorBridgeChild::RecvObserveLayerUpdate(const uint64_t& aLayersId,
|
|||
return IPC_OK();
|
||||
}
|
||||
|
||||
already_AddRefed<nsIEventTarget>
|
||||
CompositorBridgeChild::GetSpecificMessageEventTarget(const Message& aMsg)
|
||||
{
|
||||
if (aMsg.type() != PCompositorBridge::Msg_DidComposite__ID) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint64_t layersId;
|
||||
PickleIterator iter(aMsg);
|
||||
if (!IPC::ReadParam(&aMsg, &iter, &layersId)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TabChild* tabChild = TabChild::GetFrom(layersId);
|
||||
if (!tabChild) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return do_AddRef(tabChild->TabGroup()->EventTargetFor(TaskCategory::Other));
|
||||
}
|
||||
|
||||
void
|
||||
CompositorBridgeChild::HoldUntilCompositableRefReleasedIfNecessary(TextureClient* aClient)
|
||||
{
|
||||
|
|
|
@ -265,6 +265,9 @@ private:
|
|||
const uint64_t& aEpoch,
|
||||
const bool& aActive) override;
|
||||
|
||||
already_AddRefed<nsIEventTarget>
|
||||
GetSpecificMessageEventTarget(const Message& aMsg) override;
|
||||
|
||||
// Class used to store the shared FrameMetrics, mutex, and APZCId in a hash table
|
||||
class SharedFrameMetricsData {
|
||||
public:
|
||||
|
|
Загрузка…
Ссылка в новой задаче