Bug 1393369. P2 - remove MediaResource::GetCurrentPrincipal(). r=gerald

MozReview-Commit-ID: 9as5ya2xXdL

--HG--
extra : rebase_source : 7141cec4f3e9c38253b85e71d3b5efe5a5d7dddd
extra : source : 9d9f1de4db95a353040f7c7c484e7d9d79f275fa
This commit is contained in:
JW Wang 2017-08-24 17:01:08 +08:00
Родитель 59d7107e86
Коммит db3e1718f7
6 изменённых файлов: 5 добавлений и 20 удалений

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

@ -36,12 +36,6 @@ protected:
}
private:
// Get the current principal for the channel
already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override
{
nsCOMPtr<nsIPrincipal> principal = mPrincipal;
return principal.forget();
}
// These methods are called off the main thread.
nsresult ReadAt(int64_t aOffset, char* aBuffer,
uint32_t aCount, uint32_t* aBytes) override

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

@ -160,9 +160,6 @@ public:
NS_METHOD_(MozExternalRefCountType) AddRef(void);
NS_METHOD_(MozExternalRefCountType) Release(void);
// Get the current principal for the channel
virtual already_AddRefed<nsIPrincipal> GetCurrentPrincipal() = 0;
// These methods are called off the main thread.
// Read up to aCount bytes from the stream. The read starts at
// aOffset in the stream, seeking to that location initially if
@ -290,6 +287,9 @@ public:
// requests are supported by the connection/server.
virtual bool IsTransportSeekable() = 0;
// Get the current principal for the channel
virtual already_AddRefed<nsIPrincipal> GetCurrentPrincipal() = 0;
/**
* Open the stream. This creates a stream listener and returns it in
* aStreamListener; this listener needs to be notified of incoming data.

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

@ -16,10 +16,6 @@ class MockMediaResource : public MediaResource
{
public:
explicit MockMediaResource(const char* aFileName);
already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override
{
return nullptr;
}
nsresult ReadAt(int64_t aOffset, char* aBuffer, uint32_t aCount,
uint32_t* aBytes) override;
// Data stored in file, caching recommended.

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

@ -59,7 +59,7 @@ public:
bool IsDataCachedToEndOfResource(int64_t aOffset) override { UNIMPLEMENTED(); return false; }
nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount) override { UNIMPLEMENTED(); return NS_ERROR_FAILURE; }
already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override
already_AddRefed<nsIPrincipal> GetCurrentPrincipal()
{
NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");

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

@ -43,7 +43,7 @@ public:
bool IsDataCachedToEndOfResource(int64_t aOffset) override { UNIMPLEMENTED(); return false; }
nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount) override { UNIMPLEMENTED(); return NS_ERROR_FAILURE; }
already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override
already_AddRefed<nsIPrincipal> GetCurrentPrincipal()
{
return RefPtr<nsIPrincipal>(mPrincipal).forget();
}

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

@ -31,11 +31,6 @@ class SourceBufferResource final : public MediaResource
public:
SourceBufferResource();
nsresult Close();
already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override
{
UNIMPLEMENTED();
return nullptr;
}
nsresult ReadAt(int64_t aOffset,
char* aBuffer,
uint32_t aCount,