This commit is contained in:
Ryan VanderMeulen 2013-07-01 14:31:38 -04:00
Родитель 2d7b573442 31f4f1548c
Коммит cd70a05106
7 изменённых файлов: 46 добавлений и 53 удалений

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

@ -482,9 +482,6 @@ var shell = {
this.reportCrash(true);
let chromeWindow = window.QueryInterface(Ci.nsIDOMChromeWindow);
chromeWindow.browserDOMWindow = new nsBrowserAccess();
Cu.import('resource://gre/modules/Webapps.jsm');
DOMApplicationRegistry.allAppsLaunchable = true;
@ -608,37 +605,6 @@ var shell = {
}
};
function nsBrowserAccess() {
}
nsBrowserAccess.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIBrowserDOMWindow]),
openURI: function openURI(uri, opener, where, context) {
// TODO This should be replaced by an 'open-browser-window' intent
let content = shell.contentBrowser.contentWindow;
let contentWindow = content.wrappedJSObject;
if (!('getApplicationManager' in contentWindow))
return null;
let applicationManager = contentWindow.getApplicationManager();
if (!applicationManager)
return null;
let url = uri ? uri.spec : 'about:blank';
let window = applicationManager.launch(url, where);
return window.contentWindow;
},
openURIInFrame: function openURIInFrame(uri, opener, where, context) {
throw new Error('Not Implemented');
},
isTabContentWindow: function isTabContentWindow(contentWindow) {
return contentWindow == window;
}
};
// Listen for the request of opening app and relay them to Gaia.
Services.obs.addObserver(function onSystemMessageOpenApp(subject, topic, data) {
let msg = JSON.parse(data);

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

@ -1,4 +1,4 @@
{
"revision": "b781d1e14fd8e5cea74943195b7f35e807212f34",
"revision": "5d46c263ad4ad0909f962fd885ba8a9c92a4b91c",
"repo_path": "/integration/gaia-central"
}

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

@ -518,7 +518,9 @@ bool DecoderTraits::IsSupportedInVideoDocument(const nsACString& aType)
IsOggType(aType) ||
#endif
#ifdef MOZ_OMX_DECODER
IsOmxSupportedType(aType) ||
// We support amr inside WebApps on firefoxOS but not in general web content.
// Ensure we dont create a VideoDocument when accessing amr URLs directly.
(IsOmxSupportedType(aType) && !aType.EqualsASCII("audio/amr")) ||
#endif
#ifdef MOZ_WEBM
IsWebMType(aType) ||

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

@ -151,7 +151,8 @@ OmxDecoder::OmxDecoder(MediaResource *aResource,
mAudioBuffer(nullptr),
mIsVideoSeeking(false),
mAudioMetadataRead(false),
mPaused(false)
mAudioPaused(false),
mVideoPaused(false)
{
mLooper = new ALooper;
mLooper->setName("OmxDecoder");
@ -736,33 +737,44 @@ bool OmxDecoder::ReadAudio(AudioFrame *aFrame, int64_t aSeekTimeUs)
nsresult OmxDecoder::Play()
{
if (!mPaused) {
if (!mVideoPaused && !mAudioPaused) {
return NS_OK;
}
if (mVideoSource.get() && mVideoSource->start() != OK) {
return NS_ERROR_UNEXPECTED;
}
if (mAudioSource.get()&& mAudioSource->start() != OK) {
if (mVideoPaused && mVideoSource.get() && mVideoSource->start() != OK) {
return NS_ERROR_UNEXPECTED;
}
mPaused = false;
mVideoPaused = false;
if (mAudioPaused && mAudioSource.get() && mAudioSource->start() != OK) {
return NS_ERROR_UNEXPECTED;
}
mAudioPaused = false;
return NS_OK;
}
// AOSP didn't give implementation on OMXCodec::Pause() and not define
// OMXCodec::Start() should be called for resuming the decoding. Currently
// it is customized by a specific open source repository only.
// ToDo The one not supported OMXCodec::Pause() should return error code here,
// so OMXCodec::Start() doesn't be called again for resuming. But if someone
// implement the OMXCodec::Pause() and need a following OMXCodec::Read() with
// seek option (define in MediaSource.h) then it is still not supported here.
// We need to fix it until it is really happened.
void OmxDecoder::Pause()
{
if (mPaused) {
if (mVideoPaused || mAudioPaused) {
return;
}
if (mVideoSource.get()) {
mVideoSource->pause();
if (mVideoSource.get() && mVideoSource->pause() == OK) {
mVideoPaused = true;
}
if (mAudioSource.get()) {
mAudioSource->pause();
if (mAudioSource.get() && mAudioSource->pause() == OK) {
mAudioPaused = true;
}
mPaused = true;
}
// Called on ALooper thread.

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

@ -158,7 +158,8 @@ class OmxDecoder : public OMXCodecProxy::EventListener {
int32_t aAudioChannels, int32_t aAudioSampleRate);
//True if decoder is in a paused state
bool mPaused;
bool mAudioPaused;
bool mVideoPaused;
public:
OmxDecoder(MediaResource *aResource, AbstractMediaDecoder *aDecoder);

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

@ -1057,7 +1057,10 @@ EnsureKernelLowMemKillerParamsSet()
nsAutoCString adjParams;
nsAutoCString minfreeParams;
for (int i = 0; i < NUM_PROCESS_PRIORITY; i++) {
int32_t lowerBoundOfNextOomScoreAdj = OOM_SCORE_ADJ_MIN - 1;
int32_t lowerBoundOfNextKillUnderMB = 0;
for (int i = NUM_PROCESS_PRIORITY - 1; i >= 0; i--) {
// The system doesn't function correctly if we're missing these prefs, so
// crash loudly.
@ -1079,11 +1082,19 @@ EnsureKernelLowMemKillerParamsSet()
MOZ_CRASH();
}
// The LMK in kernel silently malfunctions if we assign the parameters
// in non-increasing order, so we add this assertion here. See bug 887192.
MOZ_ASSERT(oomScoreAdj > lowerBoundOfNextOomScoreAdj);
MOZ_ASSERT(killUnderMB > lowerBoundOfNextKillUnderMB);
// adj is in oom_adj units.
adjParams.AppendPrintf("%d,", OomAdjOfOomScoreAdj(oomScoreAdj));
// minfree is in pages.
minfreeParams.AppendPrintf("%d,", killUnderMB * 1024 * 1024 / PAGE_SIZE);
lowerBoundOfNextOomScoreAdj = oomScoreAdj;
lowerBoundOfNextKillUnderMB = killUnderMB;
}
// Strip off trailing commas.

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

@ -382,8 +382,9 @@ HwcComposer2D::PrepareLayerList(Layer* aLayer,
bufferRect = nsIntRect(state.mOffset.x, state.mOffset.y,
state.mSize.width, state.mSize.height);
} else {
bufferRect = nsIntRect(visibleRect.x, visibleRect.y,
state.mSize.width, state.mSize.height);
//Since the buffer doesn't have its own offset, assign the whole
//surface size as its buffer bounds
bufferRect = nsIntRect(0, 0, state.mSize.width, state.mSize.height);
}
}