Skip to content

Commit e226c76

Browse files
committed
Backed out changeset 0f5799df920b (bug 1093934) for various test failures CLOSED TREE
--HG-- extra : amend_source : 047ed43008cea68775c544cdf0df2819cfb24589
1 parent e9d9b42 commit e226c76

31 files changed

+31
-639
lines changed

mfbt/Assertions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ MOZ_ReportAssertionFailure(const char* aStr, const char* aFilename, int aLine)
141141
aStr, aFilename, aLine);
142142
#else
143143
fprintf(stderr, "Assertion failure: %s, at %s:%d\n", aStr, aFilename, aLine);
144-
#if defined (MOZ_DUMP_ASSERTION_STACK) && !defined(MOZILLA_XPCOMRT_API)
144+
#ifdef MOZ_DUMP_ASSERTION_STACK
145145
nsTraceRefcnt::WalkTheStack(stderr);
146146
#endif
147147
fflush(stderr);
@@ -157,7 +157,7 @@ MOZ_ReportCrash(const char* aStr, const char* aFilename, int aLine)
157157
"Hit MOZ_CRASH(%s) at %s:%d\n", aStr, aFilename, aLine);
158158
#else
159159
fprintf(stderr, "Hit MOZ_CRASH(%s) at %s:%d\n", aStr, aFilename, aLine);
160-
#if defined(MOZ_DUMP_ASSERTION_STACK) && !defined(MOZILLA_XPCOMRT_API)
160+
#ifdef MOZ_DUMP_ASSERTION_STACK
161161
nsTraceRefcnt::WalkTheStack(stderr);
162162
#endif
163163
fflush(stderr);

mfbt/RefPtr.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#endif
2121

2222
#if defined(MOZILLA_INTERNAL_API) && \
23-
!defined(MOZILLA_XPCOMRT_API) && \
2423
(defined(DEBUG) || defined(FORCE_BUILD_REFCNT_LOGGING))
2524
#define MOZ_REFCOUNTED_LEAK_CHECKING
2625
#endif

mfbt/Types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
* symbols. We add the weak attribute to the import version of the MFBT API
9090
* macros to exploit this.
9191
*/
92-
# if defined(MOZ_GLUE_IN_PROGRAM) && !defined(MOZILLA_XPCOMRT_API)
92+
# if defined(MOZ_GLUE_IN_PROGRAM)
9393
# define MFBT_API __attribute__((weak)) MOZ_IMPORT_API
9494
# define MFBT_DATA __attribute__((weak)) MOZ_IMPORT_DATA
9595
# else

toolkit/components/telemetry/Telemetry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ class ProcessedStack;
237237
* @param aFirefoxUptime - Firefox uptime at the time of the hang, in minutes
238238
* @param aAnnotations - Any annotations to be added to the report
239239
*/
240-
#if defined(MOZ_ENABLE_PROFILER_SPS) && !defined(MOZILLA_XPCOMRT_API)
240+
#if defined(MOZ_ENABLE_PROFILER_SPS)
241241
void RecordChromeHang(uint32_t aDuration,
242242
ProcessedStack &aStack,
243243
int32_t aSystemUptime,

tools/profiler/GeckoProfiler.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@
5151

5252
#include "js/TypeDecls.h"
5353
#include "mozilla/UniquePtr.h"
54-
#include "mozilla/GuardObjects.h"
55-
#include "ProfilerBacktrace.h"
5654

5755
namespace mozilla {
5856
class TimeStamp;
@@ -66,7 +64,7 @@ enum TracingMetadata {
6664
TRACING_EVENT_BACKTRACE
6765
};
6866

69-
#if !defined(MOZ_ENABLE_PROFILER_SPS) || defined(MOZILLA_XPCOMRT_API)
67+
#ifndef MOZ_ENABLE_PROFILER_SPS
7068

7169
#include <stdint.h>
7270
#include <stdarg.h>

xpcom/base/nsDebugImpl.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,7 @@ NS_DebugBreak(uint32_t aSeverity, const char* aStr, const char* aExpr,
353353
if (sMultiprocessDescription) {
354354
PrintToBuffer("%s ", sMultiprocessDescription);
355355
}
356-
#if !defined(MOZILLA_XPCOMRT_API)
357356
PrintToBuffer("%d] ", base::GetCurrentProcId());
358-
#endif // !defined(MOZILLA_XPCOMRT_API)
359357

360358
PrintToBuffer("%s: ", sevString);
361359

@@ -405,7 +403,7 @@ NS_DebugBreak(uint32_t aSeverity, const char* aStr, const char* aExpr,
405403
return;
406404

407405
case NS_DEBUG_ABORT: {
408-
#if defined(MOZ_CRASHREPORTER) && !defined(MOZILLA_XPCOMRT_API)
406+
#if defined(MOZ_CRASHREPORTER)
409407
// Updating crash annotations in the child causes us to do IPC. This can
410408
// really cause trouble if we're asserting from within IPC code. So we
411409
// have to do without the annotations in that case.
@@ -422,7 +420,7 @@ NS_DebugBreak(uint32_t aSeverity, const char* aStr, const char* aExpr,
422420
#if defined(DEBUG) && defined(_WIN32)
423421
RealBreak();
424422
#endif
425-
#if defined(DEBUG) && !defined(MOZILLA_XPCOMRT_API)
423+
#ifdef DEBUG
426424
nsTraceRefcnt::WalkTheStack(stderr);
427425
#endif
428426
Abort(buf.buffer);
@@ -447,15 +445,11 @@ NS_DebugBreak(uint32_t aSeverity, const char* aStr, const char* aExpr,
447445
return;
448446

449447
case NS_ASSERT_STACK:
450-
#if !defined(MOZILLA_XPCOMRT_API)
451448
nsTraceRefcnt::WalkTheStack(stderr);
452-
#endif // !defined(MOZILLA_XPCOMRT_API)
453449
return;
454450

455451
case NS_ASSERT_STACK_AND_ABORT:
456-
#if !defined(MOZILLA_XPCOMRT_API)
457452
nsTraceRefcnt::WalkTheStack(stderr);
458-
#endif // !defined(MOZILLA_XPCOMRT_API)
459453
// Fall through to abort
460454

461455
case NS_ASSERT_ABORT:
@@ -622,7 +616,7 @@ NS_ErrorAccordingToNSPR()
622616
void
623617
NS_ABORT_OOM(size_t aSize)
624618
{
625-
#if defined(MOZ_CRASHREPORTER) && !defined(MOZILLA_XPCOMRT_API)
619+
#ifdef MOZ_CRASHREPORTER
626620
CrashReporter::AnnotateOOMAllocationSize(aSize);
627621
#endif
628622
MOZ_CRASH();

xpcom/base/nsIMemoryReporter.idl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ nsresult RegisterNonJSSizeOfTab(NonJSSizeOfTabFn aSizeOfTabFn);
516516

517517
}
518518

519-
#if defined(MOZ_DMD) && !defined(MOZILLA_XPCOMRT_API)
519+
#if defined(MOZ_DMD)
520520
namespace mozilla {
521521
namespace dmd {
522522
// This runs all the memory reporters in the current process but does nothing

xpcom/build/FileLocation.cpp

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

55
#include "FileLocation.h"
6-
#if !defined(MOZILLA_XPCOMRT_API)
76
#include "nsZipArchive.h"
87
#include "nsURLHelper.h"
9-
#endif // !defined(MOZILLA_XPCOMRT_API)
108

119
namespace mozilla {
1210

@@ -33,12 +31,9 @@ FileLocation::FileLocation(const FileLocation& aFile, const char* aPath)
3331
if (aFile.IsZip()) {
3432
if (aFile.mBaseFile) {
3533
Init(aFile.mBaseFile, aFile.mPath.get());
36-
}
37-
#if !defined(MOZILLA_XPCOMRT_API)
38-
else {
34+
} else {
3935
Init(aFile.mBaseZip, aFile.mPath.get());
4036
}
41-
#endif
4237
if (aPath) {
4338
int32_t i = mPath.RFindChar('/');
4439
if (kNotFound == i) {
@@ -76,37 +71,30 @@ FileLocation::FileLocation(const FileLocation& aFile, const char* aPath)
7671
void
7772
FileLocation::Init(nsIFile* aFile)
7873
{
79-
#if !defined(MOZILLA_XPCOMRT_API)
8074
mBaseZip = nullptr;
81-
#endif //!defined(MOZILLA_XPCOMRT_API)
8275
mBaseFile = aFile;
8376
mPath.Truncate();
8477
}
8578

8679
void
8780
FileLocation::Init(nsIFile* aFile, const char* aPath)
8881
{
89-
#if !defined(MOZILLA_XPCOMRT_API)
9082
mBaseZip = nullptr;
91-
#endif // !defined(MOZILLA_XPCOMRT_API)
9283
mBaseFile = aFile;
9384
mPath = aPath;
9485
}
9586

9687
void
9788
FileLocation::Init(nsZipArchive* aZip, const char* aPath)
9889
{
99-
#if !defined(MOZILLA_XPCOMRT_API)
10090
mBaseZip = aZip;
101-
#endif // !defined(MOZILLA_XPCOMRT_API)
10291
mBaseFile = nullptr;
10392
mPath = aPath;
10493
}
10594

10695
void
10796
FileLocation::GetURIString(nsACString& aResult) const
10897
{
109-
#if !defined(MOZILLA_XPCOMRT_API)
11098
if (mBaseFile) {
11199
net_GetURLSpecFromActualFile(mBaseFile, aResult);
112100
} else if (mBaseZip) {
@@ -118,21 +106,18 @@ FileLocation::GetURIString(nsACString& aResult) const
118106
aResult += "!/";
119107
aResult += mPath;
120108
}
121-
#endif // !defined(MOZILLA_XPCOMRT_API)
122109
}
123110

124111
already_AddRefed<nsIFile>
125112
FileLocation::GetBaseFile()
126113
{
127-
#if !defined(MOZILLA_XPCOMRT_API)
128114
if (IsZip() && mBaseZip) {
129115
nsRefPtr<nsZipHandle> handler = mBaseZip->GetFD();
130116
if (handler) {
131117
return handler->mFile.GetBaseFile();
132118
}
133119
return nullptr;
134120
}
135-
#endif // !defined(MOZILLA_XPCOMRT_API)
136121

137122
nsCOMPtr<nsIFile> file = mBaseFile;
138123
return file.forget();
@@ -152,7 +137,6 @@ FileLocation::Equals(const FileLocation& aFile) const
152137

153138
const FileLocation* a = this;
154139
const FileLocation* b = &aFile;
155-
#if !defined(MOZILLA_XPCOMRT_API)
156140
if (a->mBaseZip) {
157141
nsRefPtr<nsZipHandle> handler = a->mBaseZip->GetFD();
158142
a = &handler->mFile;
@@ -161,15 +145,12 @@ FileLocation::Equals(const FileLocation& aFile) const
161145
nsRefPtr<nsZipHandle> handler = b->mBaseZip->GetFD();
162146
b = &handler->mFile;
163147
}
164-
#endif // !defined(MOZILLA_XPCOMRT_API)
165-
166148
return a->Equals(*b);
167149
}
168150

169151
nsresult
170152
FileLocation::GetData(Data& aData)
171153
{
172-
#if !defined(MOZILLA_XPCOMRT_API)
173154
if (!IsZip()) {
174155
return mBaseFile->OpenNSPRFileDesc(PR_RDONLY, 0444, &aData.mFd.rwget());
175156
}
@@ -182,7 +163,6 @@ FileLocation::GetData(Data& aData)
182163
if (aData.mItem) {
183164
return NS_OK;
184165
}
185-
#endif // !defined(MOZILLA_XPCOMRT_API)
186166
return NS_ERROR_FILE_UNRECOGNIZED_PATH;
187167
}
188168

@@ -201,13 +181,10 @@ FileLocation::Data::GetSize(uint32_t* aResult)
201181

202182
*aResult = fileInfo.size;
203183
return NS_OK;
204-
}
205-
#if !defined(MOZILLA_XPCOMRT_API)
206-
else if (mItem) {
184+
} else if (mItem) {
207185
*aResult = mItem->RealSize();
208186
return NS_OK;
209187
}
210-
#endif // !defined(MOZILLA_XPCOMRT_API)
211188
return NS_ERROR_NOT_INITIALIZED;
212189
}
213190

@@ -224,16 +201,13 @@ FileLocation::Data::Copy(char* aBuf, uint32_t aLen)
224201
totalRead += read;
225202
}
226203
return NS_OK;
227-
}
228-
#if !defined(MOZILLA_XPCOMRT_API)
229-
else if (mItem) {
204+
} else if (mItem) {
230205
nsZipCursor cursor(mItem, mZip, reinterpret_cast<uint8_t*>(aBuf),
231206
aLen, true);
232207
uint32_t readLen;
233208
cursor.Copy(&readLen);
234209
return (readLen == aLen) ? NS_OK : NS_ERROR_FILE_CORRUPTED;
235210
}
236-
#endif // !defined(MOZILLA_XPCOMRT_API)
237211
return NS_ERROR_NOT_INITIALIZED;
238212
}
239213

xpcom/build/FileLocation.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,7 @@ class FileLocation
8787
* Boolean value corresponding to whether the file location is initialized
8888
* or not.
8989
*/
90-
#if defined(MOZILLA_XPCOMRT_API)
91-
operator bool() const { return mBaseFile; }
92-
#else
9390
operator bool() const { return mBaseFile || mBaseZip; }
94-
#endif // defined(MOZILLA_XPCOMRT_API)
9591

9692
/**
9793
* Returns whether another FileLocation points to the same resource
@@ -115,9 +111,7 @@ class FileLocation
115111
nsresult Copy(char* aBuf, uint32_t aLen);
116112
protected:
117113
friend class FileLocation;
118-
#if !defined(MOZILLA_XPCOMRT_API)
119114
nsZipItem* mItem;
120-
#endif // !defined(MOZILLA_XPCOMRT_API)
121115
nsRefPtr<nsZipArchive> mZip;
122116
mozilla::AutoFDClose mFd;
123117
};
@@ -129,9 +123,7 @@ class FileLocation
129123
nsresult GetData(Data& aData);
130124
private:
131125
nsCOMPtr<nsIFile> mBaseFile;
132-
#if !defined(MOZILLA_XPCOMRT_API)
133126
nsRefPtr<nsZipArchive> mBaseZip;
134-
#endif // !defined(MOZILLA_XPCOMRT_API)
135127
nsCString mPath;
136128
}; /* class FileLocation */
137129

xpcom/build/ServiceList.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44
// IWYU pragma: private, include "mozilla/Services.h"
55

6-
#if !defined(MOZILLA_XPCOMRT_API)
76
#ifdef ACCESSIBILITY
87
MOZ_SERVICE(AccessibilityService, nsIAccessibilityService,
98
"@mozilla.org/accessibilityService;1")
@@ -18,10 +17,8 @@ MOZ_SERVICE(XULOverlayProviderService, nsIXULOverlayProvider,
1817
"@mozilla.org/chrome/chrome-registry;1")
1918
MOZ_SERVICE(IOService, nsIIOService,
2019
"@mozilla.org/network/io-service;1")
21-
#endif // !defined(MOZILLA_XPCOMRT_API)
2220
MOZ_SERVICE(ObserverService, nsIObserverService,
2321
"@mozilla.org/observer-service;1")
24-
#if !defined(MOZILLA_XPCOMRT_API)
2522
MOZ_SERVICE(StringBundleService, nsIStringBundleService,
2623
"@mozilla.org/intl/stringbundle;1")
2724
MOZ_SERVICE(XPConnect, nsIXPConnect,
@@ -47,4 +44,3 @@ MOZ_SERVICE(HistoryService, IHistory,
4744
#ifdef MOZ_USE_NAMESPACE
4845
}
4946
#endif
50-
#endif // !defined(MOZILLA_XPCOMRT_API)

0 commit comments

Comments
 (0)