Bug 1287946 - Update existing code to use mozilla::java; r=me

This commit is contained in:
Jim Chen 2016-07-21 00:42:26 -04:00
Родитель 3d8eec2482
Коммит 78f67d1f6f
67 изменённых файлов: 209 добавлений и 218 удалений

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

@ -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 "AndroidBridge.h"
#include "GeneratedJNIWrappers.h"
namespace mozilla {
namespace dom {
void StartGamepadMonitoring()
{
widget::GeckoAppShell::StartMonitoringGamepad();
java::GeckoAppShell::StartMonitoringGamepad();
}
void StopGamepadMonitoring()
{
widget::GeckoAppShell::StopMonitoringGamepad();
java::GeckoAppShell::StopMonitoringGamepad();
}
} // namespace dom

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

@ -2837,7 +2837,7 @@ ContentParent::RecvGetShowPasswordSetting(bool* showPassword)
#ifdef MOZ_WIDGET_ANDROID
NS_ASSERTION(AndroidBridge::Bridge() != nullptr, "AndroidBridge is not available");
*showPassword = mozilla::widget::GeckoAppShell::GetShowPasswordSetting();
*showPassword = java::GeckoAppShell::GetShowPasswordSetting();
#endif
return true;
}

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

@ -22,7 +22,6 @@
#endif
#ifdef MOZ_WIDGET_ANDROID
#include "nsIGfxInfo.h"
#include "AndroidBridge.h"
#endif
#include "mozilla/layers/LayersTypes.h"

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

@ -32,10 +32,6 @@
#include "gfxPlatform.h"
#include "mozilla/Snprintf.h"
#ifdef MOZ_WIDGET_ANDROID
#include "AndroidBridge.h"
#endif
struct JSContext;
class JSObject;

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

@ -35,7 +35,7 @@ static PRLogModuleInfo* AndroidDecoderModuleLog()
using namespace mozilla;
using namespace mozilla::gl;
using namespace mozilla::widget::sdk;
using namespace mozilla::java::sdk;
using media::TimeUnit;
namespace mozilla {
@ -179,9 +179,9 @@ public:
&buffer));
if (!buffer && aConfig.mCodecSpecificConfig->Length() >= 2) {
buffer = jni::Object::LocalRef::Adopt(
env, env->NewDirectByteBuffer(aConfig.mCodecSpecificConfig->Elements(),
aConfig.mCodecSpecificConfig->Length()));
buffer = jni::ByteBuffer::New(
aConfig.mCodecSpecificConfig->Elements(),
aConfig.mCodecSpecificConfig->Length());
NS_ENSURE_SUCCESS_VOID(aFormat->SetByteBuffer(NS_LITERAL_STRING("csd-0"),
buffer));
}
@ -277,7 +277,7 @@ AndroidDecoderModule::SupportsMimeType(const nsACString& aMimeType,
return false;
}
return widget::HardwareCodecCapabilityUtils::FindDecoderCodecInfoForMimeType(
return java::HardwareCodecCapabilityUtils::FindDecoderCodecInfoForMimeType(
nsCString(TranslateMimeType(aMimeType)));
}

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

@ -43,7 +43,7 @@ public:
MediaCodecDataDecoder(MediaData::Type aType,
const nsACString& aMimeType,
widget::sdk::MediaFormat::Param aFormat,
java::sdk::MediaFormat::Param aFormat,
MediaDataDecoderCallback* aCallback);
virtual ~MediaCodecDataDecoder();
@ -73,16 +73,16 @@ protected:
static const char* ModuleStateStr(ModuleState aState);
virtual nsresult InitDecoder(widget::sdk::Surface::Param aSurface);
virtual nsresult InitDecoder(java::sdk::Surface::Param aSurface);
virtual nsresult Output(widget::sdk::BufferInfo::Param aInfo, void* aBuffer,
widget::sdk::MediaFormat::Param aFormat, const media::TimeUnit& aDuration)
virtual nsresult Output(java::sdk::BufferInfo::Param aInfo, void* aBuffer,
java::sdk::MediaFormat::Param aFormat, const media::TimeUnit& aDuration)
{
return NS_OK;
}
virtual nsresult PostOutput(widget::sdk::BufferInfo::Param aInfo,
widget::sdk::MediaFormat::Param aFormat, const media::TimeUnit& aDuration)
virtual nsresult PostOutput(java::sdk::BufferInfo::Param aInfo,
java::sdk::MediaFormat::Param aFormat, const media::TimeUnit& aDuration)
{
return NS_OK;
}
@ -99,8 +99,8 @@ protected:
nsresult QueueEOS();
void HandleEOS(int32_t aOutputStatus);
Maybe<media::TimeUnit> GetOutputDuration();
nsresult ProcessOutput(widget::sdk::BufferInfo::Param aInfo,
widget::sdk::MediaFormat::Param aFormat,
nsresult ProcessOutput(java::sdk::BufferInfo::Param aInfo,
java::sdk::MediaFormat::Param aFormat,
int32_t aStatus);
ModuleState State() const;
// Sets decoder state and returns whether the new state has become effective.
@ -112,11 +112,11 @@ protected:
MediaData::Type mType;
nsAutoCString mMimeType;
widget::sdk::MediaFormat::GlobalRef mFormat;
java::sdk::MediaFormat::GlobalRef mFormat;
MediaDataDecoderCallback* mCallback;
widget::sdk::MediaCodec::GlobalRef mDecoder;
java::sdk::MediaCodec::GlobalRef mDecoder;
jni::ObjectArray::GlobalRef mInputBuffers;
jni::ObjectArray::GlobalRef mOutputBuffers;

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

@ -19,7 +19,6 @@
#include "nsIPrefBranch.h"
#ifdef MOZ_WIDGET_ANDROID
#include "AndroidBridge.h"
#include "nsISupportsUtils.h"
#endif

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

@ -10,7 +10,7 @@
namespace mozilla {
class SmsManager : public widget::GeckoSmsManager::Natives<SmsManager>
class SmsManager : public java::GeckoSmsManager::Natives<SmsManager>
{
private:
SmsManager();

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

@ -8,7 +8,6 @@
#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)

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

@ -5,7 +5,6 @@
// 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"

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

@ -5,13 +5,14 @@
#include "base/basictypes.h"
#include "assert.h"
#include "ANPBase.h"
#include <android/log.h>
#include "nsNPAPIPluginInstance.h"
#include "AndroidBridge.h"
#include "nsNPAPIPlugin.h"
#include "GeneratedJNIWrappers.h"
#include "PluginPRLibrary.h"
#include "assert.h"
#include "nsNPAPIPluginInstance.h"
#include "nsNPAPIPlugin.h"
#include <android/log.h>
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
#define ASSIGN(obj, name) (obj)->name = anp_system_##name
@ -60,7 +61,7 @@ jclass anp_system_loadJavaClass(NPP instance, const char* className)
nsCString libName;
lib->GetLibraryPath(libName);
return mozilla::widget::GeckoAppShell::LoadPluginClass(className, libName).Forget();
return mozilla::java::GeckoAppShell::LoadPluginClass(className, libName).Forget();
}
void anp_system_setPowerState(NPP instance, ANPPowerState powerState)

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

@ -3,7 +3,6 @@
* 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"

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

@ -7,7 +7,6 @@
#include "assert.h"
#include "ANPBase.h"
#include <android/log.h>
#include "AndroidBridge.h"
#include "nsNPAPIPluginInstance.h"
#include "nsPluginInstanceOwner.h"
#include "nsWindow.h"

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

@ -101,7 +101,7 @@ using mozilla::plugins::PluginModuleContentParent;
#include <android/log.h>
#include "android_npapi.h"
#include "ANPBase.h"
#include "AndroidBridge.h"
#include "GeneratedJNIWrappers.h"
#undef LOG
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
#endif
@ -2115,7 +2115,7 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
case kJavaContext_ANPGetValue: {
LOG("get java context");
auto ret = widget::GeckoAppShell::GetContext();
auto ret = java::GeckoAppShell::GetContext();
if (!ret)
return NPERR_GENERIC_ERROR;

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

@ -788,7 +788,7 @@ void nsNPAPIPluginInstance::NotifyFullScreen(bool aFullScreen)
SendLifecycleEvent(this, mFullScreen ? kEnterFullScreen_ANPLifecycleAction : kExitFullScreen_ANPLifecycleAction);
if (mFullScreen && mFullScreenOrientation != dom::eScreenOrientation_None) {
widget::GeckoAppShell::LockScreenOrientation(mFullScreenOrientation);
java::GeckoAppShell::LockScreenOrientation(mFullScreenOrientation);
}
}
@ -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) {
widget::GeckoAppShell::LockScreenOrientation(mFullScreenOrientation);
java::GeckoAppShell::LockScreenOrientation(mFullScreenOrientation);
} else if (oldOrientation != dom::eScreenOrientation_None) {
// We applied an orientation when we entered fullscreen, but
// we don't want it anymore
widget::GeckoAppShell::UnlockScreenOrientation();
java::GeckoAppShell::UnlockScreenOrientation();
}
}
}

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

@ -1559,7 +1559,7 @@ void nsPluginInstanceOwner::RemovePluginView()
if (!mInstance || !mJavaView)
return;
widget::GeckoAppShell::RemovePluginView(
java::GeckoAppShell::RemovePluginView(
jni::Object::Ref::From(jobject(mJavaView)), mFullScreen);
jni::GetGeckoThreadEnv()->DeleteGlobalRef((jobject)mJavaView);
mJavaView = nullptr;

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

@ -6,8 +6,8 @@
#include "nsGeolocation.h"
#include "nsGeoPosition.h"
#include "AndroidBridge.h"
#include "AndroidLocationProvider.h"
#include "GeneratedJNIWrappers.h"
using namespace mozilla;
@ -27,7 +27,7 @@ AndroidLocationProvider::~AndroidLocationProvider()
NS_IMETHODIMP
AndroidLocationProvider::Startup()
{
widget::GeckoAppShell::EnableLocation(true);
java::GeckoAppShell::EnableLocation(true);
return NS_OK;
}
@ -43,13 +43,13 @@ AndroidLocationProvider::Watch(nsIGeolocationUpdate* aCallback)
NS_IMETHODIMP
AndroidLocationProvider::Shutdown()
{
widget::GeckoAppShell::EnableLocation(false);
java::GeckoAppShell::EnableLocation(false);
return NS_OK;
}
NS_IMETHODIMP
AndroidLocationProvider::SetHighAccuracy(bool enable)
{
widget::GeckoAppShell::EnableLocationHighAccuracy(enable);
java::GeckoAppShell::EnableLocationHighAccuracy(enable);
return NS_OK;
}

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

@ -6,7 +6,7 @@
#include "mozilla/dom/ContentChild.h"
#include "nsHapticFeedback.h"
#include "AndroidBridge.h"
#include "GeneratedJNIWrappers.h"
using namespace mozilla;
@ -15,6 +15,6 @@ NS_IMPL_ISUPPORTS(nsHapticFeedback, nsIHapticFeedback)
NS_IMETHODIMP
nsHapticFeedback::PerformSimpleAction(int32_t aType)
{
widget::GeckoAppShell::PerformHapticFeedback(aType == LongPress);
java::GeckoAppShell::PerformHapticFeedback(aType == LongPress);
return NS_OK;
}

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

@ -20,8 +20,8 @@
using namespace mozilla;
using namespace mozilla::jni;
using namespace mozilla::widget;
using namespace mozilla::widget::sdk;
using namespace mozilla::java;
using namespace mozilla::java::sdk;
namespace mozilla {
namespace gl {

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

@ -83,7 +83,7 @@ public:
void NotifyFrameAvailable();
GLuint Texture() const { return mTexture; }
const widget::sdk::Surface::Ref& JavaSurface() const { return mSurface; }
const java::sdk::Surface::Ref& JavaSurface() const { return mSurface; }
private:
AndroidSurfaceTexture();
@ -92,8 +92,8 @@ private:
bool Init(GLContext* aContext, GLuint aTexture);
GLuint mTexture;
widget::sdk::SurfaceTexture::GlobalRef mSurfaceTexture;
widget::sdk::Surface::GlobalRef mSurface;
java::sdk::SurfaceTexture::GlobalRef mSurfaceTexture;
java::sdk::Surface::GlobalRef mSurface;
GLContext* mAttachedContext;

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

@ -21,8 +21,10 @@ namespace mozilla {
namespace layers {
AndroidSpecificState::AndroidSpecificState() {
widget::sdk::ViewConfiguration::LocalRef config;
if (widget::sdk::ViewConfiguration::Get(widget::GeckoAppShell::GetApplicationContext(), &config) == NS_OK) {
using namespace mozilla::java;
sdk::ViewConfiguration::LocalRef config;
if (sdk::ViewConfiguration::Get(GeckoAppShell::GetApplicationContext(), &config) == NS_OK) {
int32_t speed = 0;
if (config->GetScaledMaximumFlingVelocity(&speed) == NS_OK) {
sMaxFlingSpeed = (float)speed * 0.001f;
@ -32,8 +34,9 @@ AndroidSpecificState::AndroidSpecificState() {
} else {
ANDROID_APZ_LOG("%p Failed to get ViewConfiguration\n", this);
}
widget::StackScroller::LocalRef scroller;
if (widget::StackScroller::New(widget::GeckoAppShell::GetApplicationContext(), &scroller) != NS_OK) {
StackScroller::LocalRef scroller;
if (StackScroller::New(GeckoAppShell::GetApplicationContext(), &scroller) != NS_OK) {
ANDROID_APZ_LOG("%p Failed to create Android StackScroller\n", this);
return;
}

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

@ -22,7 +22,7 @@ public:
return this;
}
widget::StackScroller::GlobalRef mOverScroller;
java::StackScroller::GlobalRef mOverScroller;
};
class AndroidFlingAnimation: public AsyncPanZoomAnimation {
@ -40,7 +40,7 @@ private:
bool CheckBounds(Axis& aAxis, float aValue, float aDirection, float* aClamped);
AsyncPanZoomController& mApzc;
widget::StackScroller::GlobalRef mOverScroller;
java::StackScroller::GlobalRef mOverScroller;
RefPtr<const OverscrollHandoffChain> mOverscrollHandoffChain;
RefPtr<const AsyncPanZoomController> mScrolledApzc;
bool mSentBounceX;

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

@ -89,10 +89,6 @@
#include "nsScreenManagerGonk.h"
#endif
#ifdef MOZ_ANDROID_APZ
#include "AndroidBridge.h"
#endif
#include "LayerScope.h"
namespace mozilla {

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

@ -25,10 +25,6 @@
#include "cairo.h"
#include "VsyncSource.h"
#ifdef MOZ_WIDGET_ANDROID
#include "AndroidBridge.h"
#endif
#ifdef MOZ_WIDGET_GONK
#include <cutils/properties.h>
#include "mozilla/layers/CompositorBridgeParent.h"

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

@ -4,15 +4,15 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "Hal.h"
#include "AndroidBridge.h"
#include "GeneratedJNINatives.h"
#include "GeneratedJNIWrappers.h"
using namespace mozilla::hal;
namespace mozilla {
class AlarmReceiver : public widget::AlarmReceiver::Natives<AlarmReceiver>
class AlarmReceiver : public java::AlarmReceiver::Natives<AlarmReceiver>
{
private:
AlarmReceiver();
@ -38,13 +38,13 @@ EnableAlarm()
void
DisableAlarm()
{
widget::GeckoAppShell::DisableAlarm();
java::GeckoAppShell::DisableAlarm();
}
bool
SetAlarm(int32_t aSeconds, int32_t aNanoseconds)
{
return widget::GeckoAppShell::SetAlarm(aSeconds, aNanoseconds);
return java::GeckoAppShell::SetAlarm(aSeconds, aNanoseconds);
}
} // hal_impl

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

@ -15,6 +15,8 @@
using namespace mozilla::dom;
using namespace mozilla::hal;
namespace java = mozilla::java;
namespace mozilla {
namespace hal_impl {
@ -54,19 +56,19 @@ CancelVibrate(const WindowIdentifier &)
{
// Ignore WindowIdentifier parameter.
mozilla::widget::GeckoAppShell::CancelVibrate();
java::GeckoAppShell::CancelVibrate();
}
void
EnableBatteryNotifications()
{
mozilla::widget::GeckoAppShell::EnableBatteryNotifications();
java::GeckoAppShell::EnableBatteryNotifications();
}
void
DisableBatteryNotifications()
{
mozilla::widget::GeckoAppShell::DisableBatteryNotifications();
java::GeckoAppShell::DisableBatteryNotifications();
}
void
@ -78,13 +80,13 @@ GetCurrentBatteryInformation(hal::BatteryInformation* aBatteryInfo)
void
EnableNetworkNotifications()
{
mozilla::widget::GeckoAppShell::EnableNetworkNotifications();
java::GeckoAppShell::EnableNetworkNotifications();
}
void
DisableNetworkNotifications()
{
mozilla::widget::GeckoAppShell::DisableNetworkNotifications();
java::GeckoAppShell::DisableNetworkNotifications();
}
void
@ -96,13 +98,13 @@ GetCurrentNetworkInformation(hal::NetworkInformation* aNetworkInfo)
void
EnableScreenConfigurationNotifications()
{
mozilla::widget::GeckoAppShell::EnableScreenOrientationNotifications();
java::GeckoAppShell::EnableScreenOrientationNotifications();
}
void
DisableScreenConfigurationNotifications()
{
mozilla::widget::GeckoAppShell::DisableScreenOrientationNotifications();
java::GeckoAppShell::DisableScreenOrientationNotifications();
}
void
@ -155,7 +157,7 @@ LockScreenOrientation(const ScreenOrientationInternal& aOrientation)
case eScreenOrientation_LandscapeSecondary:
case eScreenOrientation_LandscapePrimary | eScreenOrientation_LandscapeSecondary:
case eScreenOrientation_Default:
mozilla::widget::GeckoAppShell::LockScreenOrientation(orientation);
java::GeckoAppShell::LockScreenOrientation(orientation);
return true;
default:
return false;
@ -165,7 +167,7 @@ LockScreenOrientation(const ScreenOrientationInternal& aOrientation)
void
UnlockScreenOrientation()
{
mozilla::widget::GeckoAppShell::UnlockScreenOrientation();
java::GeckoAppShell::UnlockScreenOrientation();
}
} // hal_impl

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

@ -4,7 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "Hal.h"
#include "AndroidBridge.h"
#include "GeneratedJNIWrappers.h"
using namespace mozilla::hal;
@ -13,12 +13,12 @@ namespace hal_impl {
void
EnableSensorNotifications(SensorType aSensor) {
widget::GeckoAppShell::EnableSensor(aSensor);
java::GeckoAppShell::EnableSensor(aSensor);
}
void
DisableSensorNotifications(SensorType aSensor) {
widget::GeckoAppShell::DisableSensor(aSensor);
java::GeckoAppShell::DisableSensor(aSensor);
}
} // hal_impl

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

@ -26,7 +26,7 @@
#include <webrtc/common_video/libyuv/include/webrtc_libyuv.h>
using namespace mozilla;
using namespace mozilla::widget::sdk;
using namespace mozilla::java::sdk;
static const int32_t DECODER_TIMEOUT = 10 * PR_USEC_PER_MSEC; // 10ms
static const char MEDIACODEC_VIDEO_MIME_VP8[] = "video/x-vnd.on2.vp8";

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

@ -5,10 +5,10 @@
#include "nsThreadUtils.h"
#include "nsAndroidHistory.h"
#include "nsComponentManagerUtils.h"
#include "AndroidBridge.h"
#include "Link.h"
#include "nsIURI.h"
#include "nsIObserverService.h"
#include "GeneratedJNIWrappers.h"
#include "Link.h"
#include "mozilla/Services.h"
#include "mozilla/Preferences.h"
@ -77,7 +77,7 @@ nsAndroidHistory::RegisterVisitedCallback(nsIURI *aURI, Link *aContent)
list->AppendElement(aContent);
if (jni::IsAvailable()) {
widget::GeckoAppShell::CheckURIVisited(uriString);
java::GeckoAppShell::CheckURIVisited(uriString);
}
return NS_OK;
@ -203,7 +203,7 @@ nsAndroidHistory::SaveVisitURI(nsIURI* aURI) {
// Save this URI in our history
nsAutoCString spec;
(void)aURI->GetSpec(spec);
widget::GeckoAppShell::MarkURIVisited(NS_ConvertUTF8toUTF16(spec));
java::GeckoAppShell::MarkURIVisited(NS_ConvertUTF8toUTF16(spec));
}
// Finally, notify that we've been visited.
@ -292,7 +292,7 @@ nsAndroidHistory::SetURITitle(nsIURI *aURI, const nsAString& aTitle)
SaveVisitURI(aURI);
}
NS_ConvertUTF8toUTF16 uriString(uri);
widget::GeckoAppShell::SetURITitle(uriString, aTitle);
java::GeckoAppShell::SetURITitle(uriString, aTitle);
}
return NS_OK;
}

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

@ -6,7 +6,7 @@
#include "nsShellService.h"
#include "nsString.h"
#include "AndroidBridge.h"
#include "GeneratedJNIWrappers.h"
using namespace mozilla;
@ -25,6 +25,6 @@ nsShellService::CreateShortcut(const nsAString& aTitle, const nsAString& aURI,
if (!aTitle.Length() || !aURI.Length())
return NS_ERROR_FAILURE;
widget::GeckoAppShell::CreateShortcut(aTitle, aURI);
java::GeckoAppShell::CreateShortcut(aTitle, aURI);
return NS_OK;
}

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

@ -60,7 +60,7 @@ Tickler::Init()
MOZ_ASSERT(!mFD);
if (jni::IsAvailable()) {
widget::GeckoAppShell::EnableNetworkNotifications();
java::GeckoAppShell::EnableNetworkNotifications();
}
mFD = PR_OpenUDPSocket(PR_AF_INET);

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

@ -6,7 +6,6 @@
#include "base/basictypes.h"
#include "AndroidCaptureProvider.h"
#include "nsXULAppAPI.h"
#include "AndroidBridge.h"
#include "nsStreamUtils.h"
#include "nsThreadUtils.h"
#include "nsMemory.h"

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

@ -90,7 +90,7 @@ bool CameraStreamImpl::Init(const nsCString& contentType, const uint32_t& camera
}
void CameraStreamImpl::Close() {
mozilla::widget::GeckoAppShell::CloseCamera();
java::GeckoAppShell::CloseCamera();
mCallback = nullptr;
}

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

@ -10,6 +10,8 @@
#include "AndroidBridge.h"
namespace java = mozilla::java;
NS_IMPL_ISUPPORTS(nsAndroidNetworkLinkService,
nsINetworkLinkService)
@ -31,7 +33,7 @@ nsAndroidNetworkLinkService::GetIsLinkUp(bool *aIsUp)
return NS_OK;
}
*aIsUp = mozilla::widget::GeckoAppShell::IsNetworkLinkUp();
*aIsUp = java::GeckoAppShell::IsNetworkLinkUp();
return NS_OK;
}
@ -40,7 +42,7 @@ nsAndroidNetworkLinkService::GetLinkStatusKnown(bool *aIsKnown)
{
NS_ENSURE_TRUE(mozilla::AndroidBridge::Bridge(), NS_ERROR_NOT_IMPLEMENTED);
*aIsKnown = mozilla::widget::GeckoAppShell::IsNetworkLinkKnown();
*aIsKnown = java::GeckoAppShell::IsNetworkLinkKnown();
return NS_OK;
}
@ -56,6 +58,6 @@ nsAndroidNetworkLinkService::GetLinkType(uint32_t *aLinkType)
return NS_OK;
}
*aLinkType = mozilla::widget::GeckoAppShell::NetworkLinkType();
*aLinkType = java::GeckoAppShell::NetworkLinkType();
return NS_OK;
}

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

@ -297,7 +297,7 @@ NS_IMETHODIMP nsAlertsService::CloseAlert(const nsAString& aAlertName,
}
#ifdef MOZ_WIDGET_ANDROID
widget::GeckoAppShell::CloseNotification(aAlertName);
java::GeckoAppShell::CloseNotification(aAlertName);
return NS_OK;
#else
@ -354,9 +354,8 @@ NS_IMETHODIMP nsAlertsService::OnProgress(const nsAString & aAlertName,
const nsAString & aAlertText)
{
#ifdef MOZ_WIDGET_ANDROID
widget::GeckoAppShell::AlertsProgressListener_OnProgress(aAlertName,
aProgress, aProgressMax,
aAlertText);
java::GeckoAppShell::AlertsProgressListener_OnProgress(
aAlertName, aProgress, aProgressMax, aAlertText);
return NS_OK;
#else
return NS_ERROR_NOT_IMPLEMENTED;
@ -366,7 +365,7 @@ NS_IMETHODIMP nsAlertsService::OnProgress(const nsAString & aAlertName,
NS_IMETHODIMP nsAlertsService::OnCancel(const nsAString & aAlertName)
{
#ifdef MOZ_WIDGET_ANDROID
widget::GeckoAppShell::CloseNotification(aAlertName);
java::GeckoAppShell::CloseNotification(aAlertName);
return NS_OK;
#else
return NS_ERROR_NOT_IMPLEMENTED;

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

@ -61,7 +61,7 @@
#endif
#ifdef MOZ_WIDGET_ANDROID
#include "AndroidBridge.h"
#include "GeneratedJNIWrappers.h"
#endif
#ifdef MOZ_WIDGET_GTK
@ -2791,7 +2791,7 @@ nsDownload::SetState(DownloadState aState)
if (mimeInfo)
mimeInfo->GetMIMEType(contentType);
mozilla::widget::DownloadsIntegration::ScanMedia(path, NS_ConvertUTF8toUTF16(contentType));
java::DownloadsIntegration::ScanMedia(path, NS_ConvertUTF8toUTF16(contentType));
}
#else
if (addToRecentDocs && !mPrivate) {

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

@ -27,7 +27,7 @@
#endif
#ifdef MOZ_WIDGET_ANDROID
#include "AndroidBridge.h"
#include "GeneratedJNIWrappers.h"
#endif
#ifdef MOZ_WIDGET_GTK
@ -84,7 +84,7 @@ nsresult DownloadPlatform::DownloadDone(nsIURI* aSource, nsIFile* aTarget,
bool addToRecentDocs = Preferences::GetBool(PREF_BDM_ADDTORECENTDOCS);
#ifdef MOZ_WIDGET_ANDROID
if (addToRecentDocs) {
mozilla::widget::DownloadsIntegration::ScanMedia(path, NS_ConvertUTF8toUTF16(aContentType));
java::DownloadsIntegration::ScanMedia(path, NS_ConvertUTF8toUTF16(aContentType));
}
#else
if (addToRecentDocs && !aIsPrivate) {

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

@ -4,9 +4,11 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsParentalControlsService.h"
#include "AndroidBridge.h"
#include "nsString.h"
#include "nsIFile.h"
#include "GeneratedJNIWrappers.h"
namespace java = mozilla::java;
NS_IMPL_ISUPPORTS(nsParentalControlsService, nsIParentalControlsService)
@ -14,7 +16,7 @@ nsParentalControlsService::nsParentalControlsService() :
mEnabled(false)
{
if (mozilla::jni::IsAvailable()) {
mEnabled = mozilla::widget::Restrictions::IsUserRestricted();
mEnabled = java::Restrictions::IsUserRestricted();
}
}
@ -92,7 +94,7 @@ nsParentalControlsService::IsAllowed(int16_t aAction,
NS_ENSURE_SUCCESS(rv, rv);
}
*_retval = mozilla::widget::Restrictions::IsAllowed(aAction,
*_retval = java::Restrictions::IsAllowed(aAction,
NS_ConvertUTF8toUTF16(url));
return rv;
}

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

@ -199,7 +199,7 @@
#endif
#ifdef MOZ_WIDGET_ANDROID
#include "AndroidBridge.h"
#include "GeneratedJNIWrappers.h"
#endif
#if defined(MOZ_SANDBOX)
@ -1720,7 +1720,7 @@ static nsresult LaunchChild(nsINativeAppSupport* aNative,
SaveToEnv("MOZ_LAUNCHED_CHILD=1");
#if defined(MOZ_WIDGET_ANDROID)
mozilla::widget::GeckoAppShell::ScheduleRestart();
java::GeckoAppShell::ScheduleRestart();
#else
#if defined(XP_MACOSX)
CommandLineServiceMac::SetupMacCommandLine(gRestartArgc, gRestartArgv, true);
@ -1858,7 +1858,7 @@ ProfileLockedDialog(nsIFile* aProfileDir, nsIFile* aProfileLocalDir,
if (aUnlocker) {
int32_t button;
#ifdef MOZ_WIDGET_ANDROID
mozilla::widget::GeckoAppShell::KillAnyZombies();
java::GeckoAppShell::KillAnyZombies();
button = 0;
#else
const uint32_t flags =
@ -1887,7 +1887,7 @@ ProfileLockedDialog(nsIFile* aProfileDir, nsIFile* aProfileLocalDir,
}
} else {
#ifdef MOZ_WIDGET_ANDROID
if (mozilla::widget::GeckoAppShell::UnlockProfile()) {
if (java::GeckoAppShell::UnlockProfile()) {
return NS_LockProfilePath(aProfileDir, aProfileLocalDir,
nullptr, aResult);
}

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

@ -485,7 +485,7 @@ void BuildJavaThreadJSObject(SpliceableJSONWriter& aWriter)
firstRun = false;
double sampleTime =
mozilla::widget::GeckoJavaSampler::GetSampleTimeJavaProfiling(0, sampleId);
java::GeckoJavaSampler::GetSampleTimeJavaProfiling(0, sampleId);
aWriter.StartObjectElement();
aWriter.DoubleProperty("time", sampleTime);
@ -562,7 +562,7 @@ void GeckoSampler::StreamJSON(SpliceableJSONWriter& aWriter, double aSinceTime)
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
if (ProfileJava()) {
mozilla::widget::GeckoJavaSampler::PauseJavaProfiling();
java::GeckoJavaSampler::PauseJavaProfiling();
aWriter.Start();
{
@ -570,7 +570,7 @@ void GeckoSampler::StreamJSON(SpliceableJSONWriter& aWriter, double aSinceTime)
}
aWriter.End();
mozilla::widget::GeckoJavaSampler::UnpauseJavaProfiling();
java::GeckoJavaSampler::UnpauseJavaProfiling();
}
#endif
#endif

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

@ -36,7 +36,7 @@
#endif
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
#include "AndroidBridge.h"
#include "GeneratedJNIWrappers.h"
#endif
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
@ -52,7 +52,7 @@
#endif
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
class GeckoJavaSampler : public widget::GeckoJavaSampler::Natives<GeckoJavaSampler>
class GeckoJavaSampler : public java::GeckoJavaSampler::Natives<GeckoJavaSampler>
{
private:
GeckoJavaSampler();
@ -825,7 +825,7 @@ void mozilla_sampler_start(int aProfileEntries, double aInterval,
if (javaInterval < 10) {
aInterval = 10;
}
mozilla::widget::GeckoJavaSampler::StartJavaProfiling(javaInterval, 1000);
java::GeckoJavaSampler::StartJavaProfiling(javaInterval, 1000);
}
#endif

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

@ -4,7 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsAndroidHandlerApp.h"
#include "AndroidBridge.h"
#include "GeneratedJNIWrappers.h"
using namespace mozilla;
@ -76,7 +76,7 @@ nsAndroidHandlerApp::LaunchWithURI(nsIURI *aURI, nsIInterfaceRequestor *aWindowC
{
nsCString uriSpec;
aURI->GetSpec(uriSpec);
return widget::GeckoAppShell::OpenUriExternal(
return java::GeckoAppShell::OpenUriExternal(
uriSpec, mMimeType, mPackageName, mClassName,
mAction, EmptyString()) ? NS_OK : NS_ERROR_FAILURE;
}
@ -84,7 +84,7 @@ nsAndroidHandlerApp::LaunchWithURI(nsIURI *aURI, nsIInterfaceRequestor *aWindowC
NS_IMETHODIMP
nsAndroidHandlerApp::Share(const nsAString & data, const nsAString & title)
{
return widget::GeckoAppShell::OpenUriExternal(
return java::GeckoAppShell::OpenUriExternal(
data, mMimeType, mPackageName, mClassName,
mAction, EmptyString()) ? NS_OK : NS_ERROR_FAILURE;
}

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

@ -31,7 +31,7 @@ nsExternalSharingAppService::ShareWithDefault(const nsAString & data,
{
NS_NAMED_LITERAL_STRING(sendAction, "android.intent.action.SEND");
const nsString emptyString = EmptyString();
return widget::GeckoAppShell::OpenUriExternal(data,
return java::GeckoAppShell::OpenUriExternal(data,
mime, emptyString, emptyString, sendAction, title) ? NS_OK : NS_ERROR_FAILURE;
}

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

@ -36,7 +36,7 @@ nsMIMEInfoAndroid::LoadUriInternal(nsIURI * aURI)
mimeType = NS_ConvertUTF8toUTF16(mType);
}
if (widget::GeckoAppShell::OpenUriExternal(
if (java::GeckoAppShell::OpenUriExternal(
NS_ConvertUTF8toUTF16(uriSpec), mimeType, EmptyString(),
EmptyString(), EmptyString(), EmptyString())) {
return NS_OK;

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

@ -100,7 +100,7 @@
#endif
#ifdef MOZ_WIDGET_ANDROID
#include "AndroidBridge.h"
#include "GeneratedJNIWrappers.h"
#endif
#include "mozilla/Preferences.h"
@ -382,7 +382,7 @@ static nsresult GetDownloadDirectory(nsIFile **_directory,
// In the case where we do not have the permission we will start the
// download to the app cache directory and later move it to the final
// destination after prompting for the permission.
auto downloadDir = widget::DownloadsIntegration::GetTemporaryDownloadDirectory();
auto downloadDir = java::DownloadsIntegration::GetTemporaryDownloadDirectory();
nsresult rv;
if (downloadDir) {

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

@ -10,7 +10,7 @@
namespace mozilla {
class ANRReporter : public widget::ANRReporter::Natives<ANRReporter>
class ANRReporter : public java::ANRReporter::Natives<ANRReporter>
{
private:
ANRReporter();

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

@ -57,7 +57,7 @@
using namespace mozilla;
using namespace mozilla::gfx;
using namespace mozilla::jni;
using namespace mozilla::widget;
using namespace mozilla::java;
AndroidBridge* AndroidBridge::sBridge = nullptr;
pthread_t AndroidBridge::sJavaUiThread;
@ -199,12 +199,12 @@ AndroidBridge::AndroidBridge()
JNIEnv* const jEnv = jni::GetGeckoThreadEnv();
AutoLocalJNIFrame jniFrame(jEnv);
mClassLoader = Object::GlobalRef(jEnv, widget::GeckoThread::ClsLoader());
mClassLoader = Object::GlobalRef(jEnv, java::GeckoThread::ClsLoader());
mClassLoaderLoadClass = GetMethodID(
jEnv, jEnv->GetObjectClass(mClassLoader.Get()),
"loadClass", "(Ljava/lang/String;)Ljava/lang/Class;");
mMessageQueue = widget::GeckoThread::MsgQueue();
mMessageQueue = java::GeckoThread::MsgQueue();
auto msgQueueClass = Class::LocalRef::Adopt(
jEnv, jEnv->GetObjectClass(mMessageQueue.Get()));
// mMessageQueueNext must not be null
@ -925,7 +925,7 @@ AndroidBridge::HandleGeckoMessage(JSContext* cx, JS::HandleObject object)
{
ALOG_BRIDGE("%s", __PRETTY_FUNCTION__);
auto message = mozilla::widget::CreateNativeJSContainer(cx, object);
auto message = widget::CreateNativeJSContainer(cx, object);
GeckoAppShell::HandleGeckoMessageWrapper(message);
}

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

@ -155,8 +155,8 @@ public:
bool ProgressiveUpdateCallback(bool aHasPendingNewThebesContent, const LayerRect& aDisplayPort, float aDisplayResolution, bool aDrawingCritical,
mozilla::ParentLayerPoint& aScrollOffset, mozilla::CSSToParentLayerScale& aZoom);
void SetLayerClient(widget::GeckoLayerClient::Param jobj);
const widget::GeckoLayerClient::Ref& GetLayerClient() { return mLayerClient; }
void SetLayerClient(java::GeckoLayerClient::Param jobj);
const java::GeckoLayerClient::Ref& GetLayerClient() { return mLayerClient; }
bool GetHandlersForURL(const nsAString& aURL,
nsIMutableArray* handlersArray = nullptr,
@ -341,7 +341,7 @@ protected:
nsTArray<nsCOMPtr<nsIMobileMessageCallback>> mSmsRequests;
nsTArray<nsCOMPtr<nsIMobileMessageCursorCallback>> mSmsCursorRequests;
widget::GeckoLayerClient::GlobalRef mLayerClient;
java::GeckoLayerClient::GlobalRef mLayerClient;
// the android.telephony.SmsMessage class
jclass mAndroidSmsMessageClass;

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

@ -16,7 +16,7 @@
namespace mozilla {
class GeckoNetworkManager final
: public widget::GeckoNetworkManager::Natives<GeckoNetworkManager>
: public java::GeckoNetworkManager::Natives<GeckoNetworkManager>
, public UsesGeckoThreadProxy
{
GeckoNetworkManager() = delete;

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

@ -17,7 +17,7 @@
namespace mozilla {
class GeckoScreenOrientation final
: public widget::GeckoScreenOrientation::Natives<GeckoScreenOrientation>
: public java::GeckoScreenOrientation::Natives<GeckoScreenOrientation>
, public UsesGeckoThreadProxy
{
GeckoScreenOrientation() = delete;

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

@ -11,7 +11,7 @@
#include "mozilla/jni/Natives.h"
namespace mozilla {
namespace widget {
namespace java {
template<class Impl>
class ANRReporter::Natives : public mozilla::jni::NativeImpl<ANRReporter, Impl>

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

@ -8,7 +8,7 @@
#include "mozilla/jni/Accessors.h"
namespace mozilla {
namespace widget {
namespace java {
const char ANRReporter::name[] =
"org/mozilla/gecko/ANRReporter";

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

@ -10,7 +10,7 @@
#include "mozilla/jni/Refs.h"
namespace mozilla {
namespace widget {
namespace java {
class ANRReporter : public mozilla::jni::ObjectBase<ANRReporter, jobject>
{

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

@ -12,8 +12,8 @@
namespace mozilla {
namespace widget {
NativeJSContainer::LocalRef CreateNativeJSContainer(
JSContext* cx, JS::HandleObject object);
java::NativeJSContainer::LocalRef
CreateNativeJSContainer(JSContext* cx, JS::HandleObject object);
} // namespace widget
} // namespace mozilla

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

@ -20,7 +20,7 @@
namespace mozilla {
class PrefsHelper
: public widget::PrefsHelper::Natives<PrefsHelper>
: public java::PrefsHelper::Natives<PrefsHelper>
, public UsesGeckoThreadProxy
{
PrefsHelper() = delete;
@ -40,26 +40,26 @@ class PrefsHelper
return false;
}
int32_t type = widget::PrefsHelper::PREF_INVALID;
int32_t type = java::PrefsHelper::PREF_INVALID;
bool boolVal = false;
int32_t intVal = 0;
nsAutoString strVal;
switch (varType) {
case nsIDataType::VTYPE_BOOL:
type = widget::PrefsHelper::PREF_BOOL;
type = java::PrefsHelper::PREF_BOOL;
if (NS_FAILED(aVariant->GetAsBool(&boolVal))) {
return false;
}
break;
case nsIDataType::VTYPE_INT32:
type = widget::PrefsHelper::PREF_INT;
type = java::PrefsHelper::PREF_INT;
if (NS_FAILED(aVariant->GetAsInt32(&intVal))) {
return false;
}
break;
case nsIDataType::VTYPE_ASTRING:
type = widget::PrefsHelper::PREF_STRING;
type = java::PrefsHelper::PREF_STRING;
if (NS_FAILED(aVariant->GetAsAString(strVal))) {
return false;
}
@ -70,16 +70,17 @@ class PrefsHelper
Maybe<jni::StringParam> jstrVal;
jstrVal.emplace(nullptr);
if (type == widget::PrefsHelper::PREF_STRING) {
if (type == java::PrefsHelper::PREF_STRING) {
jstrVal.reset();
jstrVal.emplace(strVal, aPrefName.Env());
}
if (aPrefHandler) {
widget::PrefsHelper::CallPrefHandler(
aPrefHandler, type, aPrefName, boolVal, intVal, jstrVal.ref());
java::PrefsHelper::CallPrefHandler(
aPrefHandler, type, aPrefName,
boolVal, intVal, jstrVal.ref());
} else {
widget::PrefsHelper::OnPrefChange(
java::PrefsHelper::OnPrefChange(
aPrefName, type, boolVal, intVal, jstrVal.ref());
}
return true;
@ -97,13 +98,13 @@ class PrefsHelper
nsresult rv = NS_ERROR_FAILURE;
switch (aType) {
case widget::PrefsHelper::PREF_BOOL:
case java::PrefsHelper::PREF_BOOL:
rv = aVariant->SetAsBool(aBoolVal);
break;
case widget::PrefsHelper::PREF_INT:
case java::PrefsHelper::PREF_INT:
rv = aVariant->SetAsInt32(aIntVal);
break;
case widget::PrefsHelper::PREF_STRING:
case java::PrefsHelper::PREF_STRING:
rv = aVariant->SetAsAString(aStrVal->ToString());
break;
}
@ -149,23 +150,23 @@ public:
jni::String::LocalRef nameStr(mozilla::Move(nameRef));
const nsCString& name = nameStr->ToCString();
int32_t type = widget::PrefsHelper::PREF_INVALID;
int32_t type = java::PrefsHelper::PREF_INVALID;
bool boolVal = false;
int32_t intVal = 0;
switch (Preferences::GetType(name.get())) {
case nsIPrefBranch::PREF_BOOL:
type = widget::PrefsHelper::PREF_BOOL;
type = java::PrefsHelper::PREF_BOOL;
boolVal = Preferences::GetBool(name.get());
break;
case nsIPrefBranch::PREF_INT:
type = widget::PrefsHelper::PREF_INT;
type = java::PrefsHelper::PREF_INT;
intVal = Preferences::GetInt(name.get());
break;
case nsIPrefBranch::PREF_STRING:
type = widget::PrefsHelper::PREF_STRING;
type = java::PrefsHelper::PREF_STRING;
strVal = Preferences::GetLocalizedString(name.get());
if (!strVal) {
strVal = Preferences::GetString(name.get());
@ -195,17 +196,18 @@ public:
Maybe<jni::StringParam> jstrVal;
jstrVal.emplace(nullptr);
if (type == widget::PrefsHelper::PREF_STRING) {
if (type == java::PrefsHelper::PREF_STRING) {
jstrVal.reset();
jstrVal.emplace(strVal, aCls.Env());
}
widget::PrefsHelper::CallPrefHandler(
aPrefHandler, type, nameStr, boolVal, intVal, jstrVal.ref());
java::PrefsHelper::CallPrefHandler(
aPrefHandler, type, nameStr,
boolVal, intVal, jstrVal.ref());
}
widget::PrefsHelper::CallPrefHandler(
aPrefHandler, widget::PrefsHelper::PREF_FINISH,
java::PrefsHelper::CallPrefHandler(
aPrefHandler, java::PrefsHelper::PREF_FINISH,
nullptr, false, 0, nullptr);
}
@ -233,13 +235,13 @@ public:
}
switch (aType) {
case widget::PrefsHelper::PREF_BOOL:
case java::PrefsHelper::PREF_BOOL:
Preferences::SetBool(name.get(), aBoolVal);
break;
case widget::PrefsHelper::PREF_INT:
case java::PrefsHelper::PREF_INT:
Preferences::SetInt(name.get(), aIntVal);
break;
case widget::PrefsHelper::PREF_STRING:
case java::PrefsHelper::PREF_STRING:
Preferences::SetString(name.get(), aStrVal->ToString());
break;
default:
@ -301,15 +303,15 @@ public:
switch (Preferences::GetType(name.get())) {
case nsIPrefBranch::PREF_BOOL:
type = widget::PrefsHelper::PREF_BOOL;
type = java::PrefsHelper::PREF_BOOL;
boolVal = Preferences::GetBool(name.get());
break;
case nsIPrefBranch::PREF_INT:
type = widget::PrefsHelper::PREF_INT;
type = java::PrefsHelper::PREF_INT;
intVal = Preferences::GetInt(name.get());
break;
case nsIPrefBranch::PREF_STRING:
type = widget::PrefsHelper::PREF_STRING;
type = java::PrefsHelper::PREF_STRING;
strVal = Preferences::GetLocalizedString(name.get());
if (!strVal) {
strVal = Preferences::GetString(name.get());
@ -323,12 +325,13 @@ public:
Maybe<jni::StringParam> jstrVal;
jstrVal.emplace(nullptr);
if (type == widget::PrefsHelper::PREF_STRING) {
if (type == java::PrefsHelper::PREF_STRING) {
jstrVal.reset();
jstrVal.emplace(strVal);
}
widget::PrefsHelper::OnPrefChange(name, type, boolVal, intVal, jstrVal.ref());
java::PrefsHelper::OnPrefChange(
name, type, boolVal, intVal, jstrVal.ref());
}
};

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

@ -27,7 +27,7 @@
namespace mozilla {
class ThumbnailHelper final
: public widget::ThumbnailHelper::Natives<ThumbnailHelper>
: public java::ThumbnailHelper::Natives<ThumbnailHelper>
, public jni::UsesNativeCallProxy
{
ThumbnailHelper() = delete;
@ -234,7 +234,7 @@ public:
!tab ||
NS_FAILED(tab->GetWindow(getter_AddRefs(window))) ||
!window) {
widget::ThumbnailHelper::SendThumbnail(
java::ThumbnailHelper::SendThumbnail(
aData, aTabId, /* success */ false, /* store */ false);
return;
}
@ -244,7 +244,7 @@ public:
const bool success = !!docShell;
const bool store = success ? ShouldStoreThumbnail(docShell) : false;
widget::ThumbnailHelper::SendThumbnail(aData, aTabId, success, store);
java::ThumbnailHelper::SendThumbnail(aData, aTabId, success, store);
}
};

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

@ -152,7 +152,7 @@ bool HandleUncaughtException(JNIEnv* aEnv)
MOZ_ASSERT(e);
aEnv->ExceptionClear();
String::LocalRef stack = widget::GeckoAppShell::HandleUncaughtException(e);
String::LocalRef stack = java::GeckoAppShell::HandleUncaughtException(e);
#ifdef MOZ_CRASHREPORTER
if (stack) {

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

@ -21,7 +21,7 @@ class AndroidInputStream : public nsIInputStream
{
public:
AndroidInputStream(jni::Object::Param connection) {
mBridgeInputStream = widget::GeckoAppShell::CreateInputStream(connection);
mBridgeInputStream = java::GeckoAppShell::CreateInputStream(connection);
mBridgeChannel = AndroidBridge::ChannelCreate(mBridgeInputStream);
}
@ -71,7 +71,7 @@ private:
mConnection = aConnection;
SetURI(aURI);
auto type = widget::GeckoAppShell::ConnectionGetMimeType(mConnection);
auto type = java::GeckoAppShell::ConnectionGetMimeType(mConnection);
if (type) {
SetContentType(type->ToCString());
}
@ -82,7 +82,7 @@ public:
nsCString spec;
aURI->GetSpec(spec);
auto connection = widget::GeckoAppShell::GetConnection(spec);
auto connection = java::GeckoAppShell::GetConnection(spec);
return connection ? new AndroidChannel(aURI, connection) : nullptr;
}

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

@ -89,7 +89,7 @@ public:
NS_DECL_ISUPPORTS;
nsresult Callback(const nsAString& topic, const nsAString& state) override {
widget::GeckoAppShell::NotifyWakeLockChanged(topic, state);
java::GeckoAppShell::NotifyWakeLockChanged(topic, state);
return NS_OK;
}
};
@ -100,7 +100,7 @@ StaticRefPtr<WakeLockListener> sWakeLockListener;
class GeckoThreadSupport final
: public widget::GeckoThread::Natives<GeckoThreadSupport>
: public java::GeckoThread::Natives<GeckoThreadSupport>
, public UsesGeckoThreadProxy
{
static uint32_t sPauseCount;
@ -220,7 +220,7 @@ uint32_t GeckoThreadSupport::sPauseCount;
class GeckoAppShellSupport final
: public widget::GeckoAppShell::Natives<GeckoAppShellSupport>
: public java::GeckoAppShell::Natives<GeckoAppShellSupport>
, public UsesGeckoThreadProxy
{
public:
@ -356,7 +356,7 @@ nsAppShell::nsAppShell()
mozilla::ThumbnailHelper::Init();
nsWindow::InitNatives();
widget::GeckoThread::SetState(widget::GeckoThread::State::JNI_READY());
java::GeckoThread::SetState(java::GeckoThread::State::JNI_READY());
}
sPowerManagerService = do_GetService(POWERMANAGERSERVICE_CONTRACTID);
@ -458,11 +458,11 @@ nsAppShell::Observe(nsISupports* aSubject,
if (jni::IsAvailable()) {
// See if we want to force 16-bit color before doing anything
if (Preferences::GetBool("gfx.android.rgb16.force", false)) {
widget::GeckoAppShell::SetScreenDepthOverride(16);
java::GeckoAppShell::SetScreenDepthOverride(16);
}
widget::GeckoThread::SetState(
widget::GeckoThread::State::PROFILE_READY());
java::GeckoThread::SetState(
java::GeckoThread::State::PROFILE_READY());
// Gecko on Android follows the Android app model where it never
// stops until it is killed by the system or told explicitly to
@ -480,16 +480,16 @@ nsAppShell::Observe(nsISupports* aSubject,
} else if (!strcmp(aTopic, "chrome-document-loaded")) {
if (jni::IsAvailable()) {
// Our first window has loaded, assume any JS initialization has run.
widget::GeckoThread::CheckAndSetState(
widget::GeckoThread::State::PROFILE_READY(),
widget::GeckoThread::State::RUNNING());
java::GeckoThread::CheckAndSetState(
java::GeckoThread::State::PROFILE_READY(),
java::GeckoThread::State::RUNNING());
}
removeObserver = true;
} else if (!strcmp(aTopic, "quit-application-granted")) {
if (jni::IsAvailable()) {
widget::GeckoThread::SetState(
widget::GeckoThread::State::EXITING());
java::GeckoThread::SetState(
java::GeckoThread::State::EXITING());
// We are told explicitly to quit, perhaps due to
// nsIAppStartup::Quit being called. We should release our hold on
@ -817,8 +817,7 @@ nsAppShell::LegacyGeckoEvent::Run()
dom::GamepadMappingType::Standard,
dom::kStandardGamepadButtons,
dom::kStandardGamepadAxes);
widget::GeckoAppShell::GamepadAdded(curEvent->ID(),
svc_id);
java::GeckoAppShell::GamepadAdded(curEvent->ID(), svc_id);
} else if (curEvent->Action() == AndroidGeckoEvent::ACTION_GAMEPAD_REMOVED) {
service->RemoveGamepad(curEvent->ID());
}

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

@ -43,7 +43,7 @@ nsClipboard::SetData(nsITransferable *aTransferable,
nsAutoString buffer;
supportsString->GetData(buffer);
widget::Clipboard::SetClipboardText(buffer);
java::Clipboard::SetClipboardText(buffer);
return NS_OK;
}
@ -84,7 +84,7 @@ nsClipboard::EmptyClipboard(int32_t aWhichClipboard)
{
if (aWhichClipboard != kGlobalClipboard)
return NS_ERROR_NOT_IMPLEMENTED;
widget::Clipboard::ClearText();
java::Clipboard::ClearText();
return NS_OK;
}
@ -100,7 +100,7 @@ nsClipboard::HasDataMatchingFlavors(const char **aFlavorList,
for (uint32_t k = 0; k < aLength; k++) {
if (strcmp(aFlavorList[k], kUnicodeMime) == 0) {
*aHasText = widget::Clipboard::HasText();
*aHasText = java::Clipboard::HasText();
break;
}
}

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

@ -475,7 +475,7 @@ nsLookAndFeel::GetEchoPasswordImpl()
{
if (!mInitializedShowPassword) {
if (XRE_IsParentProcess()) {
mShowPassword = widget::GeckoAppShell::GetShowPasswordSetting();
mShowPassword = java::GeckoAppShell::GetShowPasswordSetting();
} else {
ContentChild::GetSingleton()->SendGetShowPasswordSetting(&mShowPassword);
}

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

@ -7,7 +7,6 @@
#include "nsScreenManagerAndroid.h"
#include "nsWindow.h"
#include "AndroidBridge.h"
#include "GeneratedJNIWrappers.h"
#include "AndroidRect.h"
#include <mozilla/jni/Refs.h>
@ -38,7 +37,7 @@ nsScreenAndroid::GetRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, i
return NS_ERROR_FAILURE;
}
widget::sdk::Rect::LocalRef rect = widget::GeckoAppShell::GetScreenSize();
java::sdk::Rect::LocalRef rect = java::GeckoAppShell::GetScreenSize();
rect->Left(outLeft);
rect->Top(outTop);
rect->Width(outWidth);
@ -65,7 +64,7 @@ nsScreenAndroid::GetPixelDepth(int32_t *aPixelDepth)
return NS_ERROR_FAILURE;
}
*aPixelDepth = widget::GeckoAppShell::GetScreenDepthWrapper();
*aPixelDepth = java::GeckoAppShell::GetScreenDepthWrapper();
return NS_OK;
}
@ -80,7 +79,7 @@ void
nsScreenAndroid::ApplyMinimumBrightness(uint32_t aBrightness)
{
if (mozilla::jni::IsAvailable()) {
widget::GeckoAppShell::SetKeepScreenOn(aBrightness == BRIGHTNESS_FULL);
java::GeckoAppShell::SetKeepScreenOn(aBrightness == BRIGHTNESS_FULL);
}
}

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

@ -85,8 +85,9 @@ using mozilla::Unused;
using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::widget;
using namespace mozilla::layers;
using namespace mozilla::java;
using namespace mozilla::widget;
NS_IMPL_ISUPPORTS_INHERITED0(nsWindow, nsBaseWidget)
@ -277,8 +278,7 @@ private:
, mOldEnd(aIMENotification.mTextChangeData.mRemovedEndOffset)
, mNewEnd(aIMENotification.mTextChangeData.mAddedEndOffset)
{
MOZ_ASSERT(aIMENotification.mMessage ==
mozilla::widget::NOTIFY_IME_OF_TEXT_CHANGE,
MOZ_ASSERT(aIMENotification.mMessage == NOTIFY_IME_OF_TEXT_CHANGE,
"IMETextChange initialized with wrong notification");
MOZ_ASSERT(aIMENotification.mTextChangeData.IsValid(),
"The text change notification isn't initialized");
@ -290,7 +290,7 @@ private:
};
// GeckoEditable instance used by this nsWindow;
mozilla::widget::GeckoEditable::GlobalRef mEditable;
java::GeckoEditable::GlobalRef mEditable;
AutoTArray<mozilla::UniquePtr<mozilla::WidgetEvent>, 8> mIMEKeyEvents;
AutoTArray<IMETextChange, 4> mIMETextChanges;
InputContext mInputContext;
@ -568,13 +568,13 @@ public:
MouseInput::ButtonType result = MouseInput::NONE;
switch (button) {
case widget::sdk::MotionEvent::BUTTON_PRIMARY:
case java::sdk::MotionEvent::BUTTON_PRIMARY:
result = MouseInput::LEFT_BUTTON;
break;
case widget::sdk::MotionEvent::BUTTON_SECONDARY:
case java::sdk::MotionEvent::BUTTON_SECONDARY:
result = MouseInput::RIGHT_BUTTON;
break;
case widget::sdk::MotionEvent::BUTTON_TERTIARY:
case java::sdk::MotionEvent::BUTTON_TERTIARY:
result = MouseInput::MIDDLE_BUTTON;
break;
default:
@ -587,19 +587,19 @@ public:
static int16_t ConvertButtons(int buttons) {
int16_t result = 0;
if (buttons & widget::sdk::MotionEvent::BUTTON_PRIMARY) {
if (buttons & java::sdk::MotionEvent::BUTTON_PRIMARY) {
result |= WidgetMouseEventBase::eLeftButtonFlag;
}
if (buttons & widget::sdk::MotionEvent::BUTTON_SECONDARY) {
if (buttons & java::sdk::MotionEvent::BUTTON_SECONDARY) {
result |= WidgetMouseEventBase::eRightButtonFlag;
}
if (buttons & widget::sdk::MotionEvent::BUTTON_TERTIARY) {
if (buttons & java::sdk::MotionEvent::BUTTON_TERTIARY) {
result |= WidgetMouseEventBase::eMiddleButtonFlag;
}
if (buttons & widget::sdk::MotionEvent::BUTTON_BACK) {
if (buttons & java::sdk::MotionEvent::BUTTON_BACK) {
result |= WidgetMouseEventBase::e4thButtonFlag;
}
if (buttons & widget::sdk::MotionEvent::BUTTON_FORWARD) {
if (buttons & java::sdk::MotionEvent::BUTTON_FORWARD) {
result |= WidgetMouseEventBase::e5thButtonFlag;
}
@ -2466,7 +2466,7 @@ ConvertAndroidScanCodeToCodeNameIndex(int scanCode)
static bool
IsModifierKey(int32_t keyCode)
{
using mozilla::widget::sdk::KeyEvent;
using mozilla::java::sdk::KeyEvent;
return keyCode == KeyEvent::KEYCODE_ALT_LEFT ||
keyCode == KeyEvent::KEYCODE_ALT_RIGHT ||
keyCode == KeyEvent::KEYCODE_SHIFT_LEFT ||
@ -2480,7 +2480,7 @@ IsModifierKey(int32_t keyCode)
static Modifiers
GetModifiers(int32_t metaState)
{
using mozilla::widget::sdk::KeyEvent;
using mozilla::java::sdk::KeyEvent;
return (metaState & KeyEvent::META_ALT_MASK ? MODIFIER_ALT : 0)
| (metaState & KeyEvent::META_SHIFT_MASK ? MODIFIER_SHIFT : 0)
| (metaState & KeyEvent::META_CTRL_MASK ? MODIFIER_CONTROL : 0)

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

@ -249,7 +249,7 @@ private:
void CreateLayerManager(int aCompositorWidth, int aCompositorHeight);
void RedrawAll();
mozilla::widget::LayerRenderer::Frame::GlobalRef mLayerRendererFrame;
mozilla::java::LayerRenderer::Frame::GlobalRef mLayerRendererFrame;
};
#endif /* NSWINDOW_H_ */

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

@ -867,7 +867,7 @@ nsSystemInfo::GetAndroidSystemInfo(AndroidSystemInfo* aInfo)
sdk_version = 0;
}
aInfo->sdk_version() = sdk_version;
aInfo->isTablet() = mozilla::widget::GeckoAppShell::IsTablet();
aInfo->isTablet() = java::GeckoAppShell::IsTablet();
}
void

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

@ -585,7 +585,7 @@ ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION",
"RELEASE",
osVersion);
isTablet = mozilla::widget::GeckoAppShell::IsTablet();
isTablet = java::GeckoAppShell::IsTablet();
}
#endif

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

@ -61,7 +61,7 @@ static nsresult MacErrorMapper(OSErr inErr);
#endif
#ifdef MOZ_WIDGET_ANDROID
#include "AndroidBridge.h"
#include "GeneratedJNIWrappers.h"
#include "nsIMIMEService.h"
#include <linux/magic.h>
#endif
@ -2023,7 +2023,7 @@ nsLocalFile::Launch()
}
nsAutoCString fileUri = NS_LITERAL_CSTRING("file://") + mPath;
return widget::GeckoAppShell::OpenUriExternal(
return java::GeckoAppShell::OpenUriExternal(
NS_ConvertUTF8toUTF16(fileUri),
NS_ConvertUTF8toUTF16(type),
EmptyString(),