Skip to content

Commit

Permalink
Backed out 1 changesets (bug 1189881) for bustage on a CLOSED TREE
Browse files Browse the repository at this point in the history
Backed out changeset e0b666c198dd (bug 1189881)
  • Loading branch information
BavarianTomcat committed Sep 17, 2015
1 parent c22eb97 commit a7b44b8
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 66 deletions.
4 changes: 3 additions & 1 deletion mobile/android/base/GeckoJavaSampler.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public class GeckoJavaSampler {

// Use the same timer primitive as the profiler
// to get a perfect sample syncing.
@WrapForJNI
private static native double getProfilerTime();

private static class Sample {
Expand Down Expand Up @@ -209,3 +208,6 @@ public static void stop() {
}
}
}



26 changes: 0 additions & 26 deletions tools/profiler/core/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
#include "AndroidBridge.h"
#endif

#ifdef SPS_OS_android
#include "GeneratedJNINatives.h"
#endif

#ifndef SPS_STANDALONE
#if defined(SPS_PLAT_amd64_linux) || defined(SPS_PLAT_x86_linux)
# define USE_LUL_STACKWALK
Expand All @@ -47,22 +43,6 @@
#endif
#endif

#ifdef SPS_OS_android
class GeckoJavaSampler : public widget::GeckoJavaSampler::Natives<GeckoJavaSampler>
{
private:
GeckoJavaSampler();

public:
static double GetProfilerTime() {
if (!profiler_is_active()) {
return 0.0;
}
return profiler_time();
};
};
#endif

mozilla::ThreadLocal<PseudoStack *> tlsPseudoStack;
mozilla::ThreadLocal<GeckoSampler *> tlsTicker;
mozilla::ThreadLocal<void *> tlsStackTop;
Expand Down Expand Up @@ -493,12 +473,6 @@ void mozilla_sampler_init(void* stackTop)
set_stderr_callback(mozilla_sampler_log);
#endif

#ifdef SPS_OS_android
if (mozilla::jni::IsAvailable()) {
GeckoJavaSampler::Init();
}
#endif

// We can't open pref so we use an environment variable
// to know if we should trigger the profiler on startup
// NOTE: Default
Expand Down
15 changes: 12 additions & 3 deletions widget/android/AndroidJNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ Java_org_mozilla_gecko_GeckoAppShell_notifyFilePickerResult(JNIEnv* jenv, jclass
{
class NotifyFilePickerResultRunnable : public nsRunnable {
public:
NotifyFilePickerResultRunnable(nsString& fileDir, long callback) :
NotifyFilePickerResultRunnable(nsString& fileDir, long callback) :
mFileDir(fileDir), mCallback(callback) {}

NS_IMETHODIMP Run() {
Expand All @@ -694,7 +694,7 @@ Java_org_mozilla_gecko_GeckoAppShell_notifyFilePickerResult(JNIEnv* jenv, jclass
long mCallback;
};
nsString path = nsJNIString(filePath, jenv);

nsCOMPtr<nsIRunnable> runnable =
new NotifyFilePickerResultRunnable(path, (long)callback);
NS_DispatchToMainThread(runnable);
Expand Down Expand Up @@ -767,7 +767,7 @@ Java_org_mozilla_gecko_GeckoAppShell_getSurfaceBits(JNIEnv* jenv, jclass, jobjec
for (int i = 0; i < srcHeight; i++) {
memcpy(bitsCopy + ((dstHeight - i - 1) * dstWidth * bpp), bits + (i * srcStride * bpp), srcStride * bpp);
}

if (!jSurfaceBitsClass) {
jSurfaceBitsClass = (jclass)jenv->NewGlobalRef(jenv->FindClass("org/mozilla/gecko/SurfaceBits"));
jSurfaceBitsCtor = jenv->GetMethodID(jSurfaceBitsClass, "<init>", "()V");
Expand Down Expand Up @@ -852,6 +852,15 @@ Java_org_mozilla_gecko_GeckoAppShell_dispatchMemoryPressure(JNIEnv* jenv, jclass
NS_DispatchMemoryPressure(MemPressure_New);
}

NS_EXPORT jdouble JNICALL
Java_org_mozilla_gecko_GeckoJavaSampler_getProfilerTime(JNIEnv *jenv, jclass jc)
{
if (!profiler_is_active()) {
return 0.0;
}
return profiler_time();
}

NS_EXPORT void JNICALL
Java_org_mozilla_gecko_gfx_NativePanZoomController_abortAnimation(JNIEnv* env, jobject instance)
{
Expand Down
15 changes: 0 additions & 15 deletions widget/android/GeneratedJNINatives.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,6 @@ class ANRReporter::Natives : public mozilla::jni::NativeImpl<ANRReporter, Impl>
template<class Impl>
constexpr JNINativeMethod ANRReporter::Natives<Impl>::methods[];

template<class Impl>
class GeckoJavaSampler::Natives : public mozilla::jni::NativeImpl<GeckoJavaSampler, Impl>
{
public:
static constexpr JNINativeMethod methods[] = {

mozilla::jni::MakeNativeMethod<GeckoJavaSampler::GetProfilerTime_t>(
mozilla::jni::NativeStub<GeckoJavaSampler::GetProfilerTime_t, Impl>
::template Wrap<&Impl::GetProfilerTime>)
};
};

template<class Impl>
constexpr JNINativeMethod GeckoJavaSampler::Natives<Impl>::methods[];

template<class Impl>
class GeckoThread::Natives : public mozilla::jni::NativeImpl<GeckoThread, Impl>
{
Expand Down
3 changes: 0 additions & 3 deletions widget/android/GeneratedJNIWrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,9 +715,6 @@ auto GeckoJavaSampler::GetFrameNameJavaProfilingWrapper(int32_t a0, int32_t a1,
return mozilla::jni::Method<GetFrameNameJavaProfilingWrapper_t>::Call(nullptr, nullptr, a0, a1, a2);
}

constexpr char GeckoJavaSampler::GetProfilerTime_t::name[];
constexpr char GeckoJavaSampler::GetProfilerTime_t::signature[];

constexpr char GeckoJavaSampler::GetSampleTimeJavaProfiling_t::name[];
constexpr char GeckoJavaSampler::GetSampleTimeJavaProfiling_t::signature[];

Expand Down
17 changes: 0 additions & 17 deletions widget/android/GeneratedJNIWrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -1694,21 +1694,6 @@ class GeckoJavaSampler : public mozilla::jni::Class<GeckoJavaSampler>

static auto GetFrameNameJavaProfilingWrapper(int32_t, int32_t, int32_t) -> mozilla::jni::String::LocalRef;

public:
struct GetProfilerTime_t {
typedef GeckoJavaSampler Owner;
typedef double ReturnType;
typedef double SetterType;
typedef mozilla::jni::Args<> Args;
static constexpr char name[] = "getProfilerTime";
static constexpr char signature[] =
"()D";
static const bool isStatic = true;
static const bool isMultithreaded = false;
static const mozilla::jni::ExceptionMode exceptionMode =
mozilla::jni::ExceptionMode::ABORT;
};

public:
struct GetSampleTimeJavaProfiling_t {
typedef GeckoJavaSampler Owner;
Expand Down Expand Up @@ -1816,8 +1801,6 @@ class GeckoJavaSampler : public mozilla::jni::Class<GeckoJavaSampler>

static auto UnpauseJavaProfiling() -> void;

public:
template<class Impl> class Natives;
};

class GeckoThread : public mozilla::jni::Class<GeckoThread>
Expand Down
1 change: 0 additions & 1 deletion widget/android/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ EXPORTS += [
'AndroidBridge.h',
'AndroidJavaWrappers.h',
'AndroidJNIWrapper.h',
'GeneratedJNINatives.h',
'GeneratedJNIWrappers.h',
]

Expand Down

0 comments on commit a7b44b8

Please sign in to comment.