public final class GeckoRuntime extends Object implements Parcelable
Modifier and Type | Class and Description |
---|---|
static interface |
GeckoRuntime.ActivityDelegate
This is used to allow GeckoRuntime to start activities via the embedding
application (and
Activity ). |
static interface |
GeckoRuntime.Delegate |
static interface |
GeckoRuntime.ServiceWorkerDelegate |
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static String |
ACTION_CRASHED
Intent action sent to the crash handler when a crash is encountered.
|
static Parcelable.Creator<GeckoRuntime> |
CREATOR |
static String |
EXTRA_CRASH_FATAL
This is a key for extra data sent with
ACTION_CRASHED . |
static String |
EXTRA_EXTRAS_PATH
This is a key for extra data sent with
ACTION_CRASHED . |
static String |
EXTRA_MINIDUMP_PATH
This is a key for extra data sent with
ACTION_CRASHED . |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier and Type | Method and Description |
---|---|
void |
appendAppNotesToCrashReport(String notes)
Appends notes to crash report.
|
void |
attachTo(Context context)
Attach the runtime to the given context.
|
void |
configurationChanged(Configuration newConfig)
Notify Gecko that the device configuration has changed.
|
static GeckoRuntime |
create(Context context)
Create a new runtime with default settings and attach it to the given
context.
|
static GeckoRuntime |
create(Context context,
GeckoRuntimeSettings settings)
Create a new runtime with the given settings and attach it to the given
context.
|
int |
describeContents() |
GeckoRuntime.ActivityDelegate |
getActivityDelegate()
Get the
GeckoRuntime.ActivityDelegate instance set on this runtime, if any, |
ContentBlockingController |
getContentBlockingController()
Returns the ContentBlockingController for this GeckoRuntime.
|
static GeckoRuntime |
getDefault(Context context)
Get the default runtime for the given context.
|
GeckoRuntime.Delegate |
getDelegate()
Returns the current delegate, if any.
|
Autocomplete.LoginStorageDelegate |
getLoginStorageDelegate()
Get the
Autocomplete.LoginStorageDelegate instance set on this runtime. |
File |
getProfileDir()
Get the profile directory for this runtime.
|
ProfilerController |
getProfilerController()
Returns a ProfilerController for this GeckoRuntime.
|
GeckoRuntimeSettings |
getSettings() |
StorageController |
getStorageController()
Get the storage controller for this runtime.
|
WebExtensionController |
getWebExtensionController()
Returns a WebExtensionController for this GeckoRuntime.
|
WebNotificationDelegate |
getWebNotificationDelegate()
Returns the current WebNotificationDelegate, if any
|
WebPushController |
getWebPushController()
Get the Web Push controller for this runtime.
|
void |
orientationChanged()
Notify Gecko that the screen orientation has changed.
|
void |
orientationChanged(int newOrientation)
Notify Gecko that the screen orientation has changed.
|
void |
readFromParcel(Parcel source) |
void |
setActivityDelegate(GeckoRuntime.ActivityDelegate delegate)
Set the
GeckoRuntime.ActivityDelegate instance on this runtime. |
void |
setDelegate(GeckoRuntime.Delegate delegate)
Set a delegate for receiving callbacks relevant to to this GeckoRuntime.
|
void |
setLoginStorageDelegate(Autocomplete.LoginStorageDelegate delegate)
Set the
Autocomplete.LoginStorageDelegate instance on this runtime. |
void |
setServiceWorkerDelegate(GeckoRuntime.ServiceWorkerDelegate serviceWorkerDelegate)
Sets the
GeckoRuntime.ServiceWorkerDelegate to be used for Service Worker requests. |
void |
setWebNotificationDelegate(WebNotificationDelegate delegate)
Sets the delegate to be used for handling Web Notifications.
|
void |
shutdown()
Shutdown the runtime.
|
void |
writeToParcel(Parcel out,
int flags) |
public static final String ACTION_CRASHED
public static final String EXTRA_MINIDUMP_PATH
ACTION_CRASHED
. It refers
to a String with the path to a Breakpad minidump file containing information about
the crash. Several crash reporters are able to ingest this in a
crash report, including Sentry
and Mozilla's Socorro.
public static final String EXTRA_EXTRAS_PATH
ACTION_CRASHED
. It refers
to a string with the path to a file containing extra metadata about the crash. The file
contains key-value pairs in the form
Key=ValueBe aware, it may contain sensitive data such as the URI that was loaded at the time of the crash.
public static final String EXTRA_CRASH_FATAL
ACTION_CRASHED
. The value is
a boolean indicating whether or not the crash was fatal or not. If true, the
main application process was affected by the crash. If false, only an internal
process used by Gecko has crashed and the application may be able to recover.public static final Parcelable.Creator<GeckoRuntime> CREATOR
@UiThread @NonNull public static GeckoRuntime getDefault(@NonNull Context context)
context
- An application context for the default runtime.@UiThread public void attachTo(@NonNull Context context)
context
- The new context to attach to.@UiThread @NonNull public static GeckoRuntime create(@NonNull Context context)
context
- The context of the runtime.@UiThread @NonNull public WebExtensionController getWebExtensionController()
WebExtensionController
.@UiThread @NonNull public ContentBlockingController getContentBlockingController()
ContentBlockingController
.@UiThread @NonNull public ProfilerController getProfilerController()
ProfilerController
.@UiThread @NonNull public static GeckoRuntime create(@NonNull Context context, @NonNull GeckoRuntimeSettings settings)
context
- The context of the runtime.settings
- The settings for the runtime.@AnyThread public void shutdown()
@UiThread public void setDelegate(@Nullable GeckoRuntime.Delegate delegate)
delegate
- an implementation of GeckoRuntime.Delegate
.@UiThread @Nullable public GeckoRuntime.Delegate getDelegate()
GeckoRuntime.Delegate
or null if no delegate has been set.@UiThread public void setLoginStorageDelegate(@Nullable Autocomplete.LoginStorageDelegate delegate)
Autocomplete.LoginStorageDelegate
instance on this runtime.
This delegate is required for handling login storage requests.delegate
- The Autocomplete.LoginStorageDelegate
handling login storage
requests.@UiThread @Nullable public Autocomplete.LoginStorageDelegate getLoginStorageDelegate()
Autocomplete.LoginStorageDelegate
instance set on this runtime.Autocomplete.LoginStorageDelegate
set on this runtime.@UiThread public void setServiceWorkerDelegate(@Nullable GeckoRuntime.ServiceWorkerDelegate serviceWorkerDelegate)
GeckoRuntime.ServiceWorkerDelegate
to be used for Service Worker requests.serviceWorkerDelegate
- An instance of GeckoRuntime.ServiceWorkerDelegate
.@UiThread public void setWebNotificationDelegate(@Nullable WebNotificationDelegate delegate)
delegate
- An instance of WebNotificationDelegate
.@UiThread @Nullable public WebNotificationDelegate getWebNotificationDelegate()
@UiThread public void setActivityDelegate(@Nullable GeckoRuntime.ActivityDelegate delegate)
GeckoRuntime.ActivityDelegate
instance on this runtime.
This delegate is used to provide GeckoView support for launching external
activities and receiving results from those activities.delegate
- The GeckoRuntime.ActivityDelegate
handling intent launching requests.@UiThread @Nullable public GeckoRuntime.ActivityDelegate getActivityDelegate()
GeckoRuntime.ActivityDelegate
instance set on this runtime, if any,GeckoRuntime.ActivityDelegate
set on this runtime.@AnyThread @NonNull public GeckoRuntimeSettings getSettings()
@UiThread @Nullable public File getProfileDir()
@UiThread public void orientationChanged()
@UiThread public void configurationChanged(@NonNull Configuration newConfig)
newConfig
- The new Configuration object,
Configuration
.@UiThread public void orientationChanged(int newOrientation)
newOrientation
- The new screen orientation, as retrieved e.g. from the current
Configuration
.@UiThread @NonNull public StorageController getStorageController()
GeckoSession
.StorageController
for this instance.@UiThread @NonNull public WebPushController getWebPushController()
WebPushController
for this instance.@AnyThread public void appendAppNotesToCrashReport(@NonNull String notes)
notes
- The application notes to append to the crash report.@AnyThread public int describeContents()
describeContents
in interface Parcelable
@AnyThread public void writeToParcel(Parcel out, int flags)
writeToParcel
in interface Parcelable
@AnyThread public void readFromParcel(@NonNull Parcel source)