Skip to content

Commit d9c7494

Browse files
committed
Bug 1332639 - Remove the external string API: nsStringAPI.h/cpp and nsEmbedString.h, r=glandium
MozReview-Commit-ID: 9dZcmMAI0Vk --HG-- extra : rebase_source : 5561cf7f3318c60f082fff02c5e78aba661f6437
1 parent ac290e0 commit d9c7494

File tree

12 files changed

+13
-97
lines changed

12 files changed

+13
-97
lines changed

dom/media/webrtc/PeerIdentity.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77
#ifndef PeerIdentity_h
88
#define PeerIdentity_h
99

10-
#ifdef MOZILLA_INTERNAL_API
1110
#include "nsString.h"
12-
#else
13-
#include "nsStringAPI.h"
14-
#endif
1511

1612
template <class T> class nsCOMPtr;
1713
class nsIIDNService;

gfx/thebes/gfxASurface.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@
1414
#include "nsSize.h"
1515
#include "mozilla/gfx/Rect.h"
1616

17-
#ifdef MOZILLA_INTERNAL_API
1817
#include "nsStringFwd.h"
19-
#else
20-
#include "nsStringAPI.h"
21-
#endif
2218

2319
class gfxImageSurface;
2420
struct gfxRect;

netwerk/base/nsNetUtil.h

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
#include "mozilla/Services.h"
1919
#include "mozilla/Unused.h"
2020
#include "nsNetCID.h"
21+
#include "nsReadableUtils.h"
2122
#include "nsServiceManagerUtils.h"
23+
#include "nsString.h"
2224

2325
class nsIURI;
2426
class nsIPrincipal;
@@ -54,27 +56,10 @@ namespace mozilla { class OriginAttributes; }
5456
template <class> class nsCOMPtr;
5557
template <typename> struct already_AddRefed;
5658

57-
#ifdef MOZILLA_INTERNAL_API
58-
#include "nsReadableUtils.h"
59-
#include "nsString.h"
60-
#else
61-
#include "nsStringAPI.h"
62-
#endif
63-
64-
#ifdef MOZILLA_INTERNAL_API
6559
already_AddRefed<nsIIOService> do_GetIOService(nsresult *error = 0);
6660

6761
already_AddRefed<nsINetUtil> do_GetNetUtil(nsresult *error = 0);
6862

69-
#else
70-
// Helper, to simplify getting the I/O service.
71-
const nsGetServiceByContractIDWithError do_GetIOService(nsresult *error = 0);
72-
73-
// An alias to do_GetIOService
74-
const nsGetServiceByContractIDWithError do_GetNetUtil(nsresult *error = 0);
75-
76-
#endif
77-
7863
// private little helper function... don't call this directly!
7964
nsresult net_EnsureIOService(nsIIOService **ios, nsCOMPtr<nsIIOService> &grip);
8065

@@ -559,15 +544,10 @@ nsresult NS_ReadInputStreamToBuffer(nsIInputStream *aInputStream,
559544
void **aDest,
560545
uint32_t aCount);
561546

562-
// external code can't see fallible_t
563-
#ifdef MOZILLA_INTERNAL_API
564-
565547
nsresult NS_ReadInputStreamToString(nsIInputStream *aInputStream,
566548
nsACString &aDest,
567549
uint32_t aCount);
568550

569-
#endif
570-
571551
nsresult
572552
NS_LoadPersistentPropertiesFromURISpec(nsIPersistentProperties **outResult,
573553
const nsACString &aSpec);
@@ -979,9 +959,4 @@ bool InScriptableRange(uint64_t val);
979959
} // namespace net
980960
} // namespace mozilla
981961

982-
// Include some function bodies for callers with external linkage
983-
#ifndef MOZILLA_INTERNAL_API
984-
#include "nsNetUtilInlines.h"
985-
#endif
986-
987962
#endif // !nsNetUtil_h__

toolkit/profile/ProfileUnlockerWin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <restartmanager.h>
1212

1313
#include "nsIProfileUnlocker.h"
14-
#include "nsProfileStringTypes.h"
14+
#include "nsString.h"
1515
#include "nsWindowsHelpers.h"
1616

1717
namespace mozilla {

toolkit/profile/nsProfileLock.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* License, v. 2.0. If a copy of the MPL was not distributed with this
44
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
55

6-
#include "nsProfileStringTypes.h"
76
#include "nsProfileLock.h"
87
#include "nsCOMPtr.h"
98
#include "nsQueryObject.h"
9+
#include "nsString.h"
1010

1111
#if defined(XP_WIN)
1212
#include "ProfileUnlockerWin.h"

toolkit/profile/nsProfileStringTypes.h

Lines changed: 0 additions & 32 deletions
This file was deleted.

xpcom/glue/FileUtils.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <stdio.h>
99

1010
#include "nscore.h"
11-
#include "nsStringGlue.h"
1211
#include "private/pprio.h"
1312
#include "mozilla/Assertions.h"
1413
#include "mozilla/FileUtils.h"
@@ -36,7 +35,9 @@
3635

3736
// Functions that are not to be used in standalone glue must be implemented
3837
// within this #if block
39-
#if !defined(XPCOM_GLUE)
38+
#if defined(MOZILLA_INTERNAL_API)
39+
40+
#include "nsString.h"
4041

4142
bool
4243
mozilla::fallocate(PRFileDesc* aFD, int64_t aLength)

xpcom/glue/FileUtils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct ScopedCloseFDTraits
5050
};
5151
typedef Scoped<ScopedCloseFDTraits> ScopedClose;
5252

53-
#if !defined(XPCOM_GLUE)
53+
#if defined(MOZILLA_INTERNAL_API)
5454

5555
/**
5656
* AutoFDClose is a RAII wrapper for PRFileDesc.
@@ -119,7 +119,7 @@ void ReadAheadFile(nsIFile* aFile, const size_t aOffset = 0,
119119
const size_t aCount = SIZE_MAX,
120120
filedesc_t* aOutFd = nullptr);
121121

122-
#endif // !defined(XPCOM_GLUE)
122+
#endif // MOZILLA_INTERNAL_API
123123

124124
/**
125125
* Use readahead to preload shared libraries into the file cache before loading.

xpcom/glue/moz.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ with Files('nsString*'):
1010
DIRS += ['standalone']
1111

1212
EXPORTS += [
13-
'nsStringAPI.h',
1413
'nsStringGlue.h',
1514
]
1615

xpcom/glue/nsStringGlue.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
#ifndef nsStringGlue_h__
1515
#define nsStringGlue_h__
1616

17-
#ifdef MOZILLA_INTERNAL_API
17+
#ifndef MOZILLA_INTERNAL_API
18+
#error "Using XPCOM strings is limited to code linked into libxul."
19+
#endif
20+
1821
#include "nsString.h"
1922
#include "nsReadableUtils.h"
20-
#else
21-
#include "nsStringAPI.h"
22-
#endif
2323

2424
#endif // nsStringGlue_h__

0 commit comments

Comments
 (0)