Bug 1225682 - Don't use nsAuto{,C}String as class member variables in dom/media/. r=cpearce

This commit is contained in:
Mike Hommey 2015-11-19 18:00:39 +09:00
parent 311b82cd11
commit f185520f21
11 changed files with 25 additions and 25 deletions

View File

@ -135,7 +135,7 @@ private:
uint32_t mLength;
uint32_t mOffset;
nsCOMPtr<nsIPrincipal> mPrincipal;
const nsAutoCString mContentType;
const nsCString mContentType;
};
} // namespace mozilla

View File

@ -308,7 +308,7 @@ ParseXing(const char *aBuffer)
}
static int64_t
FindNumVBRFrames(const nsAutoCString& aFrame)
FindNumVBRFrames(const nsCString& aFrame)
{
const char *buffer = aFrame.get();
const char *bufferEnd = aFrame.get() + aFrame.Length();

View File

@ -198,7 +198,7 @@ private:
// If the MP3 has a variable bitrate, then there *should* be metadata about
// the encoding in the first frame. We buffer the first frame here.
nsAutoCString mFirstFrame;
nsCString mFirstFrame;
// While we are reading the first frame, this is the stream offset of the
// last byte of that frame. -1 at all other times.

View File

@ -75,7 +75,7 @@ public:
TrackID mTrackId;
nsAutoCString mMimeType;
nsCString mMimeType;
int64_t mDuration;
int64_t mMediaTime;
CryptoTrack mCrypto;
@ -451,7 +451,7 @@ private:
uint32_t mStreamSourceID;
public:
const nsAutoCString& mMimeType;
const nsCString& mMimeType;
};
} // namespace mozilla

View File

@ -451,10 +451,10 @@ protected:
// Content-Type of the channel. This is copied from the nsIChannel when the
// MediaResource is created. This is constant, so accessing from any thread
// is safe.
const nsAutoCString mContentType;
const nsCString mContentType;
// Copy of the url of the channel resource.
nsAutoCString mContentURL;
nsCString mContentURL;
// True if SetLoadInBackground() has been called with
// aLoadInBackground = true, i.e. when the document load event is not

View File

@ -453,7 +453,7 @@ void
LogToBrowserConsole(const nsAString& aMsg)
{
if (!NS_IsMainThread()) {
nsAutoString msg(aMsg);
nsString msg(aMsg);
nsCOMPtr<nsIRunnable> task =
NS_NewRunnableFunction([msg]() { LogToBrowserConsole(msg); });
NS_DispatchToMainThread(task.forget(), NS_DISPATCH_NORMAL);

View File

@ -185,8 +185,8 @@ private:
struct InitData {
uint32_t mPromiseId;
nsAutoString mOrigin;
nsAutoString mTopLevelOrigin;
nsString mOrigin;
nsString mTopLevelOrigin;
nsString mGMPName;
bool mInPrivateBrowsing;
};
@ -208,7 +208,7 @@ private:
dom::SessionType mSessionType;
uint32_t mCreateSessionToken;
PromiseId mPromiseId;
nsAutoCString mInitDataType;
nsCString mInitDataType;
nsTArray<uint8_t> mInitData;
};
// GMP thread only.
@ -216,7 +216,7 @@ private:
struct SessionOpData {
PromiseId mPromiseId;
nsAutoCString mSessionId;
nsCString mSessionId;
};
// GMP thread only.
void gmp_LoadSession(nsAutoPtr<SessionOpData> aData);
@ -230,7 +230,7 @@ private:
struct UpdateSessionData {
PromiseId mPromiseId;
nsAutoCString mSessionId;
nsCString mSessionId;
nsTArray<uint8_t> mResponse;
};
// GMP thread only.
@ -326,7 +326,7 @@ private:
// destructor. only use on main thread, and always nullcheck before using!
MainThreadOnlyRawPtr<dom::MediaKeys> mKeys;
const nsAutoString mKeySystem;
const nsString mKeySystem;
// Gecko Media Plugin thread. All interactions with the out-of-process
// EME plugin must come from this thread.

View File

@ -79,7 +79,7 @@ GMPDecryptorChild::SetSessionId(uint32_t aCreateSessionToken,
uint32_t aSessionIdLength)
{
CALL_ON_GMP_THREAD(SendSetSessionId,
aCreateSessionToken, nsAutoCString(aSessionId, aSessionIdLength));
aCreateSessionToken, nsCString(aSessionId, aSessionIdLength));
}
void
@ -102,7 +102,7 @@ GMPDecryptorChild::RejectPromise(uint32_t aPromiseId,
uint32_t aMessageLength)
{
CALL_ON_GMP_THREAD(SendRejectPromise,
aPromiseId, aException, nsAutoCString(aMessage, aMessageLength));
aPromiseId, aException, nsCString(aMessage, aMessageLength));
}
void
@ -115,7 +115,7 @@ GMPDecryptorChild::SessionMessage(const char* aSessionId,
nsTArray<uint8_t> msg;
msg.AppendElements(aMessage, aMessageLength);
CALL_ON_GMP_THREAD(SendSessionMessage,
nsAutoCString(aSessionId, aSessionIdLength),
nsCString(aSessionId, aSessionIdLength),
aMessageType, Move(msg));
}
@ -125,7 +125,7 @@ GMPDecryptorChild::ExpirationChange(const char* aSessionId,
GMPTimestamp aExpiryTime)
{
CALL_ON_GMP_THREAD(SendExpirationChange,
nsAutoCString(aSessionId, aSessionIdLength), aExpiryTime);
nsCString(aSessionId, aSessionIdLength), aExpiryTime);
}
void
@ -133,7 +133,7 @@ GMPDecryptorChild::SessionClosed(const char* aSessionId,
uint32_t aSessionIdLength)
{
CALL_ON_GMP_THREAD(SendSessionClosed,
nsAutoCString(aSessionId, aSessionIdLength));
nsCString(aSessionId, aSessionIdLength));
}
void
@ -145,9 +145,9 @@ GMPDecryptorChild::SessionError(const char* aSessionId,
uint32_t aMessageLength)
{
CALL_ON_GMP_THREAD(SendSessionError,
nsAutoCString(aSessionId, aSessionIdLength),
nsCString(aSessionId, aSessionIdLength),
aException, aSystemCode,
nsAutoCString(aMessage, aMessageLength));
nsCString(aMessage, aMessageLength));
}
void
@ -160,7 +160,7 @@ GMPDecryptorChild::KeyStatusChanged(const char* aSessionId,
nsAutoTArray<uint8_t, 16> kid;
kid.AppendElements(aKeyId, aKeyIdLength);
CALL_ON_GMP_THREAD(SendKeyStatusChanged,
nsAutoCString(aSessionId, aSessionIdLength), kid,
nsCString(aSessionId, aSessionIdLength), kid,
aStatus);
}

View File

@ -209,7 +209,7 @@ private:
nsCOMPtr<nsITimer> mAsyncShutdownTimeout; // GMP Thread only.
// NodeId the plugin is assigned to, or empty if the the plugin is not
// assigned to a NodeId.
nsAutoCString mNodeId;
nsCString mNodeId;
// This is used for GMP content in the parent, there may be more of these in
// the content processes.
RefPtr<GMPContentParent> mGMPContentParent;

View File

@ -156,7 +156,7 @@ private:
void Update(const nsCString& aPlugin, const nsCString& aInstance,
char aId, const nsCString& aState);
private:
struct State { nsAutoCString mStateSequence; nsCString mLastStateDescription; };
struct State { nsCString mStateSequence; nsCString mLastStateDescription; };
typedef nsClassHashtable<nsCStringHashKey, State> StatesByInstance;
typedef nsClassHashtable<nsCStringHashKey, StatesByInstance> StateInstancesByPlugin;
StateInstancesByPlugin mStates;

View File

@ -482,7 +482,7 @@ private:
// Hash record name to record data.
nsClassHashtable<nsCStringHashKey, Record> mRecords;
const nsAutoCString mNodeId;
const nsCString mNodeId;
const nsString mGMPName;
};