Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
merge mozilla-inbound to mozilla-central a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Jul 7, 2017
2 parents f39f243 + b6d5d7b commit 51ecb34
Show file tree
Hide file tree
Showing 32 changed files with 421 additions and 248 deletions.
4 changes: 4 additions & 0 deletions accessible/windows/msaa/Compatibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#include "Compatibility.h"

#include "mozilla/WindowsVersion.h"
#if defined(MOZ_CRASHREPORTER)
#include "nsExceptionHandler.h"
#endif // defined(MOZ_CRASHREPORTER)
#include "nsUnicharUtils.h"
#include "nsWindowsDllInterceptor.h"
#include "nsWinUtils.h"
Expand Down Expand Up @@ -353,11 +355,13 @@ UseIAccessibleProxyStub()
return true;
}

#if defined(MOZ_CRASHREPORTER)
// If we reach this point then something is seriously wrong with the
// IAccessible configuration in the computer's registry. Let's annotate this
// so that we can easily determine this condition during crash analysis.
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IAccessibleConfig"),
NS_LITERAL_CSTRING("NoSystemTypeLibOrPS"));
#endif // defined(MOZ_CRASHREPORTER)
return false;
}

Expand Down
21 changes: 20 additions & 1 deletion browser/components/preferences/in-content-new/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/* import-globals-from preferences.js */
/* import-globals-from ../../../../toolkit/mozapps/preferences/fontbuilder.js */

Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/Downloads.jsm");
Components.utils.import("resource://gre/modules/FileUtils.jsm");
Components.utils.import("resource:///modules/ShellService.jsm");
Expand Down Expand Up @@ -56,7 +57,25 @@ var gMainPane = {
// when the user will select the default. We refresh here periodically
// in case the default changes. On other Windows OS's defaults can also
// be set while the prefs are open.
window.setInterval(this.updateSetDefaultBrowser.bind(this), 1000);
let win = Services.wm.getMostRecentWindow("navigator:browser");

let pollForDefaultBrowser = () => {
let uri = win.gBrowser.currentURI.spec;

if ((uri == "about:preferences" || uri == "about:preferences#general") &&
document.visibilityState == "visible") {
this.updateSetDefaultBrowser();
}

// approximately a "requestIdleInterval"
window.setTimeout(() => {
window.requestIdleCallback(pollForDefaultBrowser);
}, 1000);
};

window.setTimeout(() => {
window.requestIdleCallback(pollForDefaultBrowser);
}, 1000);
}
}

Expand Down
5 changes: 5 additions & 0 deletions browser/components/shell/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
# 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/.

# For BinaryPath::GetLong for Windows
LOCAL_INCLUDES += [
'/xpcom/build'
]

XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
BROWSER_CHROME_MANIFESTS += ['test/browser.ini']

Expand Down
12 changes: 5 additions & 7 deletions browser/components/shell/nsWindowsShellService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "nsWindowsShellService.h"

#include "BinaryPath.h"
#include "city.h"
#include "imgIContainer.h"
#include "imgIRequest.h"
Expand Down Expand Up @@ -228,13 +229,10 @@ nsWindowsShellService::IsDefaultBrowser(bool aStartupCheck,
return NS_OK;
}

wchar_t exePath[MAX_BUF] = L"";
if (!::GetModuleFileNameW(0, exePath, MAX_BUF)) {
return NS_OK;
}
// Convert the path to a long path since GetModuleFileNameW returns the path
// that was used to launch Firefox which is not necessarily a long path.
if (!::GetLongPathNameW(exePath, exePath, MAX_BUF)) {
wchar_t exePath[MAXPATHLEN] = L"";
nsresult rv = BinaryPath::GetLong(exePath);

if (NS_FAILED(rv)) {
return NS_OK;
}

Expand Down
49 changes: 2 additions & 47 deletions dom/base/EventSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,39 +746,14 @@ EventSourceImpl::ParseSegment(const char* aBuffer, uint32_t aLength)
}
}

class DataAvailableRunnable final : public Runnable
{
private:
RefPtr<EventSourceImpl> mEventSourceImpl;
UniquePtr<char[]> mData;
uint32_t mLength;
public:
DataAvailableRunnable(EventSourceImpl* aEventSourceImpl,
UniquePtr<char[]> aData,
uint32_t aLength)
: Runnable("dom::DataAvailableRunnable")
, mEventSourceImpl(aEventSourceImpl)
, mData(Move(aData))
, mLength(aLength)
{
}

NS_IMETHOD Run() override
{
mEventSourceImpl->ParseSegment(mData.get(), mLength);
return NS_OK;
}
};

NS_IMETHODIMP
EventSourceImpl::OnDataAvailable(nsIRequest* aRequest,
nsISupports* aContext,
nsIInputStream* aInputStream,
uint64_t aOffset,
uint32_t aCount)
{
// Although we try to retarget OnDataAvailable to target thread, it may fail
// and fallback to main thread.
AssertIsOnTargetThread();
NS_ENSURE_ARG_POINTER(aInputStream);
if (IsClosed()) {
return NS_ERROR_ABORT;
Expand All @@ -788,28 +763,8 @@ EventSourceImpl::OnDataAvailable(nsIRequest* aRequest,
NS_ENSURE_SUCCESS(rv, rv);

uint32_t totalRead;
if (IsTargetThread()) {
rv = aInputStream->ReadSegments(EventSourceImpl::StreamReaderFunc, this,
return aInputStream->ReadSegments(EventSourceImpl::StreamReaderFunc, this,
aCount, &totalRead);
} else {
// This could be happened when fail to retarget to target thread and
// fallback to the main thread.
AssertIsOnMainThread();
auto data = MakeUniqueFallible<char[]>(aCount);
if (!data) {
return NS_ERROR_OUT_OF_MEMORY;
}
rv = aInputStream->Read(data.get(), aCount, &totalRead);
NS_ENSURE_SUCCESS(rv, rv);
MOZ_ASSERT(totalRead <= aCount, "EventSource read more than available!!");

nsCOMPtr<nsIRunnable> dataAvailable =
new DataAvailableRunnable(this, Move(data), totalRead);

MOZ_ASSERT(mWorkerPrivate);
rv = Dispatch(dataAvailable.forget(), NS_DISPATCH_NORMAL);
}
return rv;
}

NS_IMETHODIMP
Expand Down
16 changes: 8 additions & 8 deletions dom/html/HTMLFormElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,22 @@ HTMLFormElement::HTMLFormElement(already_AddRefed<mozilla::dom::NodeInfo>& aNode
mSelectedRadioButtons(2),
mRequiredRadioButtonCounts(2),
mValueMissingRadioGroups(2),
mGeneratingSubmit(false),
mGeneratingReset(false),
mIsSubmitting(false),
mDeferSubmission(false),
mNotifiedObservers(false),
mNotifiedObserversResult(false),
mSubmitPopupState(openAbused),
mSubmitInitiatedFromUserInput(false),
mPendingSubmission(nullptr),
mSubmittingRequest(nullptr),
mDefaultSubmitElement(nullptr),
mFirstSubmitInElements(nullptr),
mFirstSubmitNotInElements(nullptr),
mImageNameLookupTable(FORM_CONTROL_LIST_HASHTABLE_LENGTH),
mPastNameLookupTable(FORM_CONTROL_LIST_HASHTABLE_LENGTH),
mSubmitPopupState(openAbused),
mInvalidElementsCount(0),
mGeneratingSubmit(false),
mGeneratingReset(false),
mIsSubmitting(false),
mDeferSubmission(false),
mNotifiedObservers(false),
mNotifiedObserversResult(false),
mSubmitInitiatedFromUserInput(false),
mEverTriedInvalidSubmit(false)
{
// We start out valid.
Expand Down
33 changes: 17 additions & 16 deletions dom/html/HTMLFormElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -560,22 +560,6 @@ class HTMLFormElement final : public nsGenericHTMLElement,
nsDataHashtable<nsStringCaseInsensitiveHashKey,uint32_t> mRequiredRadioButtonCounts;
/** The value missing state of each group */
nsDataHashtable<nsStringCaseInsensitiveHashKey,bool> mValueMissingRadioGroups;
/** Whether we are currently processing a submit event or not */
bool mGeneratingSubmit;
/** Whether we are currently processing a reset event or not */
bool mGeneratingReset;
/** Whether we are submitting currently */
bool mIsSubmitting;
/** Whether the submission is to be deferred in case a script triggers it */
bool mDeferSubmission;
/** Whether we notified NS_FORMSUBMIT_SUBJECT listeners already */
bool mNotifiedObservers;
/** If we notified the listeners early, what was the result? */
bool mNotifiedObserversResult;
/** Keep track of what the popup state was when the submit was initiated */
PopupControlState mSubmitPopupState;
/** Keep track of whether a submission was user-initiated or not */
bool mSubmitInitiatedFromUserInput;

/** The pending submission object */
nsAutoPtr<HTMLFormSubmission> mPendingSubmission;
Expand Down Expand Up @@ -612,13 +596,30 @@ class HTMLFormElement final : public nsGenericHTMLElement,

nsInterfaceHashtable<nsStringHashKey,nsISupports> mPastNameLookupTable;

/** Keep track of what the popup state was when the submit was initiated */
PopupControlState mSubmitPopupState;

/**
* Number of invalid and candidate for constraint validation elements in the
* form the last time UpdateValidity has been called.
* @note Should only be used by UpdateValidity() and GetValidity()!
*/
int32_t mInvalidElementsCount;

/** Whether we are currently processing a submit event or not */
bool mGeneratingSubmit;
/** Whether we are currently processing a reset event or not */
bool mGeneratingReset;
/** Whether we are submitting currently */
bool mIsSubmitting;
/** Whether the submission is to be deferred in case a script triggers it */
bool mDeferSubmission;
/** Whether we notified NS_FORMSUBMIT_SUBJECT listeners already */
bool mNotifiedObservers;
/** If we notified the listeners early, what was the result? */
bool mNotifiedObserversResult;
/** Keep track of whether a submission was user-initiated or not */
bool mSubmitInitiatedFromUserInput;
/**
* Whether the submission of this form has been ever prevented because of
* being invalid.
Expand Down
24 changes: 4 additions & 20 deletions gfx/2d/DrawEventRecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
#include <ostream>
#include <fstream>

#if defined(_MSC_VER)
#include <unordered_set>
#else
#include <set>
#endif

namespace mozilla {
namespace gfx {
Expand Down Expand Up @@ -87,22 +83,10 @@ class DrawEventRecorderPrivate : public DrawEventRecorder
protected:
virtual void Flush() = 0;

#if defined(_MSC_VER)
typedef std::unordered_set<const void*> ObjectSet;
typedef std::unordered_set<uint64_t> Uint64Set;
typedef std::unordered_set<ScaledFont*> FontSet;
typedef std::unordered_set<SourceSurface*> SurfaceSet;
#else
typedef std::set<const void*> ObjectSet;
typedef std::set<uint64_t> Uint64Set;
typedef std::set<ScaledFont*> FontSet;
typedef std::set<SourceSurface*> SurfaceSet;
#endif

ObjectSet mStoredObjects;
Uint64Set mStoredFontData;
FontSet mStoredFonts;
SurfaceSet mStoredSurfaces;
std::unordered_set<const void*> mStoredObjects;
std::unordered_set<uint64_t> mStoredFontData;
std::unordered_set<ScaledFont*> mStoredFonts;
std::unordered_set<SourceSurface*> mStoredSurfaces;
};

class DrawEventRecorderFile : public DrawEventRecorderPrivate
Expand Down
21 changes: 20 additions & 1 deletion gfx/layers/composite/ContainerLayerComposite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ ContainerPrepare(ContainerT* aContainer,
LayerManagerComposite* aManager,
const RenderTargetIntRect& aClipRect)
{
// We can end up calling prepare multiple times if we duplicated
// layers due to preserve-3d plane splitting. The results
// should be identical, so we only need to do it once.
if (aContainer->mPrepared) {
return;
}
aContainer->mPrepared = MakeUnique<PreparedData>();
aContainer->mPrepared->mNeedsSurfaceCopy = false;

Expand Down Expand Up @@ -585,7 +591,6 @@ ContainerRender(ContainerT* aContainer,
}

if (!surface) {
aContainer->mPrepared = nullptr;
return;
}

Expand Down Expand Up @@ -688,6 +693,10 @@ void
ContainerLayerComposite::Cleanup()
{
mPrepared = nullptr;

for (Layer* l = GetFirstChild(); l; l = l->GetNextSibling()) {
static_cast<LayerComposite*>(l->AsHostLayer())->Cleanup();
}
}

void
Expand Down Expand Up @@ -755,6 +764,16 @@ RefLayerComposite::Prepare(const RenderTargetIntRect& aClipRect)
ContainerPrepare(this, mCompositeManager, aClipRect);
}

void
RefLayerComposite::Cleanup()
{
mPrepared = nullptr;

for (Layer* l = GetFirstChild(); l; l = l->GetNextSibling()) {
static_cast<LayerComposite*>(l->AsHostLayer())->Cleanup();
}
}

void
RefLayerComposite::CleanupResources()
{
Expand Down
2 changes: 2 additions & 0 deletions gfx/layers/composite/ContainerLayerComposite.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ class RefLayerComposite : public RefLayer,
DefaultComputeEffectiveTransforms(aTransformToSurface);
}

virtual void Cleanup() override;

virtual void CleanupResources() override;

virtual HostLayer* AsHostLayer() override { return this; }
Expand Down
4 changes: 3 additions & 1 deletion gfx/layers/d3d11/TextureD3D11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,9 @@ DXGITextureHostD3D11::EnsureTextureSource()
}

if (mProvider) {
MOZ_RELEASE_ASSERT(mProvider->IsValid());
if (!mProvider->IsValid()) {
return false;
}
mTextureSource = new DataTextureSourceD3D11(mFormat, mProvider, mTexture);
} else {
mTextureSource = new DataTextureSourceD3D11(mDevice, mFormat, mTexture);
Expand Down
6 changes: 6 additions & 0 deletions gfx/layers/ipc/CompositorBridgeParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,12 @@ CompositorBridgeParent::InitializeAdvancedLayers(const nsTArray<LayersBackend>&
return false;
}

// Currently LayerManagerMLGPU hardcodes a D3D11 device, so we reject using
// AL if LAYERS_D3D11 isn't in the backend hints.
if (!aBackendHints.Contains(LayersBackend::LAYERS_D3D11)) {
return false;
}

RefPtr<LayerManagerMLGPU> manager = new LayerManagerMLGPU(mWidget);
if (!manager->Initialize()) {
return false;
Expand Down
Loading

0 comments on commit 51ecb34

Please sign in to comment.