Skip to content

Commit

Permalink
Backed out changeset 684888aeee81 (bug 1287946)
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Jul 21, 2016
1 parent d8c7234 commit e8bc59a
Show file tree
Hide file tree
Showing 67 changed files with 217 additions and 208 deletions.
6 changes: 3 additions & 3 deletions dom/gamepad/android/AndroidGamepad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "GeneratedJNIWrappers.h"
#include "AndroidBridge.h"

namespace mozilla {
namespace dom {

void StartGamepadMonitoring()
{
java::GeckoAppShell::StartMonitoringGamepad();
widget::GeckoAppShell::StartMonitoringGamepad();
}

void StopGamepadMonitoring()
{
java::GeckoAppShell::StopMonitoringGamepad();
widget::GeckoAppShell::StopMonitoringGamepad();
}

} // namespace dom
Expand Down
2 changes: 1 addition & 1 deletion dom/ipc/ContentParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2837,7 +2837,7 @@ ContentParent::RecvGetShowPasswordSetting(bool* showPassword)
#ifdef MOZ_WIDGET_ANDROID
NS_ASSERTION(AndroidBridge::Bridge() != nullptr, "AndroidBridge is not available");

*showPassword = java::GeckoAppShell::GetShowPasswordSetting();
*showPassword = mozilla::widget::GeckoAppShell::GetShowPasswordSetting();
#endif
return true;
}
Expand Down
1 change: 1 addition & 0 deletions dom/media/fmp4/MP4Decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#endif
#ifdef MOZ_WIDGET_ANDROID
#include "nsIGfxInfo.h"
#include "AndroidBridge.h"
#endif
#include "mozilla/layers/LayersTypes.h"

Expand Down
4 changes: 4 additions & 0 deletions dom/media/mediasource/MediaSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
#include "gfxPlatform.h"
#include "mozilla/Snprintf.h"

#ifdef MOZ_WIDGET_ANDROID
#include "AndroidBridge.h"
#endif

struct JSContext;
class JSObject;

Expand Down
10 changes: 5 additions & 5 deletions dom/media/platforms/android/AndroidDecoderModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static PRLogModuleInfo* AndroidDecoderModuleLog()

using namespace mozilla;
using namespace mozilla::gl;
using namespace mozilla::java::sdk;
using namespace mozilla::widget::sdk;
using media::TimeUnit;

namespace mozilla {
Expand Down Expand Up @@ -179,9 +179,9 @@ class AudioDataDecoder : public MediaCodecDataDecoder
&buffer));

if (!buffer && aConfig.mCodecSpecificConfig->Length() >= 2) {
buffer = jni::ByteBuffer::New(
aConfig.mCodecSpecificConfig->Elements(),
aConfig.mCodecSpecificConfig->Length());
buffer = jni::Object::LocalRef::Adopt(
env, env->NewDirectByteBuffer(aConfig.mCodecSpecificConfig->Elements(),
aConfig.mCodecSpecificConfig->Length()));
NS_ENSURE_SUCCESS_VOID(aFormat->SetByteBuffer(NS_LITERAL_STRING("csd-0"),
buffer));
}
Expand Down Expand Up @@ -277,7 +277,7 @@ AndroidDecoderModule::SupportsMimeType(const nsACString& aMimeType,
return false;
}

return java::HardwareCodecCapabilityUtils::FindDecoderCodecInfoForMimeType(
return widget::HardwareCodecCapabilityUtils::FindDecoderCodecInfoForMimeType(
nsCString(TranslateMimeType(aMimeType)));
}

Expand Down
20 changes: 10 additions & 10 deletions dom/media/platforms/android/AndroidDecoderModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class MediaCodecDataDecoder : public MediaDataDecoder {

MediaCodecDataDecoder(MediaData::Type aType,
const nsACString& aMimeType,
java::sdk::MediaFormat::Param aFormat,
widget::sdk::MediaFormat::Param aFormat,
MediaDataDecoderCallback* aCallback);

virtual ~MediaCodecDataDecoder();
Expand Down Expand Up @@ -73,16 +73,16 @@ class MediaCodecDataDecoder : public MediaDataDecoder {

static const char* ModuleStateStr(ModuleState aState);

virtual nsresult InitDecoder(java::sdk::Surface::Param aSurface);
virtual nsresult InitDecoder(widget::sdk::Surface::Param aSurface);

virtual nsresult Output(java::sdk::BufferInfo::Param aInfo, void* aBuffer,
java::sdk::MediaFormat::Param aFormat, const media::TimeUnit& aDuration)
virtual nsresult Output(widget::sdk::BufferInfo::Param aInfo, void* aBuffer,
widget::sdk::MediaFormat::Param aFormat, const media::TimeUnit& aDuration)
{
return NS_OK;
}

virtual nsresult PostOutput(java::sdk::BufferInfo::Param aInfo,
java::sdk::MediaFormat::Param aFormat, const media::TimeUnit& aDuration)
virtual nsresult PostOutput(widget::sdk::BufferInfo::Param aInfo,
widget::sdk::MediaFormat::Param aFormat, const media::TimeUnit& aDuration)
{
return NS_OK;
}
Expand All @@ -99,8 +99,8 @@ class MediaCodecDataDecoder : public MediaDataDecoder {
nsresult QueueEOS();
void HandleEOS(int32_t aOutputStatus);
Maybe<media::TimeUnit> GetOutputDuration();
nsresult ProcessOutput(java::sdk::BufferInfo::Param aInfo,
java::sdk::MediaFormat::Param aFormat,
nsresult ProcessOutput(widget::sdk::BufferInfo::Param aInfo,
widget::sdk::MediaFormat::Param aFormat,
int32_t aStatus);
ModuleState State() const;
// Sets decoder state and returns whether the new state has become effective.
Expand All @@ -112,11 +112,11 @@ class MediaCodecDataDecoder : public MediaDataDecoder {
MediaData::Type mType;

nsAutoCString mMimeType;
java::sdk::MediaFormat::GlobalRef mFormat;
widget::sdk::MediaFormat::GlobalRef mFormat;

MediaDataDecoderCallback* mCallback;

java::sdk::MediaCodec::GlobalRef mDecoder;
widget::sdk::MediaCodec::GlobalRef mDecoder;

jni::ObjectArray::GlobalRef mInputBuffers;
jni::ObjectArray::GlobalRef mOutputBuffers;
Expand Down
1 change: 1 addition & 0 deletions dom/media/webrtc/MediaEngineDefault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "nsIPrefBranch.h"

#ifdef MOZ_WIDGET_ANDROID
#include "AndroidBridge.h"
#include "nsISupportsUtils.h"
#endif

Expand Down
2 changes: 1 addition & 1 deletion dom/mobilemessage/android/SmsManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace mozilla {

class SmsManager : public java::GeckoSmsManager::Natives<SmsManager>
class SmsManager : public widget::GeckoSmsManager::Natives<SmsManager>
{
private:
SmsManager();
Expand Down
1 change: 1 addition & 0 deletions dom/plugins/base/android/ANPEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <android/log.h>
#include "nsThreadUtils.h"
#include "nsNPAPIPluginInstance.h"
#include "AndroidBridge.h"
#include "nsNPAPIPlugin.h"

#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
Expand Down
1 change: 1 addition & 0 deletions dom/plugins/base/android/ANPNativeWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

// must include config.h first for webkit to fiddle with new/delete
#include <android/log.h>
#include "AndroidBridge.h"
#include "ANPBase.h"
#include "nsIPluginInstanceOwner.h"
#include "nsPluginInstanceOwner.h"
Expand Down
11 changes: 5 additions & 6 deletions dom/plugins/base/android/ANPSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@

#include "base/basictypes.h"

#include "ANPBase.h"
#include "GeneratedJNIWrappers.h"
#include "PluginPRLibrary.h"
#include "assert.h"
#include "ANPBase.h"
#include <android/log.h>
#include "nsNPAPIPluginInstance.h"
#include "AndroidBridge.h"
#include "nsNPAPIPlugin.h"

#include <android/log.h>
#include "PluginPRLibrary.h"

#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
#define ASSIGN(obj, name) (obj)->name = anp_system_##name
Expand Down Expand Up @@ -61,7 +60,7 @@ jclass anp_system_loadJavaClass(NPP instance, const char* className)
nsCString libName;
lib->GetLibraryPath(libName);

return mozilla::java::GeckoAppShell::LoadPluginClass(className, libName).Forget();
return mozilla::widget::GeckoAppShell::LoadPluginClass(className, libName).Forget();
}

void anp_system_setPowerState(NPP instance, ANPPowerState powerState)
Expand Down
1 change: 1 addition & 0 deletions dom/plugins/base/android/ANPVideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include <android/log.h>
#include "AndroidBridge.h"
#include "ANPBase.h"
#include "nsIPluginInstanceOwner.h"
#include "nsPluginInstanceOwner.h"
Expand Down
1 change: 1 addition & 0 deletions dom/plugins/base/android/ANPWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "assert.h"
#include "ANPBase.h"
#include <android/log.h>
#include "AndroidBridge.h"
#include "nsNPAPIPluginInstance.h"
#include "nsPluginInstanceOwner.h"
#include "nsWindow.h"
Expand Down
4 changes: 2 additions & 2 deletions dom/plugins/base/nsNPAPIPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ using mozilla::plugins::PluginModuleContentParent;
#include <android/log.h>
#include "android_npapi.h"
#include "ANPBase.h"
#include "GeneratedJNIWrappers.h"
#include "AndroidBridge.h"
#undef LOG
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
#endif
Expand Down Expand Up @@ -2115,7 +2115,7 @@ _getvalue(NPP npp, NPNVariable variable, void *result)

case kJavaContext_ANPGetValue: {
LOG("get java context");
auto ret = java::GeckoAppShell::GetContext();
auto ret = widget::GeckoAppShell::GetContext();
if (!ret)
return NPERR_GENERIC_ERROR;

Expand Down
6 changes: 3 additions & 3 deletions dom/plugins/base/nsNPAPIPluginInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ void nsNPAPIPluginInstance::NotifyFullScreen(bool aFullScreen)
SendLifecycleEvent(this, mFullScreen ? kEnterFullScreen_ANPLifecycleAction : kExitFullScreen_ANPLifecycleAction);

if (mFullScreen && mFullScreenOrientation != dom::eScreenOrientation_None) {
java::GeckoAppShell::LockScreenOrientation(mFullScreenOrientation);
widget::GeckoAppShell::LockScreenOrientation(mFullScreenOrientation);
}
}

Expand Down Expand Up @@ -845,11 +845,11 @@ void nsNPAPIPluginInstance::SetFullScreenOrientation(uint32_t orientation)
// We're already fullscreen so immediately apply the orientation change

if (mFullScreenOrientation != dom::eScreenOrientation_None) {
java::GeckoAppShell::LockScreenOrientation(mFullScreenOrientation);
widget::GeckoAppShell::LockScreenOrientation(mFullScreenOrientation);
} else if (oldOrientation != dom::eScreenOrientation_None) {
// We applied an orientation when we entered fullscreen, but
// we don't want it anymore
java::GeckoAppShell::UnlockScreenOrientation();
widget::GeckoAppShell::UnlockScreenOrientation();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion dom/plugins/base/nsPluginInstanceOwner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,7 @@ void nsPluginInstanceOwner::RemovePluginView()
if (!mInstance || !mJavaView)
return;

java::GeckoAppShell::RemovePluginView(
widget::GeckoAppShell::RemovePluginView(
jni::Object::Ref::From(jobject(mJavaView)), mFullScreen);
jni::GetGeckoThreadEnv()->DeleteGlobalRef((jobject)mJavaView);
mJavaView = nullptr;
Expand Down
8 changes: 4 additions & 4 deletions dom/system/android/AndroidLocationProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include "nsGeolocation.h"
#include "nsGeoPosition.h"
#include "AndroidBridge.h"
#include "AndroidLocationProvider.h"
#include "GeneratedJNIWrappers.h"

using namespace mozilla;

Expand All @@ -27,7 +27,7 @@ AndroidLocationProvider::~AndroidLocationProvider()
NS_IMETHODIMP
AndroidLocationProvider::Startup()
{
java::GeckoAppShell::EnableLocation(true);
widget::GeckoAppShell::EnableLocation(true);
return NS_OK;
}

Expand All @@ -43,13 +43,13 @@ AndroidLocationProvider::Watch(nsIGeolocationUpdate* aCallback)
NS_IMETHODIMP
AndroidLocationProvider::Shutdown()
{
java::GeckoAppShell::EnableLocation(false);
widget::GeckoAppShell::EnableLocation(false);
return NS_OK;
}

NS_IMETHODIMP
AndroidLocationProvider::SetHighAccuracy(bool enable)
{
java::GeckoAppShell::EnableLocationHighAccuracy(enable);
widget::GeckoAppShell::EnableLocationHighAccuracy(enable);
return NS_OK;
}
4 changes: 2 additions & 2 deletions dom/system/android/nsHapticFeedback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "mozilla/dom/ContentChild.h"
#include "nsHapticFeedback.h"
#include "GeneratedJNIWrappers.h"
#include "AndroidBridge.h"

using namespace mozilla;

Expand All @@ -15,6 +15,6 @@ NS_IMPL_ISUPPORTS(nsHapticFeedback, nsIHapticFeedback)
NS_IMETHODIMP
nsHapticFeedback::PerformSimpleAction(int32_t aType)
{
java::GeckoAppShell::PerformHapticFeedback(aType == LongPress);
widget::GeckoAppShell::PerformHapticFeedback(aType == LongPress);
return NS_OK;
}
4 changes: 2 additions & 2 deletions gfx/gl/AndroidSurfaceTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

using namespace mozilla;
using namespace mozilla::jni;
using namespace mozilla::java;
using namespace mozilla::java::sdk;
using namespace mozilla::widget;
using namespace mozilla::widget::sdk;

namespace mozilla {
namespace gl {
Expand Down
6 changes: 3 additions & 3 deletions gfx/gl/AndroidSurfaceTexture.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class AndroidSurfaceTexture {
void NotifyFrameAvailable();

GLuint Texture() const { return mTexture; }
const java::sdk::Surface::Ref& JavaSurface() const { return mSurface; }
const widget::sdk::Surface::Ref& JavaSurface() const { return mSurface; }

private:
AndroidSurfaceTexture();
Expand All @@ -92,8 +92,8 @@ class AndroidSurfaceTexture {
bool Init(GLContext* aContext, GLuint aTexture);

GLuint mTexture;
java::sdk::SurfaceTexture::GlobalRef mSurfaceTexture;
java::sdk::Surface::GlobalRef mSurface;
widget::sdk::SurfaceTexture::GlobalRef mSurfaceTexture;
widget::sdk::Surface::GlobalRef mSurface;

GLContext* mAttachedContext;

Expand Down
11 changes: 4 additions & 7 deletions gfx/layers/apz/src/AndroidAPZ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ namespace mozilla {
namespace layers {

AndroidSpecificState::AndroidSpecificState() {
using namespace mozilla::java;

sdk::ViewConfiguration::LocalRef config;
if (sdk::ViewConfiguration::Get(GeckoAppShell::GetApplicationContext(), &config) == NS_OK) {
widget::sdk::ViewConfiguration::LocalRef config;
if (widget::sdk::ViewConfiguration::Get(widget::GeckoAppShell::GetApplicationContext(), &config) == NS_OK) {
int32_t speed = 0;
if (config->GetScaledMaximumFlingVelocity(&speed) == NS_OK) {
sMaxFlingSpeed = (float)speed * 0.001f;
Expand All @@ -34,9 +32,8 @@ AndroidSpecificState::AndroidSpecificState() {
} else {
ANDROID_APZ_LOG("%p Failed to get ViewConfiguration\n", this);
}

StackScroller::LocalRef scroller;
if (StackScroller::New(GeckoAppShell::GetApplicationContext(), &scroller) != NS_OK) {
widget::StackScroller::LocalRef scroller;
if (widget::StackScroller::New(widget::GeckoAppShell::GetApplicationContext(), &scroller) != NS_OK) {
ANDROID_APZ_LOG("%p Failed to create Android StackScroller\n", this);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions gfx/layers/apz/src/AndroidAPZ.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AndroidSpecificState : public PlatformSpecificStateBase {
return this;
}

java::StackScroller::GlobalRef mOverScroller;
widget::StackScroller::GlobalRef mOverScroller;
};

class AndroidFlingAnimation: public AsyncPanZoomAnimation {
Expand All @@ -40,7 +40,7 @@ class AndroidFlingAnimation: public AsyncPanZoomAnimation {
bool CheckBounds(Axis& aAxis, float aValue, float aDirection, float* aClamped);

AsyncPanZoomController& mApzc;
java::StackScroller::GlobalRef mOverScroller;
widget::StackScroller::GlobalRef mOverScroller;
RefPtr<const OverscrollHandoffChain> mOverscrollHandoffChain;
RefPtr<const AsyncPanZoomController> mScrolledApzc;
bool mSentBounceX;
Expand Down
Loading

0 comments on commit e8bc59a

Please sign in to comment.