Merge mozilla-central to autoland. a=merge CLOSED TREE

This commit is contained in:
Gurzau Raul 2018-07-12 01:08:09 +03:00
Родитель f88af095a8 cf965b1f59
Коммит fff6ccd0b0
4532 изменённых файлов: 57485 добавлений и 37048 удалений

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

@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
Bug 1466471 - Update to ICU 62 requires clobber
Bug 1371485 - Moving gyp requires a clobber.

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

@ -1177,7 +1177,7 @@
# Enable Keystone auto-update support.
'mac_keystone%': 1,
}, { # else: branding!="Chrome" or buildtype!="Official"
'mac_sdk%': '<!(<(PYTHON) <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
'mac_sdk%': '', #'<!(<(PYTHON) <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
'mac_breakpad_uploads%': 0,
'mac_breakpad%': 0,
'mac_keystone%': 0,

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

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

@ -17,6 +17,7 @@ mozilla.pth:third_party/python/fluent
mozilla.pth:third_party/python/funcsigs
mozilla.pth:third_party/python/futures
mozilla.pth:third_party/python/more-itertools
mozilla.pth:third_party/python/gyp/pylib
mozilla.pth:third_party/python/python-hglib
mozilla.pth:third_party/python/pluggy
mozilla.pth:third_party/python/jsmin
@ -66,7 +67,6 @@ mozilla.pth:testing/xpcshell
mozilla.pth:third_party/python/mock-1.0.0
mozilla.pth:xpcom/typelib/xpt/tools
mozilla.pth:tools/docs
mozilla.pth:media/webrtc/trunk/tools/gyp/pylib
mozilla.pth:third_party/python/cbor2
mozilla.pth:third_party/python/pyasn1
mozilla.pth:third_party/python/pyasn1-modules

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

@ -172,7 +172,7 @@
/* type="arrow" overrides: remove arrow decorations for the xul <panel> wrapper */
.tooltip-xul-wrapper[type="arrow"][side] {
.tooltip-xul-wrapper[type="arrow"] {
margin: 0;
}

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

@ -1460,12 +1460,11 @@ WebConsoleActor.prototype =
evalOptions = { url: options.url };
}
// If the debugger object is changed from the last evaluation,
// adopt this._lastConsoleInputEvaluation value in the new debugger,
// to prevents "Debugger.Object belongs to a different Debugger" exceptions
// related to the $_ bindings.
if (this._lastConsoleInputEvaluation &&
this._lastConsoleInputEvaluation.global !== dbgWindow) {
// Adopt this._lastConsoleInputEvaluation value in the new debugger,
// to prevent "Debugger.Object belongs to a different Debugger" exceptions
// related to the $_ bindings if the debugger object is changed from the
// last evaluation.
if (this._lastConsoleInputEvaluation) {
this._lastConsoleInputEvaluation = dbg.adoptDebuggeeValue(
this._lastConsoleInputEvaluation
);

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

@ -13832,24 +13832,15 @@ nsDocShell::SetOriginAttributes(const OriginAttributes& aAttrs)
}
NS_IMETHODIMP
nsDocShell::SetOriginAttributesBeforeLoading(JS::Handle<JS::Value> aOriginAttributes)
nsDocShell::SetOriginAttributesBeforeLoading(JS::Handle<JS::Value> aOriginAttributes,
JSContext* aCx)
{
if (!aOriginAttributes.isObject()) {
return NS_ERROR_INVALID_ARG;
}
AutoJSAPI jsapi;
if (!jsapi.Init(&aOriginAttributes.toObject())) {
return NS_ERROR_UNEXPECTED;
}
JSContext* cx = jsapi.cx();
if (NS_WARN_IF(!cx)) {
return NS_ERROR_FAILURE;
}
OriginAttributes attrs;
if (!aOriginAttributes.isObject() || !attrs.Init(cx, aOriginAttributes)) {
if (!attrs.Init(aCx, aOriginAttributes)) {
return NS_ERROR_INVALID_ARG;
}

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

@ -406,5 +406,6 @@ interface nsIWebNavigation : nsISupports
* Set an OriginAttributes dictionary in the docShell. This can be done only
* before loading any content.
*/
[implicit_jscontext]
void setOriginAttributesBeforeLoading(in jsval originAttributes);
};

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

@ -1820,7 +1820,8 @@ nsSHistory::LoadURIWithOptions(const char16_t* aURI,
}
NS_IMETHODIMP
nsSHistory::SetOriginAttributesBeforeLoading(JS::HandleValue aOriginAttributes)
nsSHistory::SetOriginAttributesBeforeLoading(JS::HandleValue aOriginAttributes,
JSContext* aCx)
{
return NS_OK;
}

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

@ -106,7 +106,7 @@ DocGroup::ReportPerformanceInfo()
continue;
}
pwid = top->WindowID();
isTopLevel = top->IsTopLevelWindow();;
isTopLevel = outer->IsTopLevelWindow();
docURI->GetHost(host);
// If the host is empty, using the url
if (host.IsEmpty()) {

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

@ -378,7 +378,7 @@ StructuredCloneHolder::ReadFullySerializableObjects(JSContext* aCx,
}
if (aTag == SCTAG_DOM_WEBCRYPTO_KEY || aTag == SCTAG_DOM_URLSEARCHPARAMS) {
nsIGlobalObject *global = xpc::NativeGlobal(JS::CurrentGlobalOrNull(aCx));
nsIGlobalObject* global = xpc::CurrentNativeGlobal(aCx);
if (!global) {
return nullptr;
}
@ -436,7 +436,7 @@ StructuredCloneHolder::ReadFullySerializableObjects(JSContext* aCx,
return nullptr;
}
nsIGlobalObject *global = xpc::NativeGlobal(JS::CurrentGlobalOrNull(aCx));
nsIGlobalObject* global = xpc::CurrentNativeGlobal(aCx);
if (!global) {
return nullptr;
}

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

@ -952,7 +952,7 @@ public:
if (aDatabase && aDatabase->GetParentObject()) {
parent = aDatabase->GetParentObject();
} else {
parent = xpc::NativeGlobal(JS::CurrentGlobalOrNull(aCx));
parent = xpc::CurrentNativeGlobal(aCx);
}
} else {
WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();

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

@ -101,7 +101,7 @@ StructuredCloneData::Read(JSContext* aCx,
{
MOZ_ASSERT(mInitialized);
nsIGlobalObject *global = xpc::NativeGlobal(JS::CurrentGlobalOrNull(aCx));
nsIGlobalObject* global = xpc::CurrentNativeGlobal(aCx);
MOZ_ASSERT(global);
ReadFromBuffer(global, aCx, Data(), aValue, aRv);

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

@ -693,8 +693,7 @@ AutoEntryScript::DocshellEntryMonitor::Entry(JSContext* aCx, JSFunction* aFuncti
rootedScript = aScript;
}
nsCOMPtr<nsPIDOMWindowInner> window =
do_QueryInterface(xpc::NativeGlobal(JS::CurrentGlobalOrNull(aCx)));
nsCOMPtr<nsPIDOMWindowInner> window = xpc::CurrentWindowOrNull(aCx);
if (!window || !window->GetDocShell() ||
!window->GetDocShell()->GetRecordProfileTimelineMarkers()) {
return;
@ -738,8 +737,7 @@ AutoEntryScript::DocshellEntryMonitor::Entry(JSContext* aCx, JSFunction* aFuncti
void
AutoEntryScript::DocshellEntryMonitor::Exit(JSContext* aCx)
{
nsCOMPtr<nsPIDOMWindowInner> window =
do_QueryInterface(xpc::NativeGlobal(JS::CurrentGlobalOrNull(aCx)));
nsCOMPtr<nsPIDOMWindowInner> window = xpc::CurrentWindowOrNull(aCx);
// Not really worth checking GetRecordProfileTimelineMarkers here.
if (window && window->GetDocShell()) {
nsCOMPtr<nsIDocShell> docShellForJSRunToCompletion = window->GetDocShell();

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

@ -86,8 +86,7 @@ PublicKeyCredential::SetResponse(RefPtr<AuthenticatorResponse> aResponse)
/* static */ already_AddRefed<Promise>
PublicKeyCredential::IsUserVerifyingPlatformAuthenticatorAvailable(GlobalObject& aGlobal)
{
nsIGlobalObject* globalObject =
xpc::NativeGlobal(JS::CurrentGlobalOrNull(aGlobal.Context()));
nsIGlobalObject* globalObject = xpc::CurrentNativeGlobal(aGlobal.Context());
if (NS_WARN_IF(!globalObject)) {
return nullptr;
}

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

@ -51,10 +51,11 @@ struct OpAddExternalImage {
ImageKey key;
};
struct OpAddExternalImageForTexture {
struct OpPushExternalImageForTexture {
ExternalImageId externalImageId;
ImageKey key;
PTexture texture;
bool isUpdate;
};
struct OpAddCompositorAnimations {
@ -176,7 +177,7 @@ union OpUpdateResource {
OpAddFontInstance;
OpDeleteFontInstance;
OpAddExternalImage;
OpAddExternalImageForTexture;
OpPushExternalImageForTexture;
};
} // namespace

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

@ -281,14 +281,15 @@ IpcResourceUpdateQueue::AddExternalImage(wr::ExternalImageId aExtId, wr::ImageKe
}
void
IpcResourceUpdateQueue::AddExternalImageForTexture(wr::ExternalImageId aExtId,
wr::ImageKey aKey,
layers::TextureClient* aTexture)
IpcResourceUpdateQueue::PushExternalImageForTexture(wr::ExternalImageId aExtId,
wr::ImageKey aKey,
layers::TextureClient* aTexture,
bool aIsUpdate)
{
MOZ_ASSERT(aTexture);
MOZ_ASSERT(aTexture->GetIPDLActor());
MOZ_RELEASE_ASSERT(aTexture->GetIPDLActor()->GetIPCChannel() == mWriter.WrBridge()->GetIPCChannel());
mUpdates.AppendElement(layers::OpAddExternalImageForTexture(aExtId, aKey, nullptr, aTexture->GetIPDLActor()));
mUpdates.AppendElement(layers::OpPushExternalImageForTexture(aExtId, aKey, nullptr, aTexture->GetIPDLActor(), aIsUpdate));
}
bool

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

@ -85,9 +85,10 @@ public:
void AddExternalImage(wr::ExternalImageId aExtId, wr::ImageKey aKey);
void AddExternalImageForTexture(wr::ExternalImageId aExtId,
wr::ImageKey aKey,
layers::TextureClient* aTexture);
void PushExternalImageForTexture(wr::ExternalImageId aExtId,
wr::ImageKey aKey,
layers::TextureClient* aTexture,
bool aIsUpdate);
bool UpdateImageBuffer(wr::ImageKey aKey,
const ImageDescriptor& aDescriptor,

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

@ -344,11 +344,11 @@ WebRenderBridgeParent::UpdateResources(const nsTArray<OpUpdateResource>& aResour
}
break;
}
case OpUpdateResource::TOpAddExternalImageForTexture: {
const auto& op = cmd.get_OpAddExternalImageForTexture();
case OpUpdateResource::TOpPushExternalImageForTexture: {
const auto& op = cmd.get_OpPushExternalImageForTexture();
CompositableTextureHostRef texture;
texture = TextureHost::AsTextureHost(op.textureParent());
if (!AddExternalImageForTexture(op.externalImageId(), op.key(), texture, aUpdates)) {
if (!PushExternalImageForTexture(op.externalImageId(), op.key(), texture, op.isUpdate(), aUpdates)) {
return false;
}
break;
@ -456,11 +456,13 @@ WebRenderBridgeParent::AddExternalImage(wr::ExternalImageId aExtId, wr::ImageKey
}
bool
WebRenderBridgeParent::AddExternalImageForTexture(wr::ExternalImageId aExtId,
wr::ImageKey aKey,
TextureHost* aTexture,
wr::TransactionBuilder& aResources)
WebRenderBridgeParent::PushExternalImageForTexture(wr::ExternalImageId aExtId,
wr::ImageKey aKey,
TextureHost* aTexture,
bool aIsUpdate,
wr::TransactionBuilder& aResources)
{
auto op = aIsUpdate ? TextureHost::UPDATE_IMAGE : TextureHost::ADD_IMAGE;
Range<wr::ImageKey> keys(&aKey, 1);
// Check if key is obsoleted.
if (keys[0].mNamespace != mIdNamespace) {
@ -475,9 +477,15 @@ WebRenderBridgeParent::AddExternalImageForTexture(wr::ExternalImageId aExtId,
if (!gfxEnv::EnableWebRenderRecording()) {
WebRenderTextureHost* wrTexture = aTexture->AsWebRenderTextureHost();
if (wrTexture) {
wrTexture->PushResourceUpdates(aResources, TextureHost::ADD_IMAGE, keys,
wrTexture->PushResourceUpdates(aResources, op, keys,
wrTexture->GetExternalImageKey());
MOZ_ASSERT(mTextureHosts.find(wr::AsUint64(aKey)) == mTextureHosts.end());
auto it = mTextureHosts.find(wr::AsUint64(aKey));
MOZ_ASSERT((it == mTextureHosts.end() && !aIsUpdate) ||
(it != mTextureHosts.end() && aIsUpdate));
if (it != mTextureHosts.end()) {
// Release Texture if it exists.
ReleaseTextureOfImage(aKey);
}
mTextureHosts.emplace(wr::AsUint64(aKey), CompositableTextureHostRef(aTexture));
return true;
}
@ -498,7 +506,13 @@ WebRenderBridgeParent::AddExternalImageForTexture(wr::ExternalImageId aExtId,
wr::ImageDescriptor descriptor(size, map.mStride, dSurf->GetFormat());
wr::Vec<uint8_t> data;
data.PushBytes(Range<uint8_t>(map.mData, size.height * map.mStride));
aResources.AddImage(keys[0], descriptor, data);
if (op == TextureHost::UPDATE_IMAGE) {
aResources.UpdateImageBuffer(keys[0], descriptor, data);
} else {
aResources.AddImage(keys[0], descriptor, data);
}
dSurf->Unmap();
return true;

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

@ -210,10 +210,11 @@ private:
bool AddExternalImage(wr::ExternalImageId aExtId, wr::ImageKey aKey,
wr::TransactionBuilder& aResources);
bool AddExternalImageForTexture(wr::ExternalImageId aExtId,
wr::ImageKey aKey,
TextureHost* aTexture,
wr::TransactionBuilder& aResources);
bool PushExternalImageForTexture(wr::ExternalImageId aExtId,
wr::ImageKey aKey,
TextureHost* aTexture,
bool aIsUpdate,
wr::TransactionBuilder& aResources);
void AddPipelineIdForCompositable(const wr::PipelineId& aPipelineIds,
const CompositableHandle& aHandle,

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

@ -155,18 +155,29 @@ WebRenderImageData::UpdateImageKey(ImageContainer* aContainer,
return mKey;
}
// Delete old key, we are generating a new key.
// TODO(nical): noooo... we need to reuse image keys.
ClearImageKey();
// If we already had a texture and the format hasn't changed, better to reuse the image keys
// than create new ones.
bool useUpdate = mKey.isSome()
&& !!mTextureOfImage
&& !!currentTexture
&& mTextureOfImage->GetSize() == currentTexture->GetSize()
&& mTextureOfImage->GetFormat() == currentTexture->GetFormat();
wr::MaybeExternalImageId extId = currentTexture->GetExternalImageKey();
MOZ_RELEASE_ASSERT(extId.isSome());
MOZ_ASSERT(!mTextureOfImage);
key = WrBridge()->GetNextImageKey();
aResources.AddExternalImageForTexture(extId.ref(), key, currentTexture);
if (useUpdate) {
MOZ_ASSERT(mKey.isSome());
MOZ_ASSERT(mTextureOfImage);
aResources.PushExternalImageForTexture(extId.ref(), mKey.ref(), currentTexture, /* aIsUpdate */ true);
} else {
ClearImageKey();
key = WrBridge()->GetNextImageKey();
aResources.PushExternalImageForTexture(extId.ref(), key, currentTexture, /* aIsUpdate */ false);
mKey = Some(key);
}
mTextureOfImage = currentTexture;
mKey = Some(key);
mOwnsKey = true;
return mKey;

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

@ -179,8 +179,7 @@ nsThebesFontEnumerator::EnumerateFontsAsync(const char* aLangGroup,
{
MOZ_ASSERT(NS_IsMainThread());
nsCOMPtr<nsIGlobalObject> global =
xpc::NativeGlobal(JS::CurrentGlobalOrNull(aCx));
nsCOMPtr<nsIGlobalObject> global = xpc::CurrentNativeGlobal(aCx);
NS_ENSURE_TRUE(global, NS_ERROR_UNEXPECTED);
ErrorResult errv;

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

@ -630,14 +630,31 @@ nsJPEGDecoder::NotifyDone()
PostDecodeDone();
}
void
nsJPEGDecoder::FinishRow(uint32_t aLastSourceRow)
{
if (mDownscaler) {
mDownscaler->CommitRow();
if (mDownscaler->HasInvalidation()) {
DownscalerInvalidRect invalidRect = mDownscaler->TakeInvalidRect();
PostInvalidation(invalidRect.mOriginalSizeRect,
Some(invalidRect.mTargetSizeRect));
MOZ_ASSERT(!mDownscaler->HasInvalidation());
}
} else if (aLastSourceRow != mInfo.output_scanline) {
PostInvalidation(nsIntRect(0, aLastSourceRow,
mInfo.output_width,
mInfo.output_scanline - aLastSourceRow));
}
}
void
nsJPEGDecoder::OutputScanlines(bool* suspend)
{
*suspend = false;
const uint32_t top = mInfo.output_scanline;
while ((mInfo.output_scanline < mInfo.output_height)) {
const uint32_t top = mInfo.output_scanline;
uint32_t* imageRow = nullptr;
if (mDownscaler) {
imageRow = reinterpret_cast<uint32_t*>(mDownscaler->RowBuffer());
@ -654,9 +671,7 @@ nsJPEGDecoder::OutputScanlines(bool* suspend)
*suspend = true; // suspend
break;
}
if (mDownscaler) {
mDownscaler->CommitRow();
}
FinishRow(top);
continue; // all done for this row!
}
@ -733,20 +748,7 @@ nsJPEGDecoder::OutputScanlines(bool* suspend)
sampleRow += 3;
}
if (mDownscaler) {
mDownscaler->CommitRow();
}
}
if (mDownscaler && mDownscaler->HasInvalidation()) {
DownscalerInvalidRect invalidRect = mDownscaler->TakeInvalidRect();
PostInvalidation(invalidRect.mOriginalSizeRect,
Some(invalidRect.mTargetSizeRect));
MOZ_ASSERT(!mDownscaler->HasInvalidation());
} else if (!mDownscaler && top != mInfo.output_scanline) {
PostInvalidation(nsIntRect(0, top,
mInfo.output_width,
mInfo.output_scanline - top));
FinishRow(top);
}
}

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

@ -80,6 +80,7 @@ private:
FINISHED_JPEG_DATA
};
void FinishRow(uint32_t aLastSourceRow);
LexerTransition<State> ReadJPEGData(const char* aData, size_t aLength);
LexerTransition<State> FinishedJPEGData();

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

@ -1167,7 +1167,7 @@ RejectMaybeWrappedPromise(JSContext *cx, HandleObject promiseObj, HandleValue re
// floor.
RootedObject realReason(cx, UncheckedUnwrap(&reason.toObject()));
RootedValue realReasonVal(cx, ObjectValue(*realReason));
RootedObject realGlobal(cx, &realReason->nonCCWGlobal());
Rooted<GlobalObject*> realGlobal(cx, &realReason->nonCCWGlobal());
ReportErrorToGlobal(cx, realGlobal, realReasonVal);
// Async stacks are only properly adopted if there's at least one

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

@ -7511,9 +7511,13 @@ CClosure::ClosureStub(ffi_cif* cif, void* result, void** args, void* userData)
// Retrieve the essentials from our closure object.
ArgClosure argClosure(cif, result, args, static_cast<ClosureInfo*>(userData));
JSContext* cx = argClosure.cinfo->cx;
RootedObject fun(cx, argClosure.cinfo->jsfnObj);
js::PrepareScriptEnvironmentAndInvoke(cx, fun, argClosure);
js::AssertSameCompartment(cx, argClosure.cinfo->jsfnObj);
RootedObject global(cx, JS::CurrentGlobalOrNull(cx));
MOZ_ASSERT(global);
js::PrepareScriptEnvironmentAndInvoke(cx, global, argClosure);
}
bool CClosure::ArgClosure::operator()(JSContext* cx)

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

@ -311,13 +311,6 @@ from its prototype:
when it was resolved. If the referent hasn't been resolved or is not a
[`Promise`][promise], throw a `TypeError` exception.
`global`
: A `Debugger.Object` instance referring to the global object in whose
scope the referent was allocated. This does not unwrap cross-compartment
wrappers: if the referent is a wrapper, the result refers to the
wrapper's global, not the wrapped object's global. The result refers to
the global directly, not via a wrapper.
<code id="allocationsite">allocationSite</code>
: If [object allocation site tracking][tracking-allocs] was enabled when this
`Debugger.Object`'s referent was allocated, return the

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

@ -143,17 +143,35 @@ BumpChunk::removeMProtectHandler() const
} // namespace detail
} // namespace js
void
LifoAlloc::reset(size_t defaultChunkSize)
{
MOZ_ASSERT(mozilla::IsPowerOfTwo(defaultChunkSize));
while (!chunks_.empty()) {
chunks_.begin()->setRWUntil(Loc::End);
chunks_.popFirst();
}
while (!unused_.empty()) {
unused_.begin()->setRWUntil(Loc::End);
unused_.popFirst();
}
defaultChunkSize_ = defaultChunkSize;
markCount = 0;
curSize_ = 0;
}
void
LifoAlloc::freeAll()
{
while (!chunks_.empty()) {
chunks_.begin()->setRWUntil(Loc::End);
BumpChunk bc = chunks_.popFirst();
UniqueBumpChunk bc = chunks_.popFirst();
decrementCurSize(bc->computedSizeOfIncludingThis());
}
while (!unused_.empty()) {
unused_.begin()->setRWUntil(Loc::End);
BumpChunk bc = unused_.popFirst();
UniqueBumpChunk bc = unused_.popFirst();
decrementCurSize(bc->computedSizeOfIncludingThis());
}
@ -162,14 +180,14 @@ LifoAlloc::freeAll()
MOZ_ASSERT(curSize_ == 0);
}
LifoAlloc::BumpChunk
LifoAlloc::UniqueBumpChunk
LifoAlloc::newChunkWithCapacity(size_t n)
{
MOZ_ASSERT(fallibleScope_, "[OOM] Cannot allocate a new chunk in an infallible scope.");
// Compute the size which should be requested in order to be able to fit |n|
// bytes in the newly allocated chunk, or default the |defaultChunkSize_|.
size_t defaultChunkFreeSpace = defaultChunkSize_ - detail::BumpChunk::reservedSpace;
size_t defaultChunkFreeSpace = defaultChunkSize_ - detail::BumpChunkReservedSpace;
size_t chunkSize;
if (n > defaultChunkFreeSpace) {
MOZ_ASSERT(defaultChunkFreeSpace < defaultChunkSize_);
@ -193,7 +211,7 @@ LifoAlloc::newChunkWithCapacity(size_t n)
#endif
// Create a new BumpChunk, and allocate space for it.
BumpChunk result = detail::BumpChunk::newWithCapacity(chunkSize, protect);
UniqueBumpChunk result = detail::BumpChunk::newWithCapacity(chunkSize, protect);
if (!result)
return nullptr;
MOZ_ASSERT(result->computedSizeOfIncludingThis() == chunkSize);
@ -238,7 +256,7 @@ LifoAlloc::getOrCreateChunk(size_t n)
}
// Allocate a new BumpChunk with enough space for the next allocation.
BumpChunk newChunk = newChunkWithCapacity(n);
UniqueBumpChunk newChunk = newChunkWithCapacity(n);
if (!newChunk)
return false;
size_t size = newChunk->computedSizeOfIncludingThis();

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

@ -31,14 +31,14 @@ namespace js {
namespace detail {
template <typename T>
template <typename T, typename D>
class SingleLinkedList;
template <typename T>
template <typename T, typename D = JS::DeletePolicy<T>>
class SingleLinkedListElement
{
friend class SingleLinkedList<T>;
js::UniquePtr<T> next_;
friend class SingleLinkedList<T, D>;
js::UniquePtr<T, D> next_;
public:
SingleLinkedListElement()
@ -54,13 +54,13 @@ class SingleLinkedListElement
// Single linked list which is using UniquePtr to hold the next pointers.
// UniquePtr are used to ensure that none of the elements are used
// silmutaneously in 2 different list.
template <typename T>
template <typename T, typename D = JS::DeletePolicy<T>>
class SingleLinkedList
{
private:
// First element of the list which owns the next element, and ensure that
// that this list is the only owner of the element.
UniquePtr<T> head_;
UniquePtr<T, D> head_;
// Weak pointer to the last element of the list.
T* last_;
@ -151,7 +151,7 @@ class SingleLinkedList
return result;
}
void pushFront(UniquePtr<T>&& elem) {
void pushFront(UniquePtr<T, D>&& elem) {
if (!last_)
last_ = elem.get();
elem->next_ = std::move(head_);
@ -159,7 +159,7 @@ class SingleLinkedList
assertInvariants();
}
void append(UniquePtr<T>&& elem) {
void append(UniquePtr<T, D>&& elem) {
if (last_) {
last_->next_ = std::move(elem);
last_ = last_->next_.get();
@ -181,9 +181,9 @@ class SingleLinkedList
assertInvariants();
list.assertInvariants();
}
UniquePtr<T> popFirst() {
UniquePtr<T, D> popFirst() {
MOZ_ASSERT(head_);
UniquePtr<T> result = std::move(head_);
UniquePtr<T, D> result = std::move(head_);
head_ = std::move(result->next_);
if (!head_)
last_ = nullptr;
@ -197,8 +197,7 @@ static const size_t LIFO_ALLOC_ALIGN = 8;
MOZ_ALWAYS_INLINE
uint8_t*
AlignPtr(uint8_t* orig) {
static_assert(mozilla::tl::FloorLog2<LIFO_ALLOC_ALIGN>::value ==
mozilla::tl::CeilingLog2<LIFO_ALLOC_ALIGN>::value,
static_assert(mozilla::IsPowerOfTwo(LIFO_ALLOC_ALIGN),
"LIFO_ALLOC_ALIGN must be a power of two");
uint8_t* result = (uint8_t*) AlignBytes(uintptr_t(orig), LIFO_ALLOC_ALIGN);
@ -289,15 +288,6 @@ class BumpChunk : public SingleLinkedListElement<BumpChunk>
, protect_(protect ? 1 : 0)
#endif
{
// We cannot bake this value inside the BumpChunk class, because
// sizeof(BumpChunk) can only be computed after the closing brace of the
// BumpChunk class, or within one of its methods. As a work-around, the
// reservedSpace value is baked in, and we check that it indeed matches
// with the space taken by the data of the BumpChunk class, and the
// alignment of a pointer.
MOZ_ASSERT(BumpChunk::reservedSpace == AlignBytes(sizeof(BumpChunk), LIFO_ALLOC_ALIGN),
"Checked that the baked-in value correspond to computed value");
assertInvariants();
#if defined(LIFO_HAVE_MEM_CHECKS)
// The memory is freshly allocated and marked as undefined by the
@ -343,11 +333,6 @@ class BumpChunk : public SingleLinkedListElement<BumpChunk>
removeMProtectHandler();
}
// Space reserved for the BumpChunk internal data, and the alignment of the
// first allocation content. This can be used to ensure there is enough
// space for the next allocation. (see LifoAlloc::newChunkWithCapacity)
static constexpr size_t reservedSpace = 4 * sizeof(uintptr_t);
// Returns true if this chunk contains no allocated content.
bool empty() const { return end() == begin(); }
@ -358,8 +343,8 @@ class BumpChunk : public SingleLinkedListElement<BumpChunk>
// These are used for manipulating a chunk as if it was a vector of bytes,
// and used for iterating over the content of the buffer (see
// LifoAlloc::Enum)
const uint8_t* begin() const { return base() + reservedSpace; }
uint8_t* begin() { return base() + reservedSpace; }
inline const uint8_t* begin() const;
inline uint8_t* begin();
uint8_t* end() const { return bump_; }
// This function is the only way to allocate and construct a chunk. It
@ -470,7 +455,7 @@ class BumpChunk : public SingleLinkedListElement<BumpChunk>
//
// This is used when freezing a LifoAlloc, such as moving a LifoAlloc to
// another thread.
Header = 0,
Header = 0,
// Refers to the set of allocated and reserved bytes, from
// PageRoundup(begin()), to capacity_.
//
@ -483,7 +468,7 @@ class BumpChunk : public SingleLinkedListElement<BumpChunk>
// This is used when a BumpChunk is no longer used for allocation, while
// containing live data. This should catch out-of-bound accesses within
// the LifoAlloc content.
Reserved = 2,
Reserved = 2,
// Refers to the end of the BumpChunk.
//
// This is used when a BumpChunk is used for doing allocation, as
@ -501,6 +486,23 @@ class BumpChunk : public SingleLinkedListElement<BumpChunk>
#endif
};
// Space reserved for the BumpChunk internal data, and the alignment of the
// first allocation content. This can be used to ensure there is enough space
// for the next allocation (see LifoAlloc::newChunkWithCapacity).
static constexpr size_t BumpChunkReservedSpace = AlignBytes(sizeof(BumpChunk), LIFO_ALLOC_ALIGN);
inline const uint8_t*
BumpChunk::begin() const
{
return base() + BumpChunkReservedSpace;
}
inline uint8_t*
BumpChunk::begin()
{
return base() + BumpChunkReservedSpace;
}
} // namespace detail
// LIFO bump allocator: used for phase-oriented and fast LIFO allocations.
@ -510,7 +512,7 @@ class BumpChunk : public SingleLinkedListElement<BumpChunk>
class LifoAlloc
{
using Loc = detail::BumpChunk::Loc;
using BumpChunk = js::UniquePtr<detail::BumpChunk>;
using UniqueBumpChunk = js::UniquePtr<detail::BumpChunk>;
using BumpChunkList = detail::SingleLinkedList<detail::BumpChunk>;
// List of chunks containing allocated data. In the common case, the last
@ -537,26 +539,13 @@ class LifoAlloc
LifoAlloc(const LifoAlloc&) = delete;
// Return a BumpChunk that can perform an allocation of at least size |n|.
BumpChunk newChunkWithCapacity(size_t n);
UniqueBumpChunk newChunkWithCapacity(size_t n);
// Reuse or allocate a BumpChunk that can perform an allocation of at least
// size |n|, if successful it is placed at the end the list of |chunks_|.
MOZ_MUST_USE bool getOrCreateChunk(size_t n);
void reset(size_t defaultChunkSize) {
MOZ_ASSERT(mozilla::RoundUpPow2(defaultChunkSize) == defaultChunkSize);
while (!chunks_.empty()) {
chunks_.begin()->setRWUntil(Loc::End);
chunks_.popFirst();
}
while (!unused_.empty()) {
unused_.begin()->setRWUntil(Loc::End);
unused_.popFirst();
}
defaultChunkSize_ = defaultChunkSize;
markCount = 0;
curSize_ = 0;
}
void reset(size_t defaultChunkSize);
// Append unused chunks to the end of this LifoAlloc.
void appendUnused(BumpChunkList&& otherUnused) {
@ -705,7 +694,7 @@ class LifoAlloc
return true;
}
BumpChunk newChunk = newChunkWithCapacity(n);
UniqueBumpChunk newChunk = newChunkWithCapacity(n);
if (!newChunk)
return false;
size_t size = newChunk->computedSizeOfIncludingThis();

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

@ -34,7 +34,6 @@ assertDebuggees();
// "dg1" means "Debugger.Object referring (directly) to g1".
var dg1 = dbg.addDebuggee(g1);
dg1.toSource = function() { return "[Debugger.Object for global g1]"; };
assertEq(dg1.global, dg1);
assertEq(dg1.unwrap(), dg1);
assertDebuggees(dg1);
@ -42,13 +41,11 @@ assertDebuggees(dg1);
// to it without a wrapper.
var dg2 = dbg.addDebuggee(g2);
dg2.toSource = function() { return "[Debugger.Object for global g2]"; };
assertEq(dg2.global, dg2);
assertEq(dg2.unwrap(), dg2);
assertDebuggees(dg1, dg2);
// "dwg1" means "Debugger.Object referring to CCW of g1".
var dwg1 = dg2.makeDebuggeeValue(g1);
assertEq(dwg1.global, dg2);
assertEq(dwg1.unwrap(), dg1);
dwg1.toSource = function() { return "[Debugger.Object for CCW of global g1]"; };

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

@ -12,7 +12,6 @@ var dg2 = dbg.addDebuggee(g2);
// Generate a Debugger.Object viewing g2 from g1's compartment.
var dg1wg2 = dg1.makeDebuggeeValue(g2);
assertEq(dg1wg2.global, dg1);
assertEq(dg1wg2.unwrap(), dg2);
assertThrowsInstanceOf(function () { dg1wg2.executeInGlobal('1'); }, TypeError);
assertThrowsInstanceOf(function () { dg1wg2.executeInGlobalWithBindings('x', { x: 1 }); }, TypeError);

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

@ -1,26 +0,0 @@
// Debugger.Object.prototype.global accessor surfaces.
load(libdir + 'asserts.js');
var dbg = new Debugger;
var g = newGlobal();
var gw = dbg.addDebuggee(g);
assertEq(Object.getOwnPropertyDescriptor(gw, 'global'), undefined);
var d = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(gw), 'global');
assertEq(d.enumerable, false);
assertEq(d.configurable, true);
assertEq(typeof d.get, "function");
assertEq(d.get.length, 0);
assertEq(d.set, undefined);
// This should not throw.
gw.global = '';
// This should throw.
assertThrowsInstanceOf(function () { "use strict"; gw.global = {}; }, TypeError);
assertEq(gw.global, gw);
// You shouldn't be able to apply the accessor to the prototype.
assertThrowsInstanceOf(function () { return Debugger.Object.prototype.global; },
TypeError);

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

@ -1,25 +0,0 @@
// Debugger.Object.prototype.global retrieves the correct global.
var dbg = new Debugger;
var g1 = newGlobal();
var g1w = dbg.addDebuggee(g1);
var g2 = newGlobal();
var g2w = dbg.addDebuggee(g2);
assertEq(g1w === g2w, false);
assertEq(g1w.global, g1w);
assertEq(g2w.global, g2w);
var g1ow = g1w.makeDebuggeeValue(g1.Object());
var g2ow = g2w.makeDebuggeeValue(g2.Object());
assertEq(g1ow.global, g1w);
assertEq(g2ow.global, g2w);
// mild paranoia
assertEq(g1ow.global === g1ow, false);
assertEq(g2ow.global === g2ow, false);
// The .global accessor doesn't unwrap.
assertEq(g1w.makeDebuggeeValue(g2.Object()).global, g1w);
assertEq(g2w.makeDebuggeeValue(g1.Object()).global, g2w);

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

@ -28,20 +28,16 @@ g2.h = g1.h;
// Asking for that second D.O's script should yield null, because it's not
// a debuggee.
var fDO = g2w.getOwnPropertyDescriptor('f').value;
assertEq(fDO.global, g2w);
assertEq(fDO.unwrap().global === g2w, false);
assertEq(fDO.unwrap().class, "Function");
assertEq(fDO.unwrap().script, null);
// Similarly for g1.g, and asking for its parameter names.
var gDO = g2w.getOwnPropertyDescriptor('g').value;
assertEq(gDO.global, g2w);
assertEq(gDO.unwrap().global === g2w, false);
assertEq(gDO.unwrap().parameterNames, undefined);
// Similarly for g1.h, and asking for its bound function properties.
var hDO = g2w.getOwnPropertyDescriptor('h').value;
assertEq(hDO.global, g2w);
assertEq(hDO.unwrap().global === g2w, false);
assertEq(hDO.unwrap().class, "Function");
assertEq(hDO.unwrap().isBoundFunction, undefined);
assertEq(hDO.unwrap().isArrowFunction, undefined);
assertEq(hDO.unwrap().boundTargetFunction, undefined);

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

@ -11,13 +11,11 @@ var g2 = newGlobal();
var dg2 = dbg.addDebuggee(g2);
var dg1g2 = dg1.makeDebuggeeValue(g2);
assertEq(dg1g2.global, dg1);
assertEq(dg1g2.unwrap(), dg2);
// Try an ordinary object, not a global.
var g2o = g2.Object();
var dg2o = dg2.makeDebuggeeValue(g2o);
var dg1g2o = dg1.makeDebuggeeValue(g2o);
assertEq(dg1g2o.global, dg1);
assertEq(dg1g2o.unwrap(), dg2o);
assertEq(dg1g2o.unwrap().unwrap(), dg2o);

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

@ -16,5 +16,3 @@ assertEq(log, 'd');
g.eval('function f() { debugger; }');
g.f();
assertEq(log, 'dd');
assertEq(gw.getOwnPropertyDescriptor('f').value.global, gw);

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

@ -34,7 +34,3 @@ g1.eval('function i() { g3.h(); }');
g1.i();
assertEq(log, 'd');
assertEq(g1w.getOwnPropertyDescriptor('f').value.global, g1w);
assertEq(g2w.getOwnPropertyDescriptor('g').value.global, g2w);
assertEq(g3w.getOwnPropertyDescriptor('h').value.global, g3w);

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

@ -1405,14 +1405,16 @@ js::detail::IdMatchesAtom(jsid id, JSString* atom)
}
JS_FRIEND_API(void)
js::PrepareScriptEnvironmentAndInvoke(JSContext* cx, HandleObject scope, ScriptEnvironmentPreparer::Closure& closure)
js::PrepareScriptEnvironmentAndInvoke(JSContext* cx, HandleObject global,
ScriptEnvironmentPreparer::Closure& closure)
{
MOZ_ASSERT(!cx->isExceptionPending());
MOZ_ASSERT(global->is<GlobalObject>());
MOZ_RELEASE_ASSERT(cx->runtime()->scriptEnvironmentPreparer,
"Embedding needs to set a scriptEnvironmentPreparer callback");
cx->runtime()->scriptEnvironmentPreparer->invoke(scope, closure);
cx->runtime()->scriptEnvironmentPreparer->invoke(global, closure);
}
JS_FRIEND_API(void)

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

@ -2734,20 +2734,15 @@ IdToValue(jsid id)
}
/**
* If the embedder has registered a ScriptEnvironmentPreparer,
* PrepareScriptEnvironmentAndInvoke will call the preparer's 'invoke' method
* PrepareScriptEnvironmentAndInvoke asserts the embedder has registered a
* ScriptEnvironmentPreparer and then it calls the preparer's 'invoke' method
* with the given |closure|, with the assumption that the preparer will set up
* any state necessary to run script in |scope|, invoke |closure| with a valid
* any state necessary to run script in |global|, invoke |closure| with a valid
* JSContext*, report any exceptions thrown from the closure, and return.
*
* If no preparer is registered, PrepareScriptEnvironmentAndInvoke will assert
* that |rt| has exactly one JSContext associated with it, enter the compartment
* of |scope| on that context, and invoke |closure|.
*
* In both cases, PrepareScriptEnvironmentAndInvoke will report any exceptions
* that are thrown by the closure. Consumers who want to propagate back
* whether the closure succeeded should do so via members of the closure
* itself.
* PrepareScriptEnvironmentAndInvoke will report any exceptions that are thrown
* by the closure. Consumers who want to propagate back whether the closure
* succeeded should do so via members of the closure itself.
*/
struct ScriptEnvironmentPreparer {
@ -2755,11 +2750,11 @@ struct ScriptEnvironmentPreparer {
virtual bool operator()(JSContext* cx) = 0;
};
virtual void invoke(JS::HandleObject scope, Closure& closure) = 0;
virtual void invoke(JS::HandleObject global, Closure& closure) = 0;
};
extern JS_FRIEND_API(void)
PrepareScriptEnvironmentAndInvoke(JSContext* cx, JS::HandleObject scope,
PrepareScriptEnvironmentAndInvoke(JSContext* cx, JS::HandleObject global,
ScriptEnvironmentPreparer::Closure& closure);
JS_FRIEND_API(void)

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

@ -153,18 +153,17 @@ Max(T t1, T t2)
}
template <typename T, typename U>
static inline U
static constexpr U
ComputeByteAlignment(T bytes, U alignment)
{
static_assert(mozilla::IsUnsigned<U>::value,
"alignment amount must be unsigned");
MOZ_ASSERT(mozilla::IsPowerOfTwo(alignment));
return (alignment - (bytes % alignment)) % alignment;
}
template <typename T, typename U>
static inline T
static constexpr T
AlignBytes(T bytes, U alignment)
{
static_assert(mozilla::IsUnsigned<U>::value,

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

@ -129,8 +129,8 @@ case $cmd in
${tgtpath}/dom/bindings
${MKDIR} -p ${tgtpath}/media/webrtc/trunk/tools
cp -pPR \
${TOPSRCDIR}/media/webrtc/trunk/tools/gyp \
${tgtpath}/media/webrtc/trunk/tools
${TOPSRCDIR}/third_party/python/gyp \
${tgtpath}/third_party/python
${MKDIR} -p ${tgtpath}/testing
cp -pPR \
${TOPSRCDIR}/testing/mozbase \

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

@ -479,7 +479,7 @@ struct MOZ_STACK_CLASS EnvironmentPreparer : public js::ScriptEnvironmentPrepare
{
js::SetScriptEnvironmentPreparer(cx, this);
}
void invoke(JS::HandleObject scope, Closure& closure) override;
void invoke(JS::HandleObject global, Closure& closure) override;
};
// Shell state set once at startup.
@ -796,12 +796,14 @@ SkipUTF8BOM(FILE* file)
}
void
EnvironmentPreparer::invoke(HandleObject scope, Closure& closure)
EnvironmentPreparer::invoke(HandleObject global, Closure& closure)
{
MOZ_ASSERT(JS_IsGlobalObject(global));
JSContext* cx = TlsContext.get();
MOZ_ASSERT(!JS_IsExceptionPending(cx));
AutoRealm ar(cx, scope);
AutoRealm ar(cx, global);
AutoReportException are(cx);
if (!closure(cx))
return;

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

@ -8937,19 +8937,6 @@ DebuggerObject::boundArgumentsGetter(JSContext* cx, unsigned argc, Value* vp)
return true;
}
/* static */ bool
DebuggerObject::globalGetter(JSContext* cx, unsigned argc, Value* vp)
{
THIS_DEBUGOBJECT(cx, argc, vp, "get global", args, object)
RootedDebuggerObject result(cx);
if (!DebuggerObject::getGlobal(cx, object, &result))
return false;
args.rval().setObject(*result);
return true;
}
/* static */ bool
DebuggerObject::allocationSiteGetter(JSContext* cx, unsigned argc, Value* vp)
{
@ -9646,7 +9633,6 @@ const JSPropertySpec DebuggerObject::properties_[] = {
JS_PSG("boundTargetFunction", DebuggerObject::boundTargetFunctionGetter, 0),
JS_PSG("boundThis", DebuggerObject::boundThisGetter, 0),
JS_PSG("boundArguments", DebuggerObject::boundArgumentsGetter, 0),
JS_PSG("global", DebuggerObject::globalGetter, 0),
JS_PSG("allocationSite", DebuggerObject::allocationSiteGetter, 0),
JS_PSG("errorMessageName", DebuggerObject::errorMessageNameGetter, 0),
JS_PSG("errorNotes", DebuggerObject::errorNotesGetter, 0),
@ -9828,17 +9814,6 @@ DebuggerObject::getClassName(JSContext* cx, HandleDebuggerObject object,
return true;
}
/* static */ bool
DebuggerObject::getGlobal(JSContext* cx, HandleDebuggerObject object,
MutableHandleDebuggerObject result)
{
RootedObject referent(cx, object->referent());
Debugger* dbg = object->owner();
RootedObject global(cx, &referent->deprecatedGlobal());
return dbg->wrapDebuggeeObject(cx, global, result);
}
JSAtom*
DebuggerObject::name(JSContext* cx) const
{

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

@ -1420,8 +1420,6 @@ class DebuggerObject : public NativeObject
// Properties
static MOZ_MUST_USE bool getClassName(JSContext* cx, HandleDebuggerObject object,
MutableHandleString result);
static MOZ_MUST_USE bool getGlobal(JSContext* cx, HandleDebuggerObject object,
MutableHandleDebuggerObject result);
static MOZ_MUST_USE bool getParameterNames(JSContext* cx, HandleDebuggerObject object,
MutableHandle<StringVector> result);
static MOZ_MUST_USE bool getBoundTargetFunction(JSContext* cx, HandleDebuggerObject object,
@ -1548,7 +1546,6 @@ class DebuggerObject : public NativeObject
static MOZ_MUST_USE bool boundTargetFunctionGetter(JSContext* cx, unsigned argc, Value* vp);
static MOZ_MUST_USE bool boundThisGetter(JSContext* cx, unsigned argc, Value* vp);
static MOZ_MUST_USE bool boundArgumentsGetter(JSContext* cx, unsigned argc, Value* vp);
static MOZ_MUST_USE bool globalGetter(JSContext* cx, unsigned argc, Value* vp);
static MOZ_MUST_USE bool allocationSiteGetter(JSContext* cx, unsigned argc, Value* vp);
static MOZ_MUST_USE bool errorMessageNameGetter(JSContext* cx, unsigned argc, Value* vp);
static MOZ_MUST_USE bool errorNotesGetter(JSContext* cx, unsigned argc, Value* vp);

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

@ -147,7 +147,7 @@ class MOZ_STACK_CLASS ReportExceptionClosure
} // anonymous namespace
void
js::ReportErrorToGlobal(JSContext* cx, HandleObject global, HandleValue error)
js::ReportErrorToGlobal(JSContext* cx, Handle<GlobalObject*> global, HandleValue error)
{
MOZ_ASSERT(!cx->isExceptionPending());
#ifdef DEBUG

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

@ -92,13 +92,15 @@ extern MOZ_MUST_USE bool
ReportCompileWarning(JSContext* cx, ErrorMetadata&& metadata, UniquePtr<JSErrorNotes> notes,
unsigned flags, unsigned errorNumber, va_list args);
class GlobalObject;
/**
* Report the given error Value to the given global. The JSContext is not
* assumed to be in any particular compartment, but the global and error are
* assumed to be in any particular realm, but the global and error are
* expected to be same-compartment.
*/
extern void
ReportErrorToGlobal(JSContext* cx, JS::HandleObject global, JS::HandleValue error);
ReportErrorToGlobal(JSContext* cx, JS::Handle<js::GlobalObject*> global, JS::HandleValue error);
} // namespace js

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

@ -119,7 +119,7 @@ public:
return nullptr;
}
nsIGlobalObject* global = xpc::NativeGlobal(JS::CurrentGlobalOrNull(aCx));
nsIGlobalObject* global = xpc::CurrentNativeGlobal(aCx);
MOZ_ASSERT(global);
// RefPtr<File> needs to go out of scope before toObjectOrNull() is called because

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

@ -813,7 +813,7 @@ XPCConvert::JSData2Native(void* d, HandleValue s,
case nsXPTType::T_PROMISE:
{
nsIGlobalObject* glob = NativeGlobal(CurrentGlobalOrNull(cx));
nsIGlobalObject* glob = CurrentNativeGlobal(cx);
if (!glob) {
if (pErr) {
*pErr = NS_ERROR_UNEXPECTED;

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

@ -504,6 +504,13 @@ CompilationScope();
nsIGlobalObject*
NativeGlobal(JSObject* aObj);
/**
* Returns the nsIGlobalObject corresponding to |cx|'s JS global. Must not be
* called when |cx| is not in a Realm.
*/
nsIGlobalObject*
CurrentNativeGlobal(JSContext* cx);
/**
* If |aObj| is a window, returns the associated nsGlobalWindow.
* Otherwise, returns null.
@ -519,7 +526,7 @@ nsGlobalWindowInner*
WindowGlobalOrNull(JSObject* aObj);
/**
* If |cx| is in a compartment whose global is a window, returns the associated
* If |cx| is in a realm whose global is a window, returns the associated
* nsGlobalWindow. Otherwise, returns null.
*/
nsGlobalWindowInner*

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

@ -701,4 +701,10 @@ NativeGlobal(JSObject* obj)
return global;
}
nsIGlobalObject*
CurrentNativeGlobal(JSContext* cx)
{
return xpc::NativeGlobal(JS::CurrentGlobalOrNull(cx));
}
} // namespace xpc

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

@ -310,8 +310,7 @@ nsStyleSheetService::PreloadSheetAsync(nsIURI* aSheetURI, uint32_t aSheetType,
nsresult rv = GetParsingMode(aSheetType, &parsingMode);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIGlobalObject> global =
xpc::NativeGlobal(JS::CurrentGlobalOrNull(aCx));
nsCOMPtr<nsIGlobalObject> global = xpc::CurrentNativeGlobal(aCx);
NS_ENSURE_TRUE(global, NS_ERROR_UNEXPECTED);
ErrorResult errv;

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

@ -1,716 +0,0 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'All',
'type': 'none',
'xcode_create_dependents_test_runner': 1,
'dependencies': [
'some.gyp:*',
'../base/base.gyp:*',
'../content/content.gyp:*',
'../crypto/crypto.gyp:*',
'../media/media.gyp:*',
'../net/net.gyp:*',
'../sdch/sdch.gyp:*',
'../sql/sql.gyp:*',
'../testing/gmock.gyp:*',
'../testing/gtest.gyp:*',
'../third_party/bzip2/bzip2.gyp:*',
'../third_party/libxml/libxml.gyp:*',
'../third_party/sqlite/sqlite.gyp:*',
'../third_party/zlib/zlib.gyp:*',
'../ui/ui.gyp:*',
'../webkit/support/webkit_support.gyp:*',
'temp_gyp/googleurl.gyp:*',
],
'conditions': [
['OS!="ios"', {
'dependencies': [
'../cc/cc_tests.gyp:*',
'../chrome/chrome.gyp:*',
'../gpu/gpu.gyp:*',
'../gpu/tools/tools.gyp:*',
'../ipc/ipc.gyp:*',
'../jingle/jingle.gyp:*',
'../ppapi/ppapi.gyp:*',
'../ppapi/ppapi_internal.gyp:*',
'../printing/printing.gyp:*',
'../skia/skia.gyp:*',
'../sync/sync.gyp:*',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:*',
'../third_party/cld/cld.gyp:*',
'../third_party/codesighs/codesighs.gyp:*',
'../third_party/ffmpeg/ffmpeg.gyp:*',
'../third_party/iccjpeg/iccjpeg.gyp:*',
'../third_party/libpng/libpng.gyp:*',
'../third_party/libusb/libusb.gyp:*',
'../third_party/libwebp/libwebp.gyp:*',
'../third_party/libxslt/libxslt.gyp:*',
'../third_party/lzma_sdk/lzma_sdk.gyp:*',
'../third_party/mesa/mesa.gyp:*',
'../third_party/modp_b64/modp_b64.gyp:*',
'../third_party/npapi/npapi.gyp:*',
'../third_party/ots/ots.gyp:*',
'../third_party/qcms/qcms.gyp:*',
'../third_party/re2/re2.gyp:re2',
'../third_party/WebKit/Source/WebKit/chromium/All.gyp:*',
'../v8/tools/gyp/v8.gyp:*',
'../webkit/compositor_bindings/compositor_bindings_tests.gyp:*',
'../webkit/webkit.gyp:*',
'<(libjpeg_gyp_path):*',
],
}],
['os_posix==1 and OS!="android" and OS!="ios"', {
'dependencies': [
'../third_party/yasm/yasm.gyp:*#host',
],
}],
['OS=="mac" or OS=="ios" or OS=="win"', {
'dependencies': [
'../third_party/nss/nss.gyp:*',
],
}],
['OS=="win" or OS=="ios" or OS=="linux"', {
'dependencies': [
'../breakpad/breakpad.gyp:*',
],
}],
['OS=="mac"', {
'dependencies': [
'../third_party/ocmock/ocmock.gyp:*',
],
}],
['OS=="linux"', {
'dependencies': [
'../courgette/courgette.gyp:*',
'../dbus/dbus.gyp:*',
'../sandbox/sandbox.gyp:*',
],
'conditions': [
['branding=="Chrome"', {
'dependencies': [
'../chrome/chrome.gyp:linux_packages_<(channel)',
],
}],
['chromeos==0', {
'dependencies': [
'../third_party/cros_dbus_cplusplus/cros_dbus_cplusplus.gyp:*',
],
}],
],
}],
['(toolkit_uses_gtk==1) and (build_with_mozilla==0)', {
'dependencies': [
'../tools/gtk_clipboard_dump/gtk_clipboard_dump.gyp:*',
'../tools/xdisplaycheck/xdisplaycheck.gyp:*',
],
}],
['OS=="win"', {
'conditions': [
['win_use_allocator_shim==1', {
'dependencies': [
'../base/allocator/allocator.gyp:*',
],
}],
],
'dependencies': [
'../chrome_frame/chrome_frame.gyp:*',
'../cloud_print/cloud_print.gyp:*',
'../courgette/courgette.gyp:*',
'../rlz/rlz.gyp:*',
'../sandbox/sandbox.gyp:*',
'../third_party/angle/src/build_angle.gyp:*',
'../third_party/bsdiff/bsdiff.gyp:*',
'../third_party/bspatch/bspatch.gyp:*',
'../third_party/gles2_book/gles2_book.gyp:*',
'../tools/memory_watcher/memory_watcher.gyp:*',
],
}, {
'dependencies': [
'../third_party/libevent/libevent.gyp:*',
],
}],
['toolkit_views==1', {
'dependencies': [
'../ui/views/controls/webview/webview.gyp:*',
'../ui/views/views.gyp:*',
],
}],
['use_aura==1', {
'dependencies': [
'../ash/ash.gyp:*',
'../ui/aura/aura.gyp:*',
'../ui/oak/oak.gyp:*',
],
}],
['remoting==1', {
'dependencies': [
'../remoting/remoting.gyp:*',
],
}],
['use_openssl==0', {
'dependencies': [
'../net/third_party/nss/ssl.gyp:*',
],
}],
],
}, # target_name: All
{
'target_name': 'All_syzygy',
'type': 'none',
'conditions': [
['OS=="win" and fastbuild==0', {
'dependencies': [
'../chrome/installer/mini_installer_syzygy.gyp:*',
],
},
],
],
}, # target_name: All_syzygy
{
'target_name': 'chromium_builder_tests',
'type': 'none',
'dependencies': [
'../base/base.gyp:base_unittests',
'../crypto/crypto.gyp:crypto_unittests',
'../media/media.gyp:media_unittests',
'../net/net.gyp:net_unittests',
'../sql/sql.gyp:sql_unittests',
'../ui/ui.gyp:ui_unittests',
'temp_gyp/googleurl.gyp:googleurl_unittests',
],
'conditions': [
['OS!="ios"', {
'dependencies': [
'../cc/cc_tests.gyp:cc_unittests',
'../chrome/chrome.gyp:browser_tests',
'../chrome/chrome.gyp:interactive_ui_tests',
'../chrome/chrome.gyp:safe_browsing_tests',
'../chrome/chrome.gyp:sync_integration_tests',
'../chrome/chrome.gyp:unit_tests',
'../cloud_print/cloud_print.gyp:cloud_print_unittests',
'../content/content.gyp:content_browsertests',
'../content/content.gyp:content_unittests',
'../gpu/gpu.gyp:gpu_unittests',
'../gpu/gles2_conform_support/gles2_conform_support.gyp:gles2_conform_support',
'../ipc/ipc.gyp:ipc_tests',
'../jingle/jingle.gyp:jingle_unittests',
'../ppapi/ppapi_internal.gyp:ppapi_unittests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
'../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
'../webkit/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests',
],
}],
['OS=="win"', {
'dependencies': [
'../chrome/chrome.gyp:installer_util_unittests',
'../chrome/chrome.gyp:mini_installer_test',
# mini_installer_tests depends on mini_installer. This should be
# defined in installer.gyp.
'../chrome/installer/mini_installer.gyp:mini_installer',
'../chrome_frame/chrome_frame.gyp:chrome_frame_net_tests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_perftests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_reliability_tests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_tests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_unittests',
'../chrome_frame/chrome_frame.gyp:npchrome_frame',
'../courgette/courgette.gyp:courgette_unittests',
'../sandbox/sandbox.gyp:sbox_integration_tests',
'../sandbox/sandbox.gyp:sbox_unittests',
'../sandbox/sandbox.gyp:sbox_validation_tests',
'../webkit/webkit.gyp:pull_in_copy_TestNetscapePlugIn',
'../ui/views/views.gyp:views_unittests',
'../webkit/webkit.gyp:test_shell_common',
],
}],
['OS=="linux"', {
'dependencies': [
'../sandbox/sandbox.gyp:sandbox_linux_unittests',
],
}],
],
}, # target_name: chromium_builder_tests
{
'target_name': 'chromium_2010_builder_tests',
'type': 'none',
'dependencies': [
'chromium_builder_tests',
],
}, # target_name: chromium_2010_builder_tests
],
'conditions': [
['OS!="ios"', {
'targets': [
{
'target_name': 'chromium_builder_nacl_win_integration',
'type': 'none',
'dependencies': [
'chromium_builder_qa', # needed for pyauto
'chromium_builder_tests',
],
}, # target_name: chromium_builder_nacl_win_integration
{
'target_name': 'chromium_builder_perf',
'type': 'none',
'dependencies': [
'chromium_builder_qa', # needed for pyauto
'../chrome/chrome.gyp:performance_browser_tests',
'../chrome/chrome.gyp:performance_ui_tests',
'../chrome/chrome.gyp:sync_performance_tests',
],
}, # target_name: chromium_builder_perf
{
'target_name': 'chromium_gpu_builder',
'type': 'none',
'dependencies': [
'../chrome/chrome.gyp:gpu_tests',
'../chrome/chrome.gyp:performance_browser_tests',
'../chrome/chrome.gyp:performance_ui_tests',
'../gpu/gpu.gyp:gl_tests',
],
'conditions': [
['internal_gles2_conform_tests', {
'dependencies': [
'../gpu/gles2_conform_test/gles2_conform_test.gyp:gles2_conform_test',
],
}], # internal_gles2_conform
],
}, # target_name: chromium_gpu_builder
{
'target_name': 'chromium_gpu_debug_builder',
'type': 'none',
'dependencies': [
'../chrome/chrome.gyp:gpu_tests',
'../gpu/gpu.gyp:gl_tests',
],
'conditions': [
['internal_gles2_conform_tests', {
'dependencies': [
'../gpu/gles2_conform_test/gles2_conform_test.gyp:gles2_conform_test',
],
}], # internal_gles2_conform
],
}, # target_name: chromium_gpu_debug_builder
{
'target_name': 'chromium_builder_qa',
'type': 'none',
'dependencies': [
'../chrome/chrome.gyp:chromedriver',
# Dependencies of pyauto_functional tests.
'../remoting/remoting.gyp:remoting_webapp',
],
# not needed for Mozilla
# 'conditions': [
# # If you change this condition, make sure you also change it
# # in chrome_tests.gypi
# ['enable_automation==1 and (OS=="mac" or OS=="win" or (os_posix==1 and target_arch==python_arch))', {
# 'dependencies': [
# '../chrome/chrome.gyp:pyautolib',
# ],
# }],
['OS=="mac"', {
'dependencies': [
'../remoting/remoting.gyp:remoting_me2me_host_archive',
],
}],
['OS=="win" and component != "shared_library" and wix_exists == "True" and sas_dll_exists == "True"', {
'dependencies': [
'../remoting/remoting.gyp:remoting_host_installation',
],
}],
],
}, # target_name: chromium_builder_qa
{
'target_name': 'chromium_builder_perf_av',
'type': 'none',
'dependencies': [
'chromium_builder_qa', # needed for perf pyauto tests
'../webkit/webkit.gyp:pull_in_DumpRenderTree', # to run layout tests
],
}, # target_name: chromium_builder_perf_av
], # targets
}],
['OS=="mac"', {
'targets': [
{
# Target to build everything plus the dmg. We don't put the dmg
# in the All target because developers really don't need it.
'target_name': 'all_and_dmg',
'type': 'none',
'dependencies': [
'All',
'../chrome/chrome.gyp:build_app_dmg',
],
},
# These targets are here so the build bots can use them to build
# subsets of a full tree for faster cycle times.
{
'target_name': 'chromium_builder_dbg',
'type': 'none',
'dependencies': [
'../cc/cc_tests.gyp:cc_unittests',
'../chrome/chrome.gyp:browser_tests',
'../chrome/chrome.gyp:interactive_ui_tests',
'../chrome/chrome.gyp:safe_browsing_tests',
'../chrome/chrome.gyp:sync_integration_tests',
'../chrome/chrome.gyp:unit_tests',
'../cloud_print/cloud_print.gyp:cloud_print_unittests',
'../content/content.gyp:content_browsertests',
'../content/content.gyp:content_unittests',
'../ui/ui.gyp:ui_unittests',
'../gpu/gpu.gyp:gpu_unittests',
'../ipc/ipc.gyp:ipc_tests',
'../jingle/jingle.gyp:jingle_unittests',
'../media/media.gyp:media_unittests',
'../ppapi/ppapi_internal.gyp:ppapi_unittests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../rlz/rlz.gyp:*',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
'../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
'../webkit/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests',
'temp_gyp/googleurl.gyp:googleurl_unittests',
],
},
{
'target_name': 'chromium_builder_rel',
'type': 'none',
'dependencies': [
'../cc/cc_tests.gyp:cc_unittests',
'../chrome/chrome.gyp:browser_tests',
'../chrome/chrome.gyp:performance_browser_tests',
'../chrome/chrome.gyp:performance_ui_tests',
'../chrome/chrome.gyp:safe_browsing_tests',
'../chrome/chrome.gyp:sync_integration_tests',
'../chrome/chrome.gyp:unit_tests',
'../cloud_print/cloud_print.gyp:cloud_print_unittests',
'../content/content.gyp:content_browsertests',
'../content/content.gyp:content_unittests',
'../ui/ui.gyp:ui_unittests',
'../gpu/gpu.gyp:gpu_unittests',
'../ipc/ipc.gyp:ipc_tests',
'../jingle/jingle.gyp:jingle_unittests',
'../media/media.gyp:media_unittests',
'../ppapi/ppapi_internal.gyp:ppapi_unittests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
'../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
'../webkit/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests',
'temp_gyp/googleurl.gyp:googleurl_unittests',
],
},
{
'target_name': 'chromium_builder_dbg_tsan_mac',
'type': 'none',
'dependencies': [
'../base/base.gyp:base_unittests',
'../cloud_print/cloud_print.gyp:cloud_print_unittests',
'../crypto/crypto.gyp:crypto_unittests',
'temp_gyp/googleurl.gyp:googleurl_unittests',
'../net/net.gyp:net_unittests',
'../ipc/ipc.gyp:ipc_tests',
'../jingle/jingle.gyp:jingle_unittests',
'../media/media.gyp:media_unittests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
'../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
],
},
{
'target_name': 'chromium_builder_asan_mac',
'type': 'none',
'dependencies': [
'../chrome/chrome.gyp:chrome',
'../net/net.gyp:dns_fuzz_stub',
'../webkit/webkit.gyp:pull_in_DumpRenderTree',
],
},
{
'target_name': 'chromium_builder_dbg_valgrind_mac',
'type': 'none',
'dependencies': [
'../base/base.gyp:base_unittests',
'../cloud_print/cloud_print.gyp:cloud_print_unittests',
'../crypto/crypto.gyp:crypto_unittests',
'../ipc/ipc.gyp:ipc_tests',
'../media/media.gyp:media_unittests',
'../net/net.gyp:net_unittests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../chrome/chrome.gyp:safe_browsing_tests',
'../chrome/chrome.gyp:unit_tests',
'../content/content.gyp:content_unittests',
'../ui/ui.gyp:ui_unittests',
'../jingle/jingle.gyp:jingle_unittests',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
'../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
'temp_gyp/googleurl.gyp:googleurl_unittests',
],
},
], # targets
}], # OS="mac"
['OS=="win"', {
'targets': [
# These targets are here so the build bots can use them to build
# subsets of a full tree for faster cycle times.
{
'target_name': 'chromium_builder',
'type': 'none',
'dependencies': [
'../cc/cc_tests.gyp:cc_unittests',
'../chrome/chrome.gyp:browser_tests',
'../chrome/chrome.gyp:installer_util_unittests',
'../chrome/chrome.gyp:interactive_ui_tests',
'../chrome/chrome.gyp:mini_installer_test',
'../chrome/chrome.gyp:performance_browser_tests',
'../chrome/chrome.gyp:performance_ui_tests',
'../chrome/chrome.gyp:safe_browsing_tests',
'../chrome/chrome.gyp:sync_integration_tests',
'../chrome/chrome.gyp:unit_tests',
'../cloud_print/cloud_print.gyp:cloud_print_unittests',
'../content/content.gyp:content_browsertests',
'../content/content.gyp:content_unittests',
# mini_installer_tests depends on mini_installer. This should be
# defined in installer.gyp.
'../chrome/installer/mini_installer.gyp:mini_installer',
'../chrome_frame/chrome_frame.gyp:chrome_frame_net_tests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_perftests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_reliability_tests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_tests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_unittests',
'../chrome_frame/chrome_frame.gyp:npchrome_frame',
'../courgette/courgette.gyp:courgette_unittests',
'../ui/ui.gyp:ui_unittests',
'../gpu/gpu.gyp:gpu_unittests',
'../ipc/ipc.gyp:ipc_tests',
'../jingle/jingle.gyp:jingle_unittests',
'../media/media.gyp:media_unittests',
'../ppapi/ppapi_internal.gyp:ppapi_unittests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
'../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
'../ui/views/views.gyp:views_unittests',
'../webkit/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests',
'../webkit/webkit.gyp:pull_in_copy_TestNetscapePlugIn',
'temp_gyp/googleurl.gyp:googleurl_unittests',
],
},
{
'target_name': 'chromium_builder_win_cf',
'type': 'none',
'dependencies': [
'../chrome_frame/chrome_frame.gyp:chrome_frame_net_tests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_perftests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_reliability_tests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_tests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_unittests',
'../chrome_frame/chrome_frame.gyp:npchrome_frame',
],
},
{
'target_name': 'chromium_builder_dbg_tsan_win',
'type': 'none',
'dependencies': [
'../base/base.gyp:base_unittests',
'../cloud_print/cloud_print.gyp:cloud_print_unittests',
'../content/content.gyp:content_unittests',
'../crypto/crypto.gyp:crypto_unittests',
'../ipc/ipc.gyp:ipc_tests',
'../jingle/jingle.gyp:jingle_unittests',
'../media/media.gyp:media_unittests',
'../net/net.gyp:net_unittests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../sql/sql.gyp:sql_unittests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
'../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
'temp_gyp/googleurl.gyp:googleurl_unittests',
],
},
{
'target_name': 'chromium_builder_dbg_drmemory_win',
'type': 'none',
'dependencies': [
'../base/base.gyp:base_unittests',
'../chrome/chrome.gyp:unit_tests',
'../cloud_print/cloud_print.gyp:cloud_print_unittests',
'../content/content.gyp:content_unittests',
'../crypto/crypto.gyp:crypto_unittests',
'../ipc/ipc.gyp:ipc_tests',
'../jingle/jingle.gyp:jingle_unittests',
'../media/media.gyp:media_unittests',
'../net/net.gyp:net_unittests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../sql/sql.gyp:sql_unittests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
'../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
'temp_gyp/googleurl.gyp:googleurl_unittests',
],
},
{
'target_name': 'webkit_builder_win',
'type': 'none',
'dependencies': [
'../webkit/webkit.gyp:test_shell',
'../webkit/webkit.gyp:test_shell_tests',
'../webkit/webkit.gyp:pull_in_webkit_unit_tests',
'../webkit/webkit.gyp:pull_in_DumpRenderTree',
],
},
{
'target_name': 'chromium_builder_qa_nacl_win64',
'type': 'none',
'dependencies': [
'chromium_builder_qa', # needed for pyauto
'../chrome/chrome.gyp:chrome_nacl_win64',
],
}, # target_name: chromium_builder_qa_nacl_win64
], # targets
'conditions': [
['branding=="Chrome"', {
'targets': [
{
'target_name': 'chrome_official_builder',
'type': 'none',
'dependencies': [
'../chrome/chrome.gyp:chromedriver',
'../chrome/chrome.gyp:crash_service',
'../chrome/chrome.gyp:crash_service_win64',
'../chrome/chrome.gyp:performance_ui_tests',
'../chrome/chrome.gyp:policy_templates',
'../chrome/chrome.gyp:pyautolib',
'../chrome/chrome.gyp:reliability_tests',
'../chrome/chrome.gyp:automated_ui_tests',
'../chrome/installer/mini_installer.gyp:mini_installer',
'../chrome_frame/chrome_frame.gyp:npchrome_frame',
'../courgette/courgette.gyp:courgette',
'../courgette/courgette.gyp:courgette64',
'../cloud_print/cloud_print.gyp:cloud_print',
'../remoting/remoting.gyp:remoting_webapp',
'../third_party/adobe/flash/flash_player.gyp:flash_player',
'../third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmplugin',
],
'conditions': [
['internal_pdf', {
'dependencies': [
'../pdf/pdf.gyp:pdf',
],
}], # internal_pdf
['component != "shared_library" and wix_exists == "True" and \
sas_dll_exists == "True"', {
'dependencies': [
'../remoting/remoting.gyp:remoting_host_installation',
],
}], # component != "shared_library"
]
},
], # targets
}], # branding=="Chrome"
], # conditions
}], # OS="win"
['use_aura==1', {
'targets': [
{
'target_name': 'aura_builder',
'type': 'none',
'dependencies': [
'../cc/cc_tests.gyp:cc_unittests',
'../chrome/chrome.gyp:browser_tests',
'../chrome/chrome.gyp:chrome',
'../chrome/chrome.gyp:interactive_ui_tests',
'../chrome/chrome.gyp:unit_tests',
'../content/content.gyp:content_browsertests',
'../content/content.gyp:content_unittests',
'../ppapi/ppapi_internal.gyp:ppapi_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../ui/aura/aura.gyp:*',
'../ui/compositor/compositor.gyp:*',
'../ui/ui.gyp:ui_unittests',
'../ui/views/views.gyp:views',
'../ui/views/views.gyp:views_unittests',
'../webkit/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests',
'../webkit/webkit.gyp:pull_in_webkit_unit_tests',
],
'conditions': [
['OS=="win"', {
# Remove this when we have the real compositor.
'copies': [
{
'destination': '<(PRODUCT_DIR)',
'files': ['../third_party/directxsdk/files/dlls/D3DX10d_43.dll']
},
],
'dependencies': [
'../content/content.gyp:content_unittests',
'../chrome/chrome.gyp:crash_service',
'../chrome/chrome.gyp:crash_service_win64',
],
}],
['use_ash==1', {
'dependencies': [
'../ash/ash.gyp:ash_shell',
'../ash/ash.gyp:ash_unittests',
],
}],
['OS=="linux"', {
# Tests that currently only work on Linux.
'dependencies': [
'../base/base.gyp:base_unittests',
'../content/content.gyp:content_unittests',
'../ipc/ipc.gyp:ipc_tests',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
],
}],
['OS=="mac"', {
# Exclude dependencies that are not currently implemented.
'dependencies!': [
'../chrome/chrome.gyp:chrome',
'../chrome/chrome.gyp:unit_tests',
'../ui/views/views.gyp:views_unittests',
],
}],
['chromeos==1', {
'dependencies': [
'../chromeos/chromeos.gyp:chromeos_unittests',
],
}],
],
},
], # targets
}], # "use_aura==1"
['test_isolation_mode != "noop"', {
'targets': [
{
'target_name': 'chromium_swarm_tests',
'type': 'none',
'dependencies': [
'../base/base.gyp:base_unittests_run',
'../chrome/chrome.gyp:browser_tests_run',
'../chrome/chrome.gyp:unit_tests_run',
'../net/net.gyp:net_unittests_run',
],
}, # target_name: chromium_swarm_tests
],
}],
], # conditions
}

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

@ -1,115 +0,0 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This is all.gyp file for Android to prevent breakage in Android and other
# platform; It will be churning a lot in the short term and eventually be merged
# into all.gyp.
{
'variables': {
# A hook that can be overridden in other repositories to add additional
# compilation targets to 'All'
'android_app_targets%': [],
},
'targets': [
{
'target_name': 'All',
'type': 'none',
'dependencies': [
'../content/content.gyp:content_shell_apk',
'<@(android_app_targets)',
'android_builder_tests',
'../android_webview/android_webview.gyp:android_webview_apk',
'../chrome/chrome.gyp:chromium_testshell',
],
}, # target_name: All
{
# The current list of tests for android. This is temporary
# until the full set supported. If adding a new test here,
# please also add it to build/android/run_tests.py, else the
# test is not run.
#
# WARNING:
# Do not add targets here without communicating the implications
# on tryserver triggers and load. Discuss with jrg please.
'target_name': 'android_builder_tests',
'type': 'none',
'dependencies': [
'../base/android/jni_generator/jni_generator.gyp:jni_generator_tests',
'../base/base.gyp:base_unittests',
'../cc/cc_tests.gyp:cc_unittests',
'../chrome/chrome.gyp:unit_tests',
'../content/content.gyp:content_shell_test_apk',
'../content/content.gyp:content_unittests',
'../gpu/gpu.gyp:gpu_unittests',
'../ipc/ipc.gyp:ipc_tests',
'../media/media.gyp:media_unittests',
'../net/net.gyp:net_unittests',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../third_party/WebKit/Source/WebKit/chromium/All.gyp:*',
'../tools/android/device_stats_monitor/device_stats_monitor.gyp:device_stats_monitor',
'../tools/android/fake_dns/fake_dns.gyp:fake_dns',
'../tools/android/forwarder2/forwarder.gyp:forwarder2',
'../tools/android/md5sum/md5sum.gyp:md5sum',
'../ui/ui.gyp:ui_unittests',
# From here down: not added to run_tests.py yet.
'../jingle/jingle.gyp:jingle_unittests',
# Required by ui_unittests.
# TODO(wangxianzhu): It'd better let ui_unittests depend on it, but
# this would cause circular gyp dependency which needs refactoring the
# gyps to resolve.
'../chrome/chrome_resources.gyp:packed_resources',
],
'conditions': [
['linux_breakpad==1', {
'dependencies': [
'../breakpad/breakpad.gyp:breakpad_unittests',
],
}],
['"<(gtest_target_type)"=="shared_library"', {
'dependencies': [
# The first item is simply the template. We add as a dep
# to make sure it builds in ungenerated form. TODO(jrg):
# once stable, transition to a test-only (optional)
# target.
'../testing/android/native_test.gyp:native_test_apk',
# Unit test bundles packaged as an apk.
'../base/base.gyp:base_unittests_apk',
'../cc/cc_tests.gyp:cc_unittests_apk',
'../chrome/chrome.gyp:unit_tests_apk',
'../content/content.gyp:content_unittests_apk',
'../gpu/gpu.gyp:gpu_unittests_apk',
'../ipc/ipc.gyp:ipc_tests_apk',
'../media/media.gyp:media_unittests_apk',
'../net/net.gyp:net_unittests_apk',
'../sql/sql.gyp:sql_unittests_apk',
'../sync/sync.gyp:sync_unit_tests_apk',
'../ui/ui.gyp:ui_unittests_apk',
'../android_webview/android_webview.gyp:android_webview_test_apk',
'../chrome/chrome.gyp:chromium_testshell_test_apk',
],
}],
],
},
{
# Experimental / in-progress targets that are expected to fail
# but we still try to compile them on bots (turning the stage
# orange, not red).
'target_name': 'android_experimental',
'type': 'none',
'dependencies': [
],
},
{
# In-progress targets that are expected to fail and are NOT run
# on any bot.
'target_name': 'android_in_progress',
'type': 'none',
'dependencies': [
'../content/content.gyp:content_browsertests',
],
},
], # targets
}

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

@ -1,6 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# 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/.
#dummy gypi: contents should be discarded due to an enclosing 'conditions:' element.
{}

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

@ -1,75 +0,0 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is meant to be included into a target to provide a rule
# to build APK based test suites.
#
# To use this, create a gyp target with the following form:
# {
# 'target_name': 'test_suite_name_apk',
# 'type': 'none',
# 'variables': {
# 'test_suite_name': 'test_suite_name', # string
# 'input_shlib_path' : '/path/to/test_suite.so', # string
# 'input_jars_paths': ['/path/to/test_suite.jar', ... ], # list
# },
# 'includes': ['path/to/this/gypi/file'],
# }
#
{
'variables': {
'input_jars_paths': [
# Needed by ChromeNativeTestActivity.java.
'<(PRODUCT_DIR)/lib.java/chromium_base.jar',
],
},
'target_conditions': [
['_toolset == "target"', {
'conditions': [
['OS == "android" and gtest_target_type == "shared_library"', {
'actions': [{
'action_name': 'apk_<(test_suite_name)',
'message': 'Building <(test_suite_name) test apk.',
'inputs': [
'<(DEPTH)/testing/android/AndroidManifest.xml',
'<(DEPTH)/testing/android/generate_native_test.py',
'<(input_shlib_path)',
'>@(input_jars_paths)',
],
'outputs': [
'<(PRODUCT_DIR)/<(test_suite_name)_apk/<(test_suite_name)-debug.apk',
],
'action': [
'<(DEPTH)/testing/android/generate_native_test.py',
'--native_library',
'<(input_shlib_path)',
'--jars',
'">@(input_jars_paths)"',
'--output',
'<(PRODUCT_DIR)/<(test_suite_name)_apk',
'--strip-binary=<(android_strip)',
'--app_abi',
'<(android_app_abi)',
'--ant-args',
'-DPRODUCT_DIR=<(ant_build_out)',
'--ant-args',
'-DANDROID_SDK=<(android_sdk)',
'--ant-args',
'-DANDROID_SDK_ROOT=<(android_sdk_root)',
'--ant-args',
'-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
'--ant-args',
'-DANDROID_SDK_VERSION=<(android_sdk_version)',
'--ant-args',
'-DANDROID_GDBSERVER=<(android_gdbserver)',
'--ant-args',
'-DCHROMIUM_SRC=<(ant_build_out)/../..',
],
}],
}], # 'OS == "android" and gtest_target_type == "shared_library"
], # conditions
}],
], # target_conditions
}

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

@ -1,29 +0,0 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This GYP file should be included for every target in Chromium that is built
# using the NaCl toolchain.
{
'includes': [
'../native_client/build/untrusted.gypi',
],
'target_defaults': {
'conditions': [
['target_arch=="arm"', {
'variables': {
'clang': 1,
},
'defines': [
# Needed by build/build_config.h processor architecture detection.
'__ARMEL__',
# Needed by base/third_party/nspr/prtime.cc.
'__arm__',
# Disable ValGrind. The assembly code it generates causes the build
# to fail.
'NVALGRIND',
],
}],
],
},
}

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

@ -1,48 +0,0 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is meant to be included into an action to copy test data files into
# an iOS app bundle. To use this the following variables need to be defined:
# test_data_files: list: paths to test data files or directories
# test_data_prefix: string: a directory prefix that will be prepended to each
# output path. Generally, this should be the base
# directory of the gypi file containing the unittest
# target (e.g. "base" or "chrome").
#
# To use this, create a gyp target with the following form:
# {
# 'target_name': 'my_unittests',
# 'conditions': [
# ['OS == "ios"', {
# 'actions': [
# {
# 'action_name': 'copy_test_data',
# 'variables': {
# 'test_data_files': [
# 'path/to/datafile.txt',
# 'path/to/data/directory/',
# ]
# 'test_data_prefix' : 'prefix',
# },
# 'includes': ['path/to/this/gypi/file'],
# },
# ],
# }],
# }
#
{
'inputs': [
'<!@pymod_do_main(copy_test_data_ios --inputs <(test_data_files))',
],
'outputs': [
'<!@pymod_do_main(copy_test_data_ios -o <(PRODUCT_DIR)/<(_target_name).app/<(test_data_prefix) --outputs <(test_data_files))',
],
'action': [
'python',
'<(DEPTH)/build/copy_test_data_ios.py',
'-o', '<(PRODUCT_DIR)/<(_target_name).app/<(test_data_prefix)',
'<(_inputs)',
],
}

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

@ -1,33 +0,0 @@
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is meant to be included into an action to invoke grit in a
# consistent manner. To use this the following variables need to be
# defined:
# grit_grd_file: string: grd file path
# grit_out_dir: string: the output directory path
# It would be really nice to do this with a rule instead of actions, but it
# would need to determine inputs and outputs via grit_info on a per-file
# basis. GYP rules dont currently support that. They could be extended to
# do this, but then every generator would need to be updated to handle this.
{
'variables': {
'grit_cmd': ['python', '<(DEPTH)/tools/grit/grit.py'],
},
'inputs': [
'<!@pymod_do_main(grit_info <@(grit_defines) --inputs <(grit_grd_file))',
],
'outputs': [
'<!@pymod_do_main(grit_info <@(grit_defines) --outputs \'<(grit_out_dir)\' <(grit_grd_file))',
],
'action': ['<@(grit_cmd)',
'-i', '<(grit_grd_file)', 'build',
'-fGRIT_DIR/../gritsettings/resource_ids',
'-o', '<(grit_out_dir)',
'<@(grit_defines)' ],
'msvs_cygwin_shell': 0,
'message': 'Generating resources from <(grit_grd_file)',
}

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

@ -1,30 +0,0 @@
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is meant to be included into a target that will have one or more
# uses of grit_action.gypi. To use this the following variables need to be
# defined:
# grit_out_dir: string: the output directory path
# NOTE: This file is optional, not all targets that use grit include it, some
# do their own custom directives instead.
{
'conditions': [
# If the target is a direct binary, it needs to be able to find the header,
# otherwise it probably a supporting target just for grit so the include
# dir needs to be set on anything that depends on this action.
['_type=="executable" or _type=="shared_library" or \
_type=="loadable_module" or _type=="static_library"', {
'include_dirs': [
'<(grit_out_dir)',
],
}, {
'direct_dependent_settings': {
'include_dirs': [
'<(grit_out_dir)',
],
},
}],
],
}

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

@ -1,12 +0,0 @@
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Simple launcher script for gyp_chromium.py.
# TODO(sbc): This should probably be shell script but for historical
# reasons (all the python code used to live in this script without a
# .py extension, and was often run as 'python gyp_chromium') it is
# currently still python.
execfile(__file__ + '.py')

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

@ -1,68 +0,0 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This script is now only used by the closure_compilation builders."""
import argparse
import glob
import gyp_environment
import os
import shlex
import sys
script_dir = os.path.dirname(os.path.realpath(__file__))
chrome_src = os.path.abspath(os.path.join(script_dir, os.pardir))
sys.path.insert(0, os.path.join(chrome_src, 'tools', 'gyp', 'pylib'))
import gyp
def ProcessGypDefinesItems(items):
"""Converts a list of strings to a list of key-value pairs."""
result = []
for item in items:
tokens = item.split('=', 1)
# Some GYP variables have hyphens, which we don't support.
if len(tokens) == 2:
result += [(tokens[0], tokens[1])]
else:
# No value supplied, treat it as a boolean and set it. Note that we
# use the string '1' here so we have a consistent definition whether
# you do 'foo=1' or 'foo'.
result += [(tokens[0], '1')]
return result
def GetSupplementalFiles():
return []
def GetGypVars(_):
"""Returns a dictionary of all GYP vars."""
# GYP defines from the environment.
env_items = ProcessGypDefinesItems(
shlex.split(os.environ.get('GYP_DEFINES', '')))
# GYP defines from the command line.
parser = argparse.ArgumentParser()
parser.add_argument('-D', dest='defines', action='append', default=[])
cmdline_input_items = parser.parse_known_args()[0].defines
cmdline_items = ProcessGypDefinesItems(cmdline_input_items)
return dict(env_items + cmdline_items)
def main():
gyp_environment.SetEnvironment()
print 'Updating projects from gyp files...'
sys.stdout.flush()
sys.exit(gyp.main(sys.argv[1:] + [
'--check',
'--no-circular-check',
'-I', os.path.join(script_dir, 'common.gypi'),
'-D', 'gyp_output_dir=out']))
if __name__ == '__main__':
sys.exit(main())

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

@ -1,30 +0,0 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Sets up various automatic gyp environment variables. These are used by
gyp_chromium and landmines.py which run at different stages of runhooks. To
make sure settings are consistent between them, all setup should happen here.
"""
import gyp_helper
import os
import sys
import vs_toolchain
def SetEnvironment():
"""Sets defaults for GYP_* variables."""
gyp_helper.apply_chromium_gyp_env()
# Default to ninja on linux and windows, but only if no generator has
# explicitly been set.
# Also default to ninja on mac, but only when not building chrome/ios.
# . -f / --format has precedence over the env var, no need to check for it
# . set the env var only if it hasn't been set yet
# . chromium.gyp_env has been applied to os.environ at this point already
if sys.platform.startswith(('linux', 'win', 'freebsd', 'darwin')) and \
not os.environ.get('GYP_GENERATORS'):
os.environ['GYP_GENERATORS'] = 'ninja'
vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs()

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

@ -1,68 +0,0 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file helps gyp_chromium and landmines correctly set up the gyp
# environment from chromium.gyp_env on disk
import os
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
CHROME_SRC = os.path.dirname(SCRIPT_DIR)
def apply_gyp_environment_from_file(file_path):
"""Reads in a *.gyp_env file and applies the valid keys to os.environ."""
if not os.path.exists(file_path):
return
with open(file_path, 'rU') as f:
file_contents = f.read()
try:
file_data = eval(file_contents, {'__builtins__': None}, None)
except SyntaxError, e:
e.filename = os.path.abspath(file_path)
raise
supported_vars = (
'CC',
'CC_wrapper',
'CC.host_wrapper',
'CHROMIUM_GYP_FILE',
'CHROMIUM_GYP_SYNTAX_CHECK',
'CXX',
'CXX_wrapper',
'CXX.host_wrapper',
'GYP_DEFINES',
'GYP_GENERATOR_FLAGS',
'GYP_CROSSCOMPILE',
'GYP_GENERATOR_OUTPUT',
'GYP_GENERATORS',
'GYP_INCLUDE_FIRST',
'GYP_INCLUDE_LAST',
'GYP_MSVS_VERSION',
)
for var in supported_vars:
file_val = file_data.get(var)
if file_val:
if var in os.environ:
behavior = 'replaces'
if var == 'GYP_DEFINES':
result = file_val + ' ' + os.environ[var]
behavior = 'merges with, and individual components override,'
else:
result = os.environ[var]
print 'INFO: Environment value for "%s" %s value in %s' % (
var, behavior, os.path.abspath(file_path)
)
string_padding = max(len(var), len(file_path), len('result'))
print ' %s: %s' % (var.rjust(string_padding), os.environ[var])
print ' %s: %s' % (file_path.rjust(string_padding), file_val)
os.environ[var] = result
else:
os.environ[var] = file_val
def apply_chromium_gyp_env():
if 'SKIP_CHROMIUM_GYP_ENV' not in os.environ:
# Update the environment based on chromium.gyp_env
path = os.path.join(os.path.dirname(CHROME_SRC), 'chromium.gyp_env')
apply_gyp_environment_from_file(path)

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

@ -1,191 +0,0 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Converts a given gypi file to a python scope and writes the result to stdout.
USING THIS SCRIPT IN CHROMIUM
Forking Python to run this script in the middle of GN is slow, especially on
Windows, and it makes both the GYP and GN files harder to follow. You can't
use "git grep" to find files in the GN build any more, and tracking everything
in GYP down requires a level of indirection. Any calls will have to be removed
and cleaned up once the GYP-to-GN transition is complete.
As a result, we only use this script when the list of files is large and
frequently-changing. In these cases, having one canonical list outweights the
downsides.
As of this writing, the GN build is basically complete. It's likely that all
large and frequently changing targets where this is appropriate use this
mechanism already. And since we hope to turn down the GYP build soon, the time
horizon is also relatively short. As a result, it is likely that no additional
uses of this script should every be added to the build. During this later part
of the transition period, we should be focusing more and more on the absolute
readability of the GN build.
HOW TO USE
It is assumed that the file contains a toplevel dictionary, and this script
will return that dictionary as a GN "scope" (see example below). This script
does not know anything about GYP and it will not expand variables or execute
conditions.
It will strip conditions blocks.
A variables block at the top level will be flattened so that the variables
appear in the root dictionary. This way they can be returned to the GN code.
Say your_file.gypi looked like this:
{
'sources': [ 'a.cc', 'b.cc' ],
'defines': [ 'ENABLE_DOOM_MELON' ],
}
You would call it like this:
gypi_values = exec_script("//build/gypi_to_gn.py",
[ rebase_path("your_file.gypi") ],
"scope",
[ "your_file.gypi" ])
Notes:
- The rebase_path call converts the gypi file from being relative to the
current build file to being system absolute for calling the script, which
will have a different current directory than this file.
- The "scope" parameter tells GN to interpret the result as a series of GN
variable assignments.
- The last file argument to exec_script tells GN that the given file is a
dependency of the build so Ninja can automatically re-run GN if the file
changes.
Read the values into a target like this:
component("mycomponent") {
sources = gypi_values.sources
defines = gypi_values.defines
}
Sometimes your .gypi file will include paths relative to a different
directory than the current .gn file. In this case, you can rebase them to
be relative to the current directory.
sources = rebase_path(gypi_values.sources, ".",
"//path/gypi/input/values/are/relative/to")
This script will tolerate a 'variables' in the toplevel dictionary or not. If
the toplevel dictionary just contains one item called 'variables', it will be
collapsed away and the result will be the contents of that dictinoary. Some
.gypi files are written with or without this, depending on how they expect to
be embedded into a .gyp file.
This script also has the ability to replace certain substrings in the input.
Generally this is used to emulate GYP variable expansion. If you passed the
argument "--replace=<(foo)=bar" then all instances of "<(foo)" in strings in
the input will be replaced with "bar":
gypi_values = exec_script("//build/gypi_to_gn.py",
[ rebase_path("your_file.gypi"),
"--replace=<(foo)=bar"],
"scope",
[ "your_file.gypi" ])
"""
import gn_helpers
from optparse import OptionParser
import sys
def LoadPythonDictionary(path):
file_string = open(path).read()
try:
file_data = eval(file_string, {'__builtins__': None}, None)
except SyntaxError, e:
e.filename = path
raise
except Exception, e:
raise Exception("Unexpected error while reading %s: %s" % (path, str(e)))
assert isinstance(file_data, dict), "%s does not eval to a dictionary" % path
# Flatten any variables to the top level.
if 'variables' in file_data:
file_data.update(file_data['variables'])
del file_data['variables']
# Strip all elements that this script can't process.
elements_to_strip = [
'conditions',
'target_conditions',
'targets',
'includes',
'actions',
]
for element in elements_to_strip:
if element in file_data:
del file_data[element]
return file_data
def ReplaceSubstrings(values, search_for, replace_with):
"""Recursively replaces substrings in a value.
Replaces all substrings of the "search_for" with "repace_with" for all
strings occurring in "values". This is done by recursively iterating into
lists as well as the keys and values of dictionaries."""
if isinstance(values, str):
return values.replace(search_for, replace_with)
if isinstance(values, list):
return [ReplaceSubstrings(v, search_for, replace_with) for v in values]
if isinstance(values, dict):
# For dictionaries, do the search for both the key and values.
result = {}
for key, value in values.items():
new_key = ReplaceSubstrings(key, search_for, replace_with)
new_value = ReplaceSubstrings(value, search_for, replace_with)
result[new_key] = new_value
return result
# Assume everything else is unchanged.
return values
def main():
parser = OptionParser()
parser.add_option("-r", "--replace", action="append",
help="Replaces substrings. If passed a=b, replaces all substrs a with b.")
(options, args) = parser.parse_args()
if len(args) != 1:
raise Exception("Need one argument which is the .gypi file to read.")
data = LoadPythonDictionary(args[0])
if options.replace:
# Do replacements for all specified patterns.
for replace in options.replace:
split = replace.split('=')
# Allow "foo=" to replace with nothing.
if len(split) == 1:
split.append('')
assert len(split) == 2, "Replacement must be of the form 'key=value'."
data = ReplaceSubstrings(data, split[0], split[1])
# Sometimes .gypi files use the GYP syntax with percents at the end of the
# variable name (to indicate not to overwrite a previously-defined value):
# 'foo%': 'bar',
# Convert these to regular variables.
for key in data:
if len(key) > 1 and key[len(key) - 1] == '%':
data[key[:-1]] = data[key]
del data[key]
print gn_helpers.ToGNString(data)
if __name__ == '__main__':
try:
main()
except Exception, e:
print str(e)
sys.exit(1)

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

@ -1,79 +0,0 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Xcode throws an error if an iOS target depends on a Mac OS X target. So
# any place a utility program needs to be build and run, an action is
# used to run ninja as script to work around this.
# Example:
# {
# 'target_name': 'foo',
# 'type': 'none',
# 'variables': {
# # The name of a directory used for ninja. This cannot be shared with
# # another mac build.
# 'ninja_output_dir': 'ninja-foo',
# # The list of all the gyp files that contain the targets to run.
# 're_run_targets': [
# 'foo.gyp',
# ],
# },
# 'includes': ['path_to/mac_build.gypi'],
# 'actions': [
# {
# 'action_name': 'compile foo',
# 'inputs': [],
# 'outputs': [],
# 'action': [
# '<@(ninja_cmd)',
# # All the targets to build.
# 'foo1',
# 'foo2',
# ],
# },
# ],
# }
{
'variables': {
# Convenience variable pointing to the ninja product directory.
'ninja_product_dir':
'<(DEPTH)/xcodebuild/<(ninja_output_dir)/<(CONFIGURATION_NAME)',
# Common ninja command line flags.
'ninja_cmd': [
# Bounce through clean_env to clean up the environment so things
# set by the iOS build don't pollute the Mac build.
'<(DEPTH)/build/ios/clean_env.py',
# ninja must be found in the PATH.
'ADD_TO_PATH=<!(echo $PATH)',
'ninja',
'-C',
'<(ninja_product_dir)',
],
# Common syntax to rerun gyp to generate the Mac projects.
're_run_gyp': [
'build/gyp_chromium',
# Don't use anything set for the iOS side of things.
'--ignore-environment',
# Generate for ninja
'--format=ninja',
# Generate files into xcodebuild/ninja
'-Goutput_dir=xcodebuild/<(ninja_output_dir)',
# nacl isn't in the iOS checkout, make sure it's turned off
'-Ddisable_nacl=1',
# Add a variable to handle specific cases for mac_build.
'-Dios_mac_build=1',
# Pass through the Mac SDK version.
'-Dmac_sdk=<(mac_sdk)',
],
# Rerun gyp for each of the projects needed. This is what actually
# generates the projects on disk.
're_run_gyp_execution':
'<!(cd <(DEPTH) && <@(re_run_gyp) <@(re_run_targets))',
},
# Since these are used to generate things needed by other targets, make
# them hard dependencies so they are always built first.
'hard_dependency': 1,
}

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

@ -1,53 +0,0 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is meant to be included into a target to provide a rule
# to generate jni bindings for system Java-files in a consistent manner.
#
# To use this, create a gyp target with the following form:
# {
# 'target_name': 'android_jar_jni_headers',
# 'type': 'none',
# 'variables': {
# 'jni_gen_dir': 'chrome',
# 'input_java_class': 'java/io/InputStream.class',
# 'input_jar_file': '<(android_sdk)/android.jar',
# },
# 'includes': [ '../build/jar_file_jni_generator.gypi' ],
# },
{
'variables': {
'jni_generator': '<(DEPTH)/base/android/jni_generator/jni_generator.py',
},
'actions': [
{
'action_name': 'generate_jni_headers_from_jar_file',
'inputs': [
'<(jni_generator)',
'<(input_jar_file)',
],
'variables': {
'java_class_name': '<!(basename <(input_java_class)|sed "s/\.class//")'
},
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_dir)/jni/<(java_class_name)_jni.h',
],
'action': [
'<(jni_generator)',
'-j',
'<(input_jar_file)',
'--input_file',
'<(input_java_class)',
'--output_dir',
'<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_dir)/jni',
],
'message': 'Generating JNI bindings from <(input_jar_file)/<(input_java_class)',
'process_outputs_as_sources': 1,
},
],
# This target exports a hard dependency because it generates header
# files.
'hard_dependency': 1,
}

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

@ -1,90 +0,0 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is meant to be included into a target to provide a rule
# to build Java in a consistent manner.
#
# To use this, create a gyp target with the following form:
# {
# 'target_name': 'my-package_java',
# 'type': 'none',
# 'variables': {
# 'package_name': 'my-package',
# 'java_in_dir': 'path/to/package/root',
# },
# 'includes': ['path/to/this/gypi/file'],
# }
#
# The generated jar-file will be:
# <(PRODUCT_DIR)/lib.java/chromium_<(package_name).jar
# Required variables:
# package_name - Used to name the intermediate output directory and in the
# names of some output files.
# java_in_dir - The top-level java directory. The src should be in
# <java_in_dir>/src.
# Optional/automatic variables:
# additional_input_paths - These paths will be included in the 'inputs' list to
# ensure that this target is rebuilt when one of these paths changes.
# additional_src_dirs - Additional directories with .java files to be compiled
# and included in the output of this target.
# generated_src_dirs - Same as additional_src_dirs except used for .java files
# that are generated at build time. This should be set automatically by a
# target's dependencies. The .java files in these directories are not
# included in the 'inputs' list (unlike additional_src_dirs).
# input_jars_paths - The path to jars to be included in the classpath. This
# should be filled automatically by depending on the appropriate targets.
{
'dependencies': [
'<(DEPTH)/build/build_output_dirs_android.gyp:build_output_dirs'
],
# This all_dependent_settings is used for java targets only. This will add the
# chromium_<(package_name) jar to the classpath of dependent java targets.
'all_dependent_settings': {
'variables': {
'input_jars_paths': ['<(PRODUCT_DIR)/lib.java/chromium_<(package_name).jar'],
},
},
'variables': {
'input_jars_paths': [],
'additional_src_dirs': [],
'additional_input_paths': [],
'generated_src_dirs': [],
},
'actions': [
{
'action_name': 'ant_<(package_name)',
'message': 'Building <(package_name) java sources.',
'inputs': [
'android/ant/common.xml',
'android/ant/chromium-jars.xml',
'>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")',
'>@(input_jars_paths)',
'>@(additional_input_paths)',
],
'outputs': [
'<(PRODUCT_DIR)/lib.java/chromium_<(package_name).jar',
],
'action': [
'ant',
'-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)',
'-DANDROID_SDK=<(android_sdk)',
'-DANDROID_SDK_ROOT=<(android_sdk_root)',
'-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
'-DANDROID_SDK_VERSION=<(android_sdk_version)',
'-DANDROID_GDBSERVER=<(android_gdbserver)',
'-DPRODUCT_DIR=<(ant_build_out)',
'-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)',
'-DGENERATED_SRC_DIRS=>(generated_src_dirs)',
'-DINPUT_JARS_PATHS=>(input_jars_paths)',
'-DPACKAGE_NAME=<(package_name)',
'-Dbasedir=<(java_in_dir)',
'-buildfile',
'<(DEPTH)/build/android/ant/chromium-jars.xml'
]
},
],
}

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

@ -1,58 +0,0 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is meant to be included into a target to provide a rule
# to build Java aidl files in a consistent manner.
#
# To use this, create a gyp target with the following form:
# {
# 'target_name': 'aidl_aidl-file-name',
# 'type': 'none',
# 'variables': {
# 'package_name': <name-of-package>
# 'aidl_interface_file': '<interface-path>/<interface-file>.aidl',
# },
# 'sources': {
# '<input-path1>/<input-file1>.aidl',
# '<input-path2>/<input-file2>.aidl',
# ...
# },
# 'includes': ['<path-to-this-file>/java_aidl.gypi'],
# }
#
#
# The generated java files will be:
# <(PRODUCT_DIR)/lib.java/<input-file1>.java
# <(PRODUCT_DIR)/lib.java/<input-file2>.java
# ...
#
# TODO(cjhopman): dependents need to rebuild when this target's inputs have changed.
{
'direct_dependent_settings': {
'variables': {
'generated_src_dirs': ['<(SHARED_INTERMEDIATE_DIR)/<(package_name)/aidl/'],
},
},
'rules': [
{
'rule_name': 'compile_aidl',
'extension': 'aidl',
'inputs': [
'<(android_sdk)/framework.aidl',
'<(aidl_interface_file)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/<(package_name)/aidl/<(RULE_INPUT_ROOT).java',
],
'action': [
'<(android_sdk_tools)/aidl',
'-p<(android_sdk)/framework.aidl',
'-p<(aidl_interface_file)',
'<(RULE_INPUT_PATH)',
'<(SHARED_INTERMEDIATE_DIR)/<(package_name)/aidl/<(RULE_INPUT_ROOT).java',
],
},
],
}

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

@ -1,58 +0,0 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is meant to be included into a target to provide a rule
# to generate jni bindings for Java-files in a consistent manner.
#
# To use this, create a gyp target with the following form:
# {
# 'target_name': 'base_jni_headers',
# 'type': 'none',
# 'sources': [
# 'android/java/src/org/chromium/base/BuildInfo.java',
# ...
# ...
# 'android/java/src/org/chromium/base/SystemMessageHandler.java',
# ],
# 'variables': {
# 'jni_gen_dir': 'base',
# },
# 'includes': [ '../build/jni_generator.gypi' ],
# },
#
# The generated file name pattern can be seen on the "outputs" section below.
# (note that RULE_INPUT_ROOT is the basename for the java file).
#
# See base/android/jni_generator/jni_generator.py for more info about the
# format of generating JNI bindings.
{
'variables': {
'jni_generator': '<(DEPTH)/base/android/jni_generator/jni_generator.py',
},
'rules': [
{
'rule_name': 'generate_jni_headers',
'extension': 'java',
'inputs': [
'<(jni_generator)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_dir)/jni/<(RULE_INPUT_ROOT)_jni.h',
],
'action': [
'<(jni_generator)',
'--input_file',
'<(RULE_INPUT_PATH)',
'--output_dir',
'<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_dir)/jni',
],
'message': 'Generating JNI bindings from <(RULE_INPUT_PATH)',
'process_outputs_as_sources': 1,
},
],
# This target exports a hard dependency because it generates header
# files.
'hard_dependency': 1,
}

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

@ -1,62 +0,0 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
# When including this gypi, the following variables must be set:
# idl_schema_files: an array of idl files that comprise the api model.
# cc_dir: path to generated files
# root_namespace: the C++ namespace that all generated files go under
# Functions and namespaces can be excluded by setting "nocompile" to true.
'api_gen_dir': '<(DEPTH)/tools/json_schema_compiler',
'api_gen': '<(api_gen_dir)/compiler.py',
},
'actions': [
{
'action_name': 'genapi_bundle',
'inputs': [
'<(api_gen_dir)/cc_generator.py',
'<(api_gen_dir)/code.py',
'<(api_gen_dir)/compiler.py',
'<(api_gen_dir)/cpp_type_generator.py',
'<(api_gen_dir)/cpp_util.py',
'<(api_gen_dir)/h_generator.py',
'<(api_gen_dir)/idl_schema.py',
'<(api_gen_dir)/json_schema.py',
'<(api_gen_dir)/model.py',
'<(api_gen_dir)/schema_bundle_generator.py',
'<(api_gen_dir)/util_cc_helper.py',
'<@(idl_schema_files)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/generated_api.h',
'<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/generated_schemas.h',
'<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/generated_schemas.cc',
],
'action': [
'python',
'<(api_gen)',
'--root=<(DEPTH)',
'--destdir=<(SHARED_INTERMEDIATE_DIR)',
'--namespace=<(root_namespace)',
'--bundle',
'<@(idl_schema_files)',
],
'message': 'Generating C++ API bundle code',
'process_outputs_as_sources': 1,
}
],
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)',
'<(DEPTH)',
],
'direct_dependent_settings': {
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)',
]
},
# This target exports a hard dependency because it generates header
# files.
'hard_dependency': 1,
}

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

@ -1,110 +0,0 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
# When including this gypi, the following variables must be set:
# json_schema_files: a list of json files that comprise the api model.
# idl_schema_files: a list of IDL files that comprise the api model.
# cc_dir: path to generated files
# root_namespace: the C++ namespace that all generated files go under
# Functions and namespaces can be excluded by setting "nocompile" to true.
'api_gen_dir': '<(DEPTH)/tools/json_schema_compiler',
'api_gen': '<(api_gen_dir)/compiler.py',
},
'rules': [
{
'rule_name': 'genapi',
'extension': 'json',
'inputs': [
'<(api_gen_dir)/any.cc',
'<(api_gen_dir)/any.h',
'<(api_gen_dir)/any_helper.py',
'<(api_gen_dir)/cc_generator.py',
'<(api_gen_dir)/code.py',
'<(api_gen_dir)/compiler.py',
'<(api_gen_dir)/cpp_type_generator.py',
'<(api_gen_dir)/cpp_util.py',
'<(api_gen_dir)/h_generator.py',
'<(api_gen_dir)/json_schema.py',
'<(api_gen_dir)/model.py',
'<(api_gen_dir)/util.cc',
'<(api_gen_dir)/util.h',
'<(api_gen_dir)/util_cc_helper.py',
# TODO(calamity): uncomment this when gyp on windows behaves like other
# platforms. List expansions of filepaths in inputs expand to different
# things.
# '<@(json_schema_files)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).cc',
'<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).h',
],
'action': [
'python',
'<(api_gen)',
'<(RULE_INPUT_PATH)',
'--root=<(DEPTH)',
'--destdir=<(SHARED_INTERMEDIATE_DIR)',
'--namespace=<(root_namespace)',
],
'message': 'Generating C++ code from <(RULE_INPUT_PATH) json files',
'process_outputs_as_sources': 1,
},
{
'rule_name': 'genapi_idl',
'msvs_external_rule': 1,
'extension': 'idl',
'inputs': [
'<(api_gen_dir)/any.cc',
'<(api_gen_dir)/any.h',
'<(api_gen_dir)/any_helper.py',
'<(api_gen_dir)/cc_generator.py',
'<(api_gen_dir)/code.py',
'<(api_gen_dir)/compiler.py',
'<(api_gen_dir)/cpp_type_generator.py',
'<(api_gen_dir)/cpp_util.py',
'<(api_gen_dir)/h_generator.py',
'<(api_gen_dir)/idl_schema.py',
'<(api_gen_dir)/model.py',
'<(api_gen_dir)/util.cc',
'<(api_gen_dir)/util.h',
'<(api_gen_dir)/util_cc_helper.py',
# TODO(calamity): uncomment this when gyp on windows behaves like other
# platforms. List expansions of filepaths in inputs expand to different
# things.
# '<@(idl_schema_files)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).cc',
'<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).h',
],
'action': [
'python',
'<(api_gen)',
'<(RULE_INPUT_PATH)',
'--root=<(DEPTH)',
'--destdir=<(SHARED_INTERMEDIATE_DIR)',
'--namespace=<(root_namespace)',
],
'message': 'Generating C++ code from <(RULE_INPUT_PATH) IDL files',
'process_outputs_as_sources': 1,
},
],
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)',
'<(DEPTH)',
],
'dependencies':[
'<(DEPTH)/tools/json_schema_compiler/api_gen_util.gyp:api_gen_util',
],
'direct_dependent_settings': {
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)',
]
},
# This target exports a hard dependency because it generates header
# files.
'hard_dependency': 1,
}

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

@ -1,96 +0,0 @@
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is meant to be included into an target to create a unittest that
# invokes a set of no-compile tests. A no-compile test is a test that asserts
# a particular construct will not compile.
#
# Also see:
# http://dev.chromium.org/developers/testing/no-compile-tests
#
# To use this, create a gyp target with the following form:
# {
# 'target_name': 'my_module_nc_unittests',
# 'type': 'executable',
# 'sources': [
# 'nc_testset_1.nc',
# 'nc_testset_2.nc',
# ],
# 'includes': ['path/to/this/gypi/file'],
# }
#
# The .nc files are C++ files that contain code we wish to assert will not
# compile. Each individual test case in the file should be put in its own
# #ifdef section. The expected output should be appended with a C++-style
# comment that has a python list of regular expressions. This will likely
# be greater than 80-characters. Giving a solid expected output test is
# important so that random compile failures do not cause the test to pass.
#
# Example .nc file:
#
# #if defined(TEST_NEEDS_SEMICOLON) // [r"expected ',' or ';' at end of input"]
#
# int a = 1
#
# #elif defined(TEST_NEEDS_CAST) // [r"invalid conversion from 'void*' to 'char*'"]
#
# void* a = NULL;
# char* b = a;
#
# #endif
#
# If we needed disable TEST_NEEDS_SEMICOLON, then change the define to:
#
# DISABLE_TEST_NEEDS_SEMICOLON
# TEST_NEEDS_CAST
#
# The lines above are parsed by a regexp so avoid getting creative with the
# formatting or ifdef logic; it will likely just not work.
#
# Implementation notes:
# The .nc files are actually processed by a python script which executes the
# compiler and generates a .cc file that is empty on success, or will have a
# series of #error lines on failure, and a set of trivially passing gunit
# TEST() functions on success. This allows us to fail at the compile step when
# something goes wrong, and know during the unittest run that the test was at
# least processed when things go right.
{
# TODO(awong): Disabled until http://crbug.com/105388 is resolved.
'sources/': [['exclude', '\\.nc$']],
'conditions': [
[ 'OS=="linux" and clang==0', {
'rules': [
{
'variables': {
'nocompile_driver': '<(DEPTH)/tools/nocompile_driver.py',
'nc_result_path': ('<(INTERMEDIATE_DIR)/<(module_dir)/'
'<(RULE_INPUT_ROOT)_nc.cc'),
},
'rule_name': 'run_nocompile',
'extension': 'nc',
'inputs': [
'<(nocompile_driver)',
],
'outputs': [
'<(nc_result_path)'
],
'action': [
'python',
'<(nocompile_driver)',
'4', # number of compilers to invoke in parallel.
'<(RULE_INPUT_PATH)',
'-Wall -Werror -Wfatal-errors -I<(DEPTH)',
'<(nc_result_path)',
],
'message': 'Generating no compile results for <(RULE_INPUT_PATH)',
'process_outputs_as_sources': 1,
},
],
}, {
'sources/': [['exclude', '\\.nc$']]
}], # 'OS=="linux" and clang=="0"'
],
}

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

@ -1,116 +0,0 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is meant to be included into a target to provide a rule
# to invoke protoc in a consistent manner.
#
# To use this, create a gyp target with the following form:
# {
# 'target_name': 'my_proto_lib',
# 'type': 'static_library',
# 'sources': [
# 'foo.proto',
# 'bar.proto',
# ],
# 'variables': {
# # Optional, see below: 'proto_in_dir': '.'
# 'proto_out_dir': 'dir/for/my_proto_lib'
# },
# 'includes': ['path/to/this/gypi/file'],
# }
# If necessary, you may add normal .cc files to the sources list or other gyp
# dependencies. The proto headers are guaranteed to be generated before any
# source files, even within this target, are compiled.
#
# The 'proto_in_dir' variable must be the relative path to the
# directory containing the .proto files. If left out, it defaults to '.'.
#
# The 'proto_out_dir' variable specifies the path suffix that output
# files are generated under. Targets that gyp-depend on my_proto_lib
# will be able to include the resulting proto headers with an include
# like:
# #include "dir/for/my_proto_lib/foo.pb.h"
#
# If you need to add an EXPORT macro to a protobuf's c++ header, set the
# 'cc_generator_options' variable with the value: 'dllexport_decl=FOO_EXPORT:'
# e.g. 'dllexport_decl=BASE_EXPORT:'
#
# It is likely you also need to #include a file for the above EXPORT macro to
# work. You can do so with the 'cc_include' variable.
# e.g. 'base/base_export.h'
#
# Implementation notes:
# A proto_out_dir of foo/bar produces
# <(SHARED_INTERMEDIATE_DIR)/protoc_out/foo/bar/{file1,file2}.pb.{cc,h}
# <(SHARED_INTERMEDIATE_DIR)/pyproto/foo/bar/{file1,file2}_pb2.py
{
'variables': {
'protoc_wrapper': '<(DEPTH)/tools/protoc_wrapper/protoc_wrapper.py',
'protoc': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)',
'cc_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out/<(proto_out_dir)',
'py_dir': '<(PRODUCT_DIR)/pyproto/<(proto_out_dir)',
'cc_generator_options%': '',
'cc_include%': '',
'proto_in_dir%': '.',
},
'rules': [
{
'rule_name': 'genproto',
'extension': 'proto',
'inputs': [
'<(protoc_wrapper)',
'<(protoc)',
],
'outputs': [
'<(py_dir)/<(RULE_INPUT_ROOT)_pb2.py',
'<(cc_dir)/<(RULE_INPUT_ROOT).pb.cc',
'<(cc_dir)/<(RULE_INPUT_ROOT).pb.h',
],
'action': [
'python',
'<(protoc_wrapper)',
'--include',
'<(cc_include)',
'--protobuf',
'<(cc_dir)/<(RULE_INPUT_ROOT).pb.h',
'--',
'<(protoc)',
# Using the --arg val form (instead of --arg=val) allows gyp's msvs rule
# generation to correct 'val' which is a path.
'--proto_path','<(proto_in_dir)',
# Naively you'd use <(RULE_INPUT_PATH) here, but protoc requires
# --proto_path is a strict prefix of the path given as an argument.
'<(proto_in_dir)/<(RULE_INPUT_ROOT)<(RULE_INPUT_EXT)',
'--cpp_out', '<(cc_generator_options)<(cc_dir)',
'--python_out', '<(py_dir)',
],
'msvs_cygwin_shell': 0,
'message': 'Generating C++ and Python code from <(RULE_INPUT_PATH)',
'process_outputs_as_sources': 1,
},
],
'dependencies': [
'<(DEPTH)/third_party/protobuf/protobuf.gyp:protoc#host',
'<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
],
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)/protoc_out',
'<(DEPTH)',
],
'direct_dependent_settings': {
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)/protoc_out',
'<(DEPTH)',
]
},
'export_dependent_settings': [
# The generated headers reference headers within protobuf_lite,
# so dependencies must be able to find those headers too.
'<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
],
# This target exports a hard dependency because it generates header
# files.
'hard_dependency': 1,
}

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

@ -1,24 +0,0 @@
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'some',
'type': 'none',
'dependencies': [
# This file is intended to be locally modified. List the targets you use
# regularly. The generated some.sln will contains projects for only
# those targets and the targets they are transitively dependent on. This
# can result in a solution that loads and unloads faster in Visual
# Studio.
#
# Tip: Create a dummy CL to hold your local edits to this file, so they
# don't accidentally get added to another CL that you are editing.
#
# Example:
# '../chrome/chrome.gyp:chrome',
],
},
],
}

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

@ -1,3 +0,0 @@
This directory will be removed once the files in it are committed upstream and
Chromium imports an upstream revision with these files. Contact mark for
details.

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

@ -1,105 +0,0 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# TODO(mark): Upstream this file to googleurl.
{
'variables': {
'chromium_code': 1,
},
'targets': [
{
'target_name': 'googleurl',
'type': '<(component)',
'dependencies': [
'../../base/base.gyp:base',
'../../third_party/icu/icu.gyp:icudata',
'../../third_party/icu/icu.gyp:icui18n',
'../../third_party/icu/icu.gyp:icuuc',
],
'sources': [
'../../googleurl/src/gurl.cc',
'../../googleurl/src/gurl.h',
'../../googleurl/src/url_canon.h',
'../../googleurl/src/url_canon_etc.cc',
'../../googleurl/src/url_canon_fileurl.cc',
'../../googleurl/src/url_canon_filesystemurl.cc',
'../../googleurl/src/url_canon_host.cc',
'../../googleurl/src/url_canon_icu.cc',
'../../googleurl/src/url_canon_icu.h',
'../../googleurl/src/url_canon_internal.cc',
'../../googleurl/src/url_canon_internal.h',
'../../googleurl/src/url_canon_internal_file.h',
'../../googleurl/src/url_canon_ip.cc',
'../../googleurl/src/url_canon_ip.h',
'../../googleurl/src/url_canon_mailtourl.cc',
'../../googleurl/src/url_canon_path.cc',
'../../googleurl/src/url_canon_pathurl.cc',
'../../googleurl/src/url_canon_query.cc',
'../../googleurl/src/url_canon_relative.cc',
'../../googleurl/src/url_canon_stdstring.h',
'../../googleurl/src/url_canon_stdurl.cc',
'../../googleurl/src/url_file.h',
'../../googleurl/src/url_parse.cc',
'../../googleurl/src/url_parse.h',
'../../googleurl/src/url_parse_file.cc',
'../../googleurl/src/url_parse_internal.h',
'../../googleurl/src/url_util.cc',
'../../googleurl/src/url_util.h',
],
'direct_dependent_settings': {
'include_dirs': [
'../..',
],
},
'defines': [
'FULL_FILESYSTEM_URL_SUPPORT=1',
],
'conditions': [
['component=="shared_library"', {
'defines': [
'GURL_DLL',
'GURL_IMPLEMENTATION=1',
],
'direct_dependent_settings': {
'defines': [
'GURL_DLL',
],
},
}],
],
},
{
'target_name': 'googleurl_unittests',
'type': 'executable',
'dependencies': [
'googleurl',
'../../base/base.gyp:base_i18n',
'../../base/base.gyp:run_all_unittests',
'../../testing/gtest.gyp:gtest',
'../../third_party/icu/icu.gyp:icuuc',
],
'sources': [
'../../googleurl/src/gurl_unittest.cc',
'../../googleurl/src/url_canon_unittest.cc',
'../../googleurl/src/url_parse_unittest.cc',
'../../googleurl/src/url_test_utils.h',
'../../googleurl/src/url_util_unittest.cc',
],
'defines': [
'FULL_FILESYSTEM_URL_SUPPORT=1',
],
'conditions': [
['os_posix==1 and OS!="mac" and OS!="ios"', {
'conditions': [
['linux_use_tcmalloc==1', {
'dependencies': [
'../../base/allocator/allocator.gyp:allocator',
],
}],
],
}],
],
},
],
}

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

@ -1,40 +0,0 @@
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'pdfsqueeze',
'type': 'executable',
'sources': [
'../../third_party/pdfsqueeze/pdfsqueeze.m',
],
'defines': [
# Use defines to map the full path names that will be used for
# the vars into the short forms expected by pdfsqueeze.m.
'______third_party_pdfsqueeze_ApplyGenericRGB_qfilter=ApplyGenericRGB_qfilter',
'______third_party_pdfsqueeze_ApplyGenericRGB_qfilter_len=ApplyGenericRGB_qfilter_len',
],
'include_dirs': [
'<(INTERMEDIATE_DIR)',
],
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
'$(SDKROOT)/System/Library/Frameworks/Quartz.framework',
],
'actions': [
{
'action_name': 'Generate inline filter data',
'inputs': [
'../../third_party/pdfsqueeze/ApplyGenericRGB.qfilter',
],
'outputs': [
'<(INTERMEDIATE_DIR)/ApplyGenericRGB.h',
],
'action': ['xxd', '-i', '<@(_inputs)', '<@(_outputs)'],
},
],
},
],
}

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

@ -1,20 +0,0 @@
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Include this file to make targets in your .gyp use the default
# precompiled header on Windows, in debug builds only as the official
# builders blow up (out of memory) if precompiled headers are used for
# release builds.
{
'conditions': [
['OS=="win" and chromium_win_pch==1', {
'target_defaults': {
'msvs_precompiled_header': '<(DEPTH)/build/precompile.h',
'msvs_precompiled_source': '<(DEPTH)/build/precompile.cc',
'sources': ['<(DEPTH)/build/precompile.cc'],
}
}],
],
}

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

@ -1,9 +0,0 @@
# This is a dummy gyp file to satisfy libjingle.gyp.
{
'targets': [
{
'target_name': 'net',
'type': 'none',
},
],
}

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

@ -1,165 +0,0 @@
# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
{
'includes': [
'webrtc/build/common.gypi',
'webrtc/video/webrtc_video.gypi',
],
'variables': {
'peerconnection_sample': 'third_party/libjingle/source/talk/examples/peerconnection',
},
# for mozilla, we want to force stuff to build but we don't want peerconnection_client or server
# for unknown reasons, 'targets' must be outside of conditions. And don't try to build a dummy
# executable...
'targets': [
{
'conditions': [
['build_with_mozilla==1', {
'target_name': 'dummy',
'type': 'none',
'dependencies': [
'webrtc/webrtc.gyp:webrtc_lib',
'webrtc/modules/modules.gyp:audio_device',
'webrtc/modules/modules.gyp:video_capture_module',
'webrtc/modules/modules.gyp:video_capture_module_internal_impl',
# TODO: missing?
# 'webrtc/modules/modules.gyp:video_render',
# 'webrtc/system_wrappers/source/system_wrappers.gyp:system_wrappers',
# 'webrtc/system_wrappers/source/system_wrappers.gyp:metrics_default',
# 'webrtc/video_engine/video_engine.gyp:video_engine_core',
'webrtc/voice_engine/voice_engine.gyp:voice_engine',
# '<@(webrtc_video_dependencies)',
],
'conditions': [
['OS!="android" and OS!="ios"', {
'dependencies': [
'webrtc/modules/modules.gyp:desktop_capture',
],
},
]],
}, ],
],
}, ],
'conditions': [
['build_with_mozilla==0', {
'targets': [
{
'target_name': 'peerconnection_server',
'type': 'executable',
'sources': [
'<(peerconnection_sample)/server/data_socket.cc',
'<(peerconnection_sample)/server/data_socket.h',
'<(peerconnection_sample)/server/main.cc',
'<(peerconnection_sample)/server/peer_channel.cc',
'<(peerconnection_sample)/server/peer_channel.h',
'<(peerconnection_sample)/server/utils.cc',
'<(peerconnection_sample)/server/utils.h',
],
'include_dirs': [
'third_party/libjingle/source',
],
}, ],
'conditions': [
# TODO(wu): Merge the target for different platforms.
['OS=="win"', {
'targets': [
{
'target_name': 'peerconnection_client',
'type': 'executable',
'sources': [
'<(peerconnection_sample)/client/conductor.cc',
'<(peerconnection_sample)/client/conductor.h',
'<(peerconnection_sample)/client/defaults.cc',
'<(peerconnection_sample)/client/defaults.h',
'<(peerconnection_sample)/client/main.cc',
'<(peerconnection_sample)/client/main_wnd.cc',
'<(peerconnection_sample)/client/main_wnd.h',
'<(peerconnection_sample)/client/peer_connection_client.cc',
'<(peerconnection_sample)/client/peer_connection_client.h',
'third_party/libjingle/source/talk/base/win32socketinit.cc',
'third_party/libjingle/source/talk/base/win32socketserver.cc',
],
'msvs_settings': {
'VCLinkerTool': {
'SubSystem': '2', # Windows
},
},
'dependencies': [
#'third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
#'third_party/libjingle/libjingle.gyp:libjingle_peerconnection',
],
'include_dirs': [
'src',
'webrtc/modules/interface',
'third_party/libjingle/source',
],
},
], # targets
}, ], # OS="win"
['OS=="linux"', {
'targets': [
{
'target_name': 'peerconnection_client',
'type': 'executable',
'sources': [
'<(peerconnection_sample)/client/conductor.cc',
'<(peerconnection_sample)/client/conductor.h',
'<(peerconnection_sample)/client/defaults.cc',
'<(peerconnection_sample)/client/defaults.h',
'<(peerconnection_sample)/client/linux/main.cc',
'<(peerconnection_sample)/client/linux/main_wnd.cc',
'<(peerconnection_sample)/client/linux/main_wnd.h',
'<(peerconnection_sample)/client/peer_connection_client.cc',
'<(peerconnection_sample)/client/peer_connection_client.h',
],
'dependencies': [
#'third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
#'third_party/libjingle/libjingle.gyp:libjingle_peerconnection',
# TODO(tommi): Switch to this and remove specific gtk dependency
# sections below for cflags and link_settings.
# '<(DEPTH)/build/linux/system.gyp:gtk',
],
'include_dirs': [
'third_party/libjingle/source',
],
'cflags': [
'<!@(pkg-config --cflags gtk+-2.0)',
],
'link_settings': {
'ldflags': [
'<!@(pkg-config --libs-only-L --libs-only-other gtk+-2.0 gthread-2.0)',
],
'libraries': [
'<!@(pkg-config --libs-only-l gtk+-2.0 gthread-2.0)',
'-lX11',
'-lXcomposite',
'-lXext',
'-lXrender',
],
},
},
], # targets
}, ], # OS="linux"
# There's no peerconnection_client implementation for Mac.
# But add this dummy peerconnection_client target so that the runhooks
# won't complain.
['OS=="mac"', {
'targets': [
{
'target_name': 'peerconnection_client',
'type': 'none',
},
],
}, ],
],
}, ],
],
}

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

@ -1,30 +0,0 @@
# This file will be picked up by gyp to initialize some global settings.
{
'variables': {
# make sure we can override this with --include
'build_with_chromium%': 1,
'clang_use_chrome_plugins%': 0,
'enable_protobuf%': 1,
'enabled_libjingle_device_manager%': 1,
'include_internal_audio_device%': 1,
'include_internal_video_capture%': 1,
'include_internal_video_render%': 1,
'include_pulse_audio%': 1,
'use_openssl%': 1,
},
'target_defaults': {
'conditions': [
['OS=="linux" and clang==1', {
'cflags': [
# Suppress the warning caused by
# LateBindingSymbolTable::TableInfo from
# latebindingsymboltable.cc.def.
'-Wno-address-of-array-temporary',
],
'cflags_mozilla': [
'-Wno-address-of-array-temporary',
],
}],
],
}, # target_defaults
}

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

@ -14,7 +14,7 @@
{
'variables': {
'gflags_root': '<(DEPTH)/third_party/gflags',
'gflags_root': '/media/webrtc/trunk/third_party/gflags',
'conditions': [
['OS=="win"', {
'gflags_gen_arch_root': '<(gflags_root)/gen/win',

178
media/webrtc/trunk/third_party/opus/opus.gyp поставляемый
Просмотреть файл

@ -1,178 +0,0 @@
# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
{
'targets': [
{
'target_name': 'opus',
'type': '<(library)',
'defines': [
'OPUS_BUILD',
'FLOATING_POINT',
'VAR_ARRAYS',
],
'conditions': [
['OS=="linux"', {
'cflags': [
'-std=c99',
],
'cflags_mozilla': [
'-std=c99',
],
'defines': [
'HAVE_LRINTF',
],
}]
],
'include_dirs': [
'source/include',
'source/src',
'source/celt',
'source/silk',
'source/silk/float',
],
'sources': [
# opus wrapper/glue
'source/src/opus.c',
'source/src/opus_decoder.c',
'source/src/opus_encoder.c',
'source/src/repacketizer.c',
# celt sub-codec
'source/celt/bands.c',
'source/celt/celt.c',
'source/celt/cwrs.c',
'source/celt/entcode.c',
'source/celt/entdec.c',
'source/celt/entenc.c',
'source/celt/kiss_fft.c',
'source/celt/laplace.c',
'source/celt/mathops.c',
'source/celt/mdct.c',
'source/celt/modes.c',
'source/celt/pitch.c',
'source/celt/celt_lpc.c',
'source/celt/quant_bands.c',
'source/celt/rate.c',
'source/celt/vq.c',
# silk sub-codec
'source/silk/CNG.c',
'source/silk/code_signs.c',
'source/silk/init_decoder.c',
'source/silk/decode_core.c',
'source/silk/decode_frame.c',
'source/silk/decode_parameters.c',
'source/silk/decode_indices.c',
'source/silk/decode_pulses.c',
'source/silk/decoder_set_fs.c',
'source/silk/dec_API.c',
'source/silk/enc_API.c',
'source/silk/encode_indices.c',
'source/silk/encode_pulses.c',
'source/silk/gain_quant.c',
'source/silk/interpolate.c',
'source/silk/LP_variable_cutoff.c',
'source/silk/NLSF_decode.c',
'source/silk/NSQ.c',
'source/silk/NSQ_del_dec.c',
'source/silk/PLC.c',
'source/silk/shell_coder.c',
'source/silk/tables_gain.c',
'source/silk/tables_LTP.c',
'source/silk/tables_NLSF_CB_NB_MB.c',
'source/silk/tables_NLSF_CB_WB.c',
'source/silk/tables_other.c',
'source/silk/tables_pitch_lag.c',
'source/silk/tables_pulses_per_block.c',
'source/silk/VAD.c',
'source/silk/control_audio_bandwidth.c',
'source/silk/quant_LTP_gains.c',
'source/silk/VQ_WMat_EC.c',
'source/silk/HP_variable_cutoff.c',
'source/silk/NLSF_encode.c',
'source/silk/NLSF_VQ.c',
'source/silk/NLSF_unpack.c',
'source/silk/NLSF_del_dec_quant.c',
'source/silk/process_NLSFs.c',
'source/silk/stereo_LR_to_MS.c',
'source/silk/stereo_MS_to_LR.c',
'source/silk/check_control_input.c',
'source/silk/control_SNR.c',
'source/silk/init_encoder.c',
'source/silk/control_codec.c',
'source/silk/A2NLSF.c',
'source/silk/ana_filt_bank_1.c',
'source/silk/biquad_alt.c',
'source/silk/bwexpander_32.c',
'source/silk/bwexpander.c',
'source/silk/debug.c',
'source/silk/decode_pitch.c',
'source/silk/inner_prod_aligned.c',
'source/silk/lin2log.c',
'source/silk/log2lin.c',
'source/silk/LPC_analysis_filter.c',
'source/silk/LPC_inv_pred_gain.c',
'source/silk/table_LSF_cos.c',
'source/silk/NLSF2A.c',
'source/silk/NLSF_stabilize.c',
'source/silk/NLSF_VQ_weights_laroia.c',
'source/silk/pitch_est_tables.c',
'source/silk/resampler.c',
'source/silk/resampler_down2_3.c',
'source/silk/resampler_down2.c',
'source/silk/resampler_private_AR2.c',
'source/silk/resampler_private_down_FIR.c',
'source/silk/resampler_private_IIR_FIR.c',
'source/silk/resampler_private_up2_HQ.c',
'source/silk/resampler_rom.c',
'source/silk/sigm_Q15.c',
'source/silk/sort.c',
'source/silk/sum_sqr_shift.c',
'source/silk/stereo_decode_pred.c',
'source/silk/stereo_encode_pred.c',
'source/silk/stereo_find_predictor.c',
'source/silk/stereo_quant_pred.c',
# silk floating point engine
'source/silk/float/apply_sine_window_FLP.c',
'source/silk/float/corrMatrix_FLP.c',
'source/silk/float/encode_frame_FLP.c',
'source/silk/float/find_LPC_FLP.c',
'source/silk/float/find_LTP_FLP.c',
'source/silk/float/find_pitch_lags_FLP.c',
'source/silk/float/find_pred_coefs_FLP.c',
'source/silk/float/LPC_analysis_filter_FLP.c',
'source/silk/float/LTP_analysis_filter_FLP.c',
'source/silk/float/LTP_scale_ctrl_FLP.c',
'source/silk/float/noise_shape_analysis_FLP.c',
'source/silk/float/prefilter_FLP.c',
'source/silk/float/process_gains_FLP.c',
'source/silk/float/regularize_correlations_FLP.c',
'source/silk/float/residual_energy_FLP.c',
'source/silk/float/solve_LS_FLP.c',
'source/silk/float/warped_autocorrelation_FLP.c',
'source/silk/float/wrappers_FLP.c',
'source/silk/float/autocorrelation_FLP.c',
'source/silk/float/burg_modified_FLP.c',
'source/silk/float/bwexpander_FLP.c',
'source/silk/float/energy_FLP.c',
'source/silk/float/inner_product_FLP.c',
'source/silk/float/k2a_FLP.c',
'source/silk/float/levinsondurbin_FLP.c',
'source/silk/float/LPC_inv_pred_gain_FLP.c',
'source/silk/float/pitch_analysis_core_FLP.c',
'source/silk/float/scale_copy_vector_FLP.c',
'source/silk/float/scale_vector_FLP.c',
'source/silk/float/schur_FLP.c',
'source/silk/float/sort_FLP.c',
]
}
]
}

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

@ -1,10 +0,0 @@
# This file is used by gcl to get repository specific information.
CODE_REVIEW_SERVER: codereview.chromium.org
CC_LIST: gyp-developer@googlegroups.com
VIEW_VC: https://chromium.googlesource.com/external/gyp/+/
TRY_ON_UPLOAD: False
TRYSERVER_PROJECT: gyp
TRYSERVER_PATCHLEVEL: 1
TRYSERVER_ROOT: gyp
TRYSERVER_SVN_URL: svn://svn.chromium.org/chrome-try/try-nacl
PROJECT: gyp

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

@ -1,274 +0,0 @@
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner(object):
"""
Executor class for commands, including "commands" implemented by
Python functions.
"""
verbose = True
active = True
def __init__(self, dictionary={}):
self.subst_dictionary(dictionary)
def subst_dictionary(self, dictionary):
self._subst_dictionary = dictionary
def subst(self, string, dictionary=None):
"""
Substitutes (via the format operator) the values in the specified
dictionary into the specified command.
The command can be an (action, string) tuple. In all cases, we
perform substitution on strings and don't worry if something isn't
a string. (It's probably a Python function to be executed.)
"""
if dictionary is None:
dictionary = self._subst_dictionary
if dictionary:
try:
string = string % dictionary
except TypeError:
pass
return string
def display(self, command, stdout=None, stderr=None):
if not self.verbose:
return
if type(command) == type(()):
func = command[0]
args = command[1:]
s = '%s(%s)' % (func.__name__, ', '.join(map(repr, args)))
if type(command) == type([]):
# TODO: quote arguments containing spaces
# TODO: handle meta characters?
s = ' '.join(command)
else:
s = self.subst(command)
if not s.endswith('\n'):
s += '\n'
sys.stdout.write(s)
sys.stdout.flush()
def execute(self, command, stdout=None, stderr=None):
"""
Executes a single command.
"""
if not self.active:
return 0
if type(command) == type(''):
command = self.subst(command)
cmdargs = shlex.split(command)
if cmdargs[0] == 'cd':
command = (os.chdir,) + tuple(cmdargs[1:])
if type(command) == type(()):
func = command[0]
args = command[1:]
return func(*args)
else:
if stdout is sys.stdout:
# Same as passing sys.stdout, except python2.4 doesn't fail on it.
subout = None
else:
# Open pipe for anything else so Popen works on python2.4.
subout = subprocess.PIPE
if stderr is sys.stderr:
# Same as passing sys.stderr, except python2.4 doesn't fail on it.
suberr = None
elif stderr is None:
# Merge with stdout if stderr isn't specified.
suberr = subprocess.STDOUT
else:
# Open pipe for anything else so Popen works on python2.4.
suberr = subprocess.PIPE
p = subprocess.Popen(command,
shell=(sys.platform == 'win32'),
stdout=subout,
stderr=suberr)
p.wait()
if stdout is None:
self.stdout = p.stdout.read()
elif stdout is not sys.stdout:
stdout.write(p.stdout.read())
if stderr not in (None, sys.stderr):
stderr.write(p.stderr.read())
return p.returncode
def run(self, command, display=None, stdout=None, stderr=None):
"""
Runs a single command, displaying it first.
"""
if display is None:
display = command
self.display(display)
return self.execute(command, stdout, stderr)
class Unbuffered(object):
def __init__(self, fp):
self.fp = fp
def write(self, arg):
self.fp.write(arg)
self.fp.flush()
def __getattr__(self, attr):
return getattr(self.fp, attr)
sys.stdout = Unbuffered(sys.stdout)
sys.stderr = Unbuffered(sys.stderr)
def is_test_name(f):
return f.startswith('gyptest') and f.endswith('.py')
def find_all_gyptest_files(directory):
result = []
for root, dirs, files in os.walk(directory):
if '.svn' in dirs:
dirs.remove('.svn')
result.extend([ os.path.join(root, f) for f in files if is_test_name(f) ])
result.sort()
return result
def main(argv=None):
if argv is None:
argv = sys.argv
usage = "gyptest.py [-ahlnq] [-f formats] [test ...]"
parser = optparse.OptionParser(usage=usage)
parser.add_option("-a", "--all", action="store_true",
help="run all tests")
parser.add_option("-C", "--chdir", action="store", default=None,
help="chdir to the specified directory")
parser.add_option("-f", "--format", action="store", default='',
help="run tests with the specified formats")
parser.add_option("-G", '--gyp_option', action="append", default=[],
help="Add -G options to the gyp command line")
parser.add_option("-l", "--list", action="store_true",
help="list available tests and exit")
parser.add_option("-n", "--no-exec", action="store_true",
help="no execute, just print the command line")
parser.add_option("--passed", action="store_true",
help="report passed tests")
parser.add_option("--path", action="append", default=[],
help="additional $PATH directory")
parser.add_option("-q", "--quiet", action="store_true",
help="quiet, don't print test command lines")
opts, args = parser.parse_args(argv[1:])
if opts.chdir:
os.chdir(opts.chdir)
if opts.path:
extra_path = [os.path.abspath(p) for p in opts.path]
extra_path = os.pathsep.join(extra_path)
os.environ['PATH'] = extra_path + os.pathsep + os.environ['PATH']
if not args:
if not opts.all:
sys.stderr.write('Specify -a to get all tests.\n')
return 1
args = ['test']
tests = []
for arg in args:
if os.path.isdir(arg):
tests.extend(find_all_gyptest_files(os.path.normpath(arg)))
else:
if not is_test_name(os.path.basename(arg)):
print >>sys.stderr, arg, 'is not a valid gyp test name.'
sys.exit(1)
tests.append(arg)
if opts.list:
for test in tests:
print test
sys.exit(0)
CommandRunner.verbose = not opts.quiet
CommandRunner.active = not opts.no_exec
cr = CommandRunner()
os.environ['PYTHONPATH'] = os.path.abspath('test/lib')
if not opts.quiet:
sys.stdout.write('PYTHONPATH=%s\n' % os.environ['PYTHONPATH'])
passed = []
failed = []
no_result = []
if opts.format:
format_list = opts.format.split(',')
else:
# TODO: not duplicate this mapping from pylib/gyp/__init__.py
format_list = {
'aix5': ['make'],
'freebsd7': ['make'],
'freebsd8': ['make'],
'openbsd5': ['make'],
'cygwin': ['msvs'],
'win32': ['msvs', 'ninja'],
'linux2': ['make', 'ninja'],
'linux3': ['make', 'ninja'],
'darwin': ['make', 'ninja', 'xcode', 'xcode-ninja'],
}[sys.platform]
for format in format_list:
os.environ['TESTGYP_FORMAT'] = format
if not opts.quiet:
sys.stdout.write('TESTGYP_FORMAT=%s\n' % format)
gyp_options = []
for option in opts.gyp_option:
gyp_options += ['-G', option]
if gyp_options and not opts.quiet:
sys.stdout.write('Extra Gyp options: %s\n' % gyp_options)
for test in tests:
status = cr.run([sys.executable, test] + gyp_options,
stdout=sys.stdout,
stderr=sys.stderr)
if status == 2:
no_result.append(test)
elif status:
failed.append(test)
else:
passed.append(test)
if not opts.quiet:
def report(description, tests):
if tests:
if len(tests) == 1:
sys.stdout.write("\n%s the following test:\n" % description)
else:
fmt = "\n%s the following %d tests:\n"
sys.stdout.write(fmt % (description, len(tests)))
sys.stdout.write("\t" + "\n\t".join(tests) + "\n")
if opts.passed:
report("Passed", passed)
report("Failed", failed)
report("No result from", no_result)
if failed:
return 1
else:
return 0
if __name__ == "__main__":
sys.exit(main())

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

@ -43,6 +43,7 @@ public:
, mResumeRequested(false)
, mLastModifiedTime(0)
, mForcePending(false)
, mSuspendCount(0)
{
SetURI(uri);
}

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

@ -40,7 +40,7 @@ sys.modules['gyp.generator.mozbuild'] = sys.modules[__name__]
# chrome_src for the default includes, so go backwards from the pylib
# directory, which is the parent directory of gyp module.
chrome_src = mozpath.abspath(mozpath.join(mozpath.dirname(gyp.__file__),
'../../../..'))
'../../../../..'))
script_dir = mozpath.join(chrome_src, 'build')
@ -377,13 +377,7 @@ class GypProcessor(object):
# to override the registry detection of VC++ in gyp.
os.environ['GYP_MSVS_OVERRIDE_PATH'] = 'fake_path'
# TODO bug 1371485 upgrade vendored version of GYP to something that
# doesn't barf when MSVS_VERSION==2017.
msvs_version = config.substs['MSVS_VERSION']
if msvs_version == '2017':
warnings.warn('MSVS_VERSION being set to 2015 to appease GYP')
msvs_version = '2015'
os.environ['GYP_MSVS_VERSION'] = msvs_version
os.environ['GYP_MSVS_VERSION'] = config.substs['MSVS_VERSION']
params = {
b'parallel': False,
@ -398,7 +392,8 @@ class GypProcessor(object):
else:
depth = chrome_src
# Files that gyp_chromium always includes
includes = [encode(mozpath.join(script_dir, 'common.gypi'))]
includes = [encode(mozpath.join(script_dir, 'gyp_includes',
'common.gypi'))]
finder = FileFinder(chrome_src)
includes.extend(encode(mozpath.join(chrome_src, name))
for name, _ in finder.find('*/supplement.gypi'))

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

@ -152,9 +152,7 @@ SecretDecoderRing::AsyncEncryptStrings(uint32_t plaintextsCount,
NS_ENSURE_ARG_POINTER(plaintexts);
NS_ENSURE_ARG_POINTER(aCx);
nsIGlobalObject* globalObject =
xpc::NativeGlobal(JS::CurrentGlobalOrNull(aCx));
nsIGlobalObject* globalObject = xpc::CurrentNativeGlobal(aCx);
if (NS_WARN_IF(!globalObject)) {
return NS_ERROR_UNEXPECTED;
}

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

@ -0,0 +1,4 @@
[2d.scrollPathIntoView.basic.html]
[scrollPathIntoView() works]
expected: FAIL

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

@ -0,0 +1,4 @@
[2d.scrollPathIntoView.path.html]
[scrollPathIntoView() with path argument works]
expected: FAIL

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

@ -0,0 +1,4 @@
[2d.scrollPathIntoView.verticalLR.html]
[scrollPathIntoView() works in vertical-lr writing mode]
expected: FAIL

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

@ -0,0 +1,4 @@
[2d.scrollPathIntoView.verticalRL.html]
[scrollPathIntoView() works in vertical-rl writing mode]
expected: FAIL

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

@ -1,7 +1,4 @@
[interfaces.any.html]
[ServiceWorkerRegistration interface: attribute sync]
expected: FAIL
[interfaces.https.any.html]
[SyncManager interface: existence and properties of interface object]
expected: FAIL
@ -26,11 +23,11 @@
[SyncManager interface: operation getTags()]
expected: FAIL
[interfaces.any.worker.html]
[ServiceWorkerRegistration interface: attribute sync]
expected: FAIL
[interfaces.https.any.worker.html]
[SyncManager interface: existence and properties of interface object]
expected: FAIL
@ -55,3 +52,6 @@
[SyncManager interface: operation getTags()]
expected: FAIL
[ServiceWorkerRegistration interface: attribute sync]
expected: FAIL

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

@ -17,6 +17,3 @@
[FileReaderSync interface: operation readAsDataURL(Blob)]
expected: FAIL
[Partial interface URL: valid exposure set]
expected: FAIL

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

@ -22,9 +22,6 @@
[Event interface: existence and properties of interface object]
expected: FAIL
[Partial interface URL: valid exposure set]
expected: FAIL
[URL interface: existence and properties of interface object]
expected: FAIL

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше