2009-08-18 23:05:15 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* vim: set sw=4 ts=8 et tw=80 : */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* 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/. */
|
2009-08-12 20:18:08 +04:00
|
|
|
|
2010-07-19 22:33:33 +04:00
|
|
|
#ifndef mozilla_dom_ContentParent_h
|
|
|
|
#define mozilla_dom_ContentParent_h
|
2009-08-12 20:18:08 +04:00
|
|
|
|
2009-09-03 04:18:27 +04:00
|
|
|
#include "base/waitable_event_watcher.h"
|
|
|
|
|
2010-07-19 22:33:33 +04:00
|
|
|
#include "mozilla/dom/PContentParent.h"
|
2011-02-16 21:43:23 +03:00
|
|
|
#include "mozilla/dom/PMemoryReportRequestParent.h"
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 22:32:37 +04:00
|
|
|
#include "mozilla/dom/TabContext.h"
|
2009-08-12 20:18:08 +04:00
|
|
|
#include "mozilla/ipc/GeckoChildProcessHost.h"
|
2012-08-02 10:02:29 +04:00
|
|
|
#include "mozilla/dom/ipc/Blob.h"
|
2012-08-03 23:35:58 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2013-02-15 00:41:29 +04:00
|
|
|
#include "mozilla/HalTypes.h"
|
2009-08-12 20:18:08 +04:00
|
|
|
|
2012-09-28 09:43:12 +04:00
|
|
|
#include "nsFrameMessageManager.h"
|
2009-09-03 04:18:27 +04:00
|
|
|
#include "nsIObserver.h"
|
2010-02-02 04:53:52 +03:00
|
|
|
#include "nsIThreadInternal.h"
|
2010-07-02 19:50:24 +04:00
|
|
|
#include "nsNetUtil.h"
|
2010-07-15 18:04:25 +04:00
|
|
|
#include "nsIPermissionManager.h"
|
2010-09-21 08:16:37 +04:00
|
|
|
#include "nsIDOMGeoPositionCallback.h"
|
2011-02-16 21:43:23 +03:00
|
|
|
#include "nsIMemoryReporter.h"
|
|
|
|
#include "nsCOMArray.h"
|
2012-07-14 01:10:20 +04:00
|
|
|
#include "nsDataHashtable.h"
|
2012-08-02 10:02:29 +04:00
|
|
|
#include "nsHashKeys.h"
|
2013-01-03 01:21:37 +04:00
|
|
|
#include "PermissionMessageUtils.h"
|
2009-09-03 04:18:27 +04:00
|
|
|
|
2012-09-28 09:43:24 +04:00
|
|
|
#define CHILD_PROCESS_SHUTDOWN_MESSAGE NS_LITERAL_STRING("child-process-shutdown")
|
|
|
|
|
2012-08-09 06:58:06 +04:00
|
|
|
class mozIApplication;
|
2012-11-09 21:52:09 +04:00
|
|
|
class nsConsoleService;
|
2012-08-02 10:02:29 +04:00
|
|
|
class nsIDOMBlob;
|
|
|
|
|
2009-08-12 20:18:08 +04:00
|
|
|
namespace mozilla {
|
2009-09-10 02:00:14 +04:00
|
|
|
|
2009-08-12 22:31:48 +04:00
|
|
|
namespace ipc {
|
2012-08-23 23:33:46 +04:00
|
|
|
class OptionalURIParams;
|
|
|
|
class URIParams;
|
2009-08-12 22:31:48 +04:00
|
|
|
class TestShellParent;
|
2012-08-23 23:33:46 +04:00
|
|
|
} // namespace ipc
|
2009-08-12 22:31:48 +04:00
|
|
|
|
2012-07-18 03:59:45 +04:00
|
|
|
namespace layers {
|
|
|
|
class PCompositorParent;
|
2012-08-23 23:33:46 +04:00
|
|
|
} // namespace layers
|
2012-07-18 03:59:45 +04:00
|
|
|
|
2009-08-12 20:18:08 +04:00
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
class TabParent;
|
2010-11-19 04:15:23 +03:00
|
|
|
class PStorageParent;
|
2012-08-02 10:02:29 +04:00
|
|
|
class ClonedMessageData;
|
2009-08-12 20:18:08 +04:00
|
|
|
|
2010-07-19 22:33:33 +04:00
|
|
|
class ContentParent : public PContentParent
|
|
|
|
, public nsIObserver
|
|
|
|
, public nsIThreadObserver
|
2010-09-21 08:16:37 +04:00
|
|
|
, public nsIDOMGeoPositionCallback
|
2012-09-28 09:43:12 +04:00
|
|
|
, public mozilla::dom::ipc::MessageManagerCallback
|
2009-08-12 20:18:08 +04:00
|
|
|
{
|
|
|
|
typedef mozilla::ipc::GeckoChildProcessHost GeckoChildProcessHost;
|
2012-08-23 23:33:46 +04:00
|
|
|
typedef mozilla::ipc::OptionalURIParams OptionalURIParams;
|
2009-11-11 11:34:08 +03:00
|
|
|
typedef mozilla::ipc::TestShellParent TestShellParent;
|
2012-08-23 23:33:46 +04:00
|
|
|
typedef mozilla::ipc::URIParams URIParams;
|
2012-08-02 10:02:29 +04:00
|
|
|
typedef mozilla::dom::ClonedMessageData ClonedMessageData;
|
2009-08-12 20:18:08 +04:00
|
|
|
|
|
|
|
public:
|
2012-08-16 05:46:03 +04:00
|
|
|
/**
|
|
|
|
* Start up the content-process machinery. This might include
|
|
|
|
* scheduling pre-launch tasks.
|
|
|
|
*/
|
|
|
|
static void StartUp();
|
|
|
|
/** Shut down the content-process machinery. */
|
|
|
|
static void ShutDown();
|
2012-12-28 13:45:16 +04:00
|
|
|
/**
|
|
|
|
* Ensure that all subprocesses are terminated and their OS
|
|
|
|
* resources have been reaped. This is synchronous and can be
|
|
|
|
* very expensive in general. It also bypasses the normal
|
|
|
|
* shutdown process.
|
|
|
|
*/
|
|
|
|
static void JoinAllSubprocesses();
|
2012-08-16 05:46:03 +04:00
|
|
|
|
2012-08-23 14:23:43 +04:00
|
|
|
static ContentParent* GetNewOrUsed(bool aForBrowserElement = false);
|
2012-07-14 01:10:20 +04:00
|
|
|
|
|
|
|
/**
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 22:32:37 +04:00
|
|
|
* Get or create a content process for the given TabContext.
|
2012-07-14 01:10:20 +04:00
|
|
|
*/
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 22:32:37 +04:00
|
|
|
static TabParent* CreateBrowserOrApp(const TabContext& aContext);
|
2012-08-09 06:58:06 +04:00
|
|
|
|
2011-08-02 23:35:42 +04:00
|
|
|
static void GetAll(nsTArray<ContentParent*>& aArray);
|
2009-08-12 20:18:08 +04:00
|
|
|
|
2009-09-03 04:18:27 +04:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIOBSERVER
|
2010-02-02 04:53:52 +03:00
|
|
|
NS_DECL_NSITHREADOBSERVER
|
2010-09-21 08:16:37 +04:00
|
|
|
NS_DECL_NSIDOMGEOPOSITIONCALLBACK
|
2009-09-03 04:18:27 +04:00
|
|
|
|
2012-09-28 09:43:12 +04:00
|
|
|
/**
|
|
|
|
* MessageManagerCallback methods that we override.
|
|
|
|
*/
|
|
|
|
virtual bool DoSendAsyncMessage(const nsAString& aMessage,
|
|
|
|
const mozilla::dom::StructuredCloneData& aData);
|
|
|
|
virtual bool CheckPermission(const nsAString& aPermission);
|
2012-12-22 16:00:10 +04:00
|
|
|
virtual bool CheckManifestURL(const nsAString& aManifestURL);
|
2013-01-14 14:08:55 +04:00
|
|
|
virtual bool CheckAppHasPermission(const nsAString& aPermission);
|
2012-09-28 09:43:12 +04:00
|
|
|
|
2013-01-10 17:22:14 +04:00
|
|
|
/** Notify that a tab is beginning its destruction sequence. */
|
|
|
|
void NotifyTabDestroying(PBrowserParent* aTab);
|
2012-07-17 22:27:27 +04:00
|
|
|
/** Notify that a tab was destroyed during normal operation. */
|
2013-01-10 17:22:14 +04:00
|
|
|
void NotifyTabDestroyed(PBrowserParent* aTab,
|
|
|
|
bool aNotifiedDestroying);
|
2009-11-11 11:34:08 +03:00
|
|
|
|
|
|
|
TestShellParent* CreateTestShell();
|
|
|
|
bool DestroyTestShell(TestShellParent* aTestShell);
|
2011-06-24 03:31:58 +04:00
|
|
|
TestShellParent* GetTestShellSingleton();
|
2009-08-12 20:18:08 +04:00
|
|
|
|
2010-03-30 00:29:45 +04:00
|
|
|
void ReportChildAlreadyBlocked();
|
2010-02-02 04:53:52 +03:00
|
|
|
bool RequestRunToCompletion();
|
|
|
|
|
2010-04-12 04:24:45 +04:00
|
|
|
bool IsAlive();
|
2012-07-17 22:27:27 +04:00
|
|
|
bool IsForApp();
|
2010-04-12 04:24:45 +04:00
|
|
|
|
2011-02-16 21:43:23 +03:00
|
|
|
void SetChildMemoryReporters(const InfallibleTArray<MemoryReport>& report);
|
|
|
|
|
2011-06-08 23:56:31 +04:00
|
|
|
GeckoChildProcessHost* Process() {
|
|
|
|
return mSubprocess;
|
|
|
|
}
|
|
|
|
|
2011-08-02 23:35:42 +04:00
|
|
|
bool NeedsPermissionsUpdate() {
|
|
|
|
return mSendPermissionUpdates;
|
|
|
|
}
|
|
|
|
|
2012-08-02 10:02:29 +04:00
|
|
|
BlobParent* GetOrCreateActorForBlob(nsIDOMBlob* aBlob);
|
2013-01-18 00:17:33 +04:00
|
|
|
|
2012-09-06 02:18:48 +04:00
|
|
|
/**
|
|
|
|
* Kill our subprocess and make sure it dies. Should only be used
|
|
|
|
* in emergency situations since it bypasses the normal shutdown
|
|
|
|
* process.
|
|
|
|
*/
|
|
|
|
void KillHard();
|
|
|
|
|
2012-12-28 21:57:35 +04:00
|
|
|
uint64_t ChildID() { return mChildID; }
|
|
|
|
|
2010-02-02 04:53:52 +03:00
|
|
|
protected:
|
2012-09-17 12:37:20 +04:00
|
|
|
void OnChannelConnected(int32_t pid);
|
2010-02-02 04:53:52 +03:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason why);
|
|
|
|
|
2009-08-12 20:18:08 +04:00
|
|
|
private:
|
2012-07-14 01:10:20 +04:00
|
|
|
static nsDataHashtable<nsStringHashKey, ContentParent*> *gAppContentParents;
|
|
|
|
static nsTArray<ContentParent*>* gNonAppContentParents;
|
2012-04-20 04:13:20 +04:00
|
|
|
static nsTArray<ContentParent*>* gPrivateContent;
|
2009-08-12 20:18:08 +04:00
|
|
|
|
2012-12-28 13:45:16 +04:00
|
|
|
static void JoinProcessesIOThread(const nsTArray<ContentParent*>* aProcesses,
|
|
|
|
Monitor* aMonitor, bool* aDone);
|
|
|
|
|
2012-08-16 05:46:03 +04:00
|
|
|
static void PreallocateAppProcess();
|
|
|
|
static void DelayedPreallocateAppProcess();
|
|
|
|
static void ScheduleDelayedPreallocateAppProcess();
|
2013-02-08 18:32:23 +04:00
|
|
|
|
|
|
|
// Take the preallocated process and transform it into a "real" app process,
|
|
|
|
// for the specified manifest URL. If there is no preallocated process (or
|
|
|
|
// if it's dead), this returns false.
|
|
|
|
static already_AddRefed<ContentParent>
|
|
|
|
MaybeTakePreallocatedAppProcess(const nsAString& aAppManifestURL,
|
|
|
|
ChildPrivileges aPrivs);
|
|
|
|
|
2012-10-09 08:46:19 +04:00
|
|
|
static void FirstIdle();
|
2012-08-16 05:46:03 +04:00
|
|
|
|
2009-08-12 22:31:48 +04:00
|
|
|
// Hide the raw constructor methods since we don't want client code
|
|
|
|
// using them.
|
2010-07-19 22:33:33 +04:00
|
|
|
using PContentParent::SendPBrowserConstructor;
|
|
|
|
using PContentParent::SendPTestShellConstructor;
|
2009-08-12 20:18:08 +04:00
|
|
|
|
2012-08-29 16:24:48 +04:00
|
|
|
ContentParent(const nsAString& aAppManifestURL, bool aIsForBrowser,
|
2013-02-08 18:32:23 +04:00
|
|
|
base::ChildPrivileges aOSPrivileges = base::PRIVILEGES_DEFAULT);
|
2010-07-19 22:33:33 +04:00
|
|
|
virtual ~ContentParent();
|
2009-08-12 20:18:08 +04:00
|
|
|
|
2010-12-26 23:03:52 +03:00
|
|
|
void Init();
|
|
|
|
|
2012-08-16 05:46:03 +04:00
|
|
|
// Transform a pre-allocated app process into a "real" app
|
2013-02-08 18:32:23 +04:00
|
|
|
// process, for the specified manifest URL. If this returns false, the
|
|
|
|
// child process has died.
|
|
|
|
bool TransformPreallocatedIntoApp(const nsAString& aAppManifestURL,
|
2013-01-18 00:06:36 +04:00
|
|
|
ChildPrivileges aPrivs);
|
2012-08-16 05:46:03 +04:00
|
|
|
|
2012-07-17 22:27:27 +04:00
|
|
|
/**
|
|
|
|
* Mark this ContentParent as dead for the purposes of Get*().
|
|
|
|
* This method is idempotent.
|
|
|
|
*/
|
|
|
|
void MarkAsDead();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Exit the subprocess and vamoose. After this call IsAlive()
|
|
|
|
* will return false and this ContentParent will not be returned
|
|
|
|
* by the Get*() funtions. However, the shutdown sequence itself
|
|
|
|
* may be asynchronous.
|
|
|
|
*/
|
2012-08-16 05:46:03 +04:00
|
|
|
void ShutDownProcess();
|
2012-07-17 22:27:27 +04:00
|
|
|
|
2012-08-29 16:24:48 +04:00
|
|
|
PCompositorParent*
|
|
|
|
AllocPCompositor(mozilla::ipc::Transport* aTransport,
|
|
|
|
base::ProcessId aOtherProcess) MOZ_OVERRIDE;
|
|
|
|
PImageBridgeParent*
|
|
|
|
AllocPImageBridge(mozilla::ipc::Transport* aTransport,
|
|
|
|
base::ProcessId aOtherProcess) MOZ_OVERRIDE;
|
2012-07-18 03:59:45 +04:00
|
|
|
|
2012-09-05 04:36:16 +04:00
|
|
|
virtual bool RecvGetProcessAttributes(uint64_t* aId,
|
|
|
|
bool* aIsForApp,
|
|
|
|
bool* aIsForBrowser) MOZ_OVERRIDE;
|
2012-11-09 01:09:39 +04:00
|
|
|
virtual bool RecvGetXPCOMProcessAttributes(bool* aIsOffline) MOZ_OVERRIDE;
|
2012-09-05 04:36:16 +04:00
|
|
|
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 22:32:37 +04:00
|
|
|
virtual PBrowserParent* AllocPBrowser(const IPCTabContext& aContext,
|
|
|
|
const uint32_t& aChromeFlags);
|
2010-07-19 22:33:33 +04:00
|
|
|
virtual bool DeallocPBrowser(PBrowserParent* frame);
|
2009-08-12 20:18:08 +04:00
|
|
|
|
2012-06-20 03:14:39 +04:00
|
|
|
virtual PDeviceStorageRequestParent* AllocPDeviceStorageRequest(const DeviceStorageParams&);
|
|
|
|
virtual bool DeallocPDeviceStorageRequest(PDeviceStorageRequestParent*);
|
|
|
|
|
2012-08-02 10:02:29 +04:00
|
|
|
virtual PBlobParent* AllocPBlob(const BlobConstructorParams& aParams);
|
|
|
|
virtual bool DeallocPBlob(PBlobParent*);
|
|
|
|
|
2011-06-08 23:56:31 +04:00
|
|
|
virtual PCrashReporterParent* AllocPCrashReporter(const NativeThreadId& tid,
|
2012-08-22 19:56:38 +04:00
|
|
|
const uint32_t& processType);
|
2010-11-24 17:15:03 +03:00
|
|
|
virtual bool DeallocPCrashReporter(PCrashReporterParent* crashreporter);
|
2011-06-08 23:56:31 +04:00
|
|
|
virtual bool RecvPCrashReporterConstructor(PCrashReporterParent* actor,
|
|
|
|
const NativeThreadId& tid,
|
2012-08-22 19:56:38 +04:00
|
|
|
const uint32_t& processType);
|
2010-11-24 17:15:03 +03:00
|
|
|
|
2012-07-06 22:15:45 +04:00
|
|
|
virtual PHalParent* AllocPHal() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPHal(PHalParent*) MOZ_OVERRIDE;
|
2011-10-06 02:15:45 +04:00
|
|
|
|
2012-07-14 15:24:20 +04:00
|
|
|
virtual PIndexedDBParent* AllocPIndexedDB();
|
|
|
|
|
|
|
|
virtual bool DeallocPIndexedDB(PIndexedDBParent* aActor);
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvPIndexedDBConstructor(PIndexedDBParent* aActor);
|
|
|
|
|
2011-02-16 21:43:23 +03:00
|
|
|
virtual PMemoryReportRequestParent* AllocPMemoryReportRequest();
|
|
|
|
virtual bool DeallocPMemoryReportRequest(PMemoryReportRequestParent* actor);
|
|
|
|
|
2009-09-22 21:31:11 +04:00
|
|
|
virtual PTestShellParent* AllocPTestShell();
|
|
|
|
virtual bool DeallocPTestShell(PTestShellParent* shell);
|
2009-08-12 22:31:48 +04:00
|
|
|
|
2009-09-22 21:31:11 +04:00
|
|
|
virtual PNeckoParent* AllocPNecko();
|
|
|
|
virtual bool DeallocPNecko(PNeckoParent* necko);
|
2009-08-18 23:05:15 +04:00
|
|
|
|
2010-09-16 02:55:08 +04:00
|
|
|
virtual PExternalHelperAppParent* AllocPExternalHelperApp(
|
2012-08-23 23:33:46 +04:00
|
|
|
const OptionalURIParams& aUri,
|
2010-09-16 02:55:08 +04:00
|
|
|
const nsCString& aMimeContentType,
|
|
|
|
const nsCString& aContentDisposition,
|
|
|
|
const bool& aForceSave,
|
2012-08-22 19:56:38 +04:00
|
|
|
const int64_t& aContentLength,
|
2012-08-23 23:33:46 +04:00
|
|
|
const OptionalURIParams& aReferrer);
|
2010-09-16 02:55:08 +04:00
|
|
|
virtual bool DeallocPExternalHelperApp(PExternalHelperAppParent* aService);
|
|
|
|
|
2011-11-21 02:40:53 +04:00
|
|
|
virtual PSmsParent* AllocPSms();
|
|
|
|
virtual bool DeallocPSms(PSmsParent*);
|
|
|
|
|
2010-11-19 04:15:23 +03:00
|
|
|
virtual PStorageParent* AllocPStorage(const StorageConstructData& aData);
|
|
|
|
virtual bool DeallocPStorage(PStorageParent* aActor);
|
|
|
|
|
2012-09-13 20:37:14 +04:00
|
|
|
virtual PBluetoothParent* AllocPBluetooth();
|
|
|
|
virtual bool DeallocPBluetooth(PBluetoothParent* aActor);
|
|
|
|
virtual bool RecvPBluetoothConstructor(PBluetoothParent* aActor);
|
|
|
|
|
2012-08-23 00:00:21 +04:00
|
|
|
virtual bool RecvReadPrefsArray(InfallibleTArray<PrefSetting>* aPrefs);
|
2011-01-13 07:04:42 +03:00
|
|
|
virtual bool RecvReadFontList(InfallibleTArray<FontListEntry>* retValue);
|
2010-05-28 22:09:15 +04:00
|
|
|
|
2010-11-09 05:49:00 +03:00
|
|
|
virtual bool RecvReadPermissions(InfallibleTArray<IPC::Permission>* aPermissions);
|
2011-04-30 03:46:20 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual bool RecvSetClipboardText(const nsString& text, const bool& isPrivateData, const int32_t& whichClipboard);
|
|
|
|
virtual bool RecvGetClipboardText(const int32_t& whichClipboard, nsString* text);
|
2011-03-01 08:36:43 +03:00
|
|
|
virtual bool RecvEmptyClipboard();
|
2011-09-29 10:19:26 +04:00
|
|
|
virtual bool RecvClipboardHasText(bool* hasText);
|
2010-05-26 04:13:47 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual bool RecvGetSystemColors(const uint32_t& colorsCount, InfallibleTArray<uint32_t>* colors);
|
|
|
|
virtual bool RecvGetIconForExtension(const nsCString& aFileExt, const uint32_t& aIconSize, InfallibleTArray<uint8_t>* bits);
|
2011-09-29 10:19:26 +04:00
|
|
|
virtual bool RecvGetShowPasswordSetting(bool* showPassword);
|
2011-03-30 22:04:41 +04:00
|
|
|
|
2012-08-23 23:33:46 +04:00
|
|
|
virtual bool RecvStartVisitedQuery(const URIParams& uri);
|
2010-07-02 19:50:41 +04:00
|
|
|
|
2012-08-23 23:33:46 +04:00
|
|
|
virtual bool RecvVisitURI(const URIParams& uri,
|
|
|
|
const OptionalURIParams& referrer,
|
2012-08-22 19:56:38 +04:00
|
|
|
const uint32_t& flags);
|
2010-07-02 19:50:24 +04:00
|
|
|
|
2012-08-23 23:33:46 +04:00
|
|
|
virtual bool RecvSetURITitle(const URIParams& uri,
|
2010-07-02 19:53:42 +04:00
|
|
|
const nsString& title);
|
2012-12-06 07:01:58 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual bool RecvShowFilePicker(const int16_t& mode,
|
|
|
|
const int16_t& selectedType,
|
2011-09-29 10:19:26 +04:00
|
|
|
const bool& addToRecentDocs,
|
2010-10-20 19:19:24 +04:00
|
|
|
const nsString& title,
|
|
|
|
const nsString& defaultFile,
|
|
|
|
const nsString& defaultExtension,
|
2010-11-09 05:49:00 +03:00
|
|
|
const InfallibleTArray<nsString>& filters,
|
|
|
|
const InfallibleTArray<nsString>& filterNames,
|
|
|
|
InfallibleTArray<nsString>* files,
|
2012-08-22 19:56:38 +04:00
|
|
|
int16_t* retValue,
|
2010-10-20 19:19:24 +04:00
|
|
|
nsresult* result);
|
2012-12-06 07:01:58 +04:00
|
|
|
|
2010-09-15 20:44:57 +04:00
|
|
|
virtual bool RecvShowAlertNotification(const nsString& aImageUrl, const nsString& aTitle,
|
2011-09-29 10:19:26 +04:00
|
|
|
const nsString& aText, const bool& aTextClickable,
|
2010-09-15 20:44:57 +04:00
|
|
|
const nsString& aCookie, const nsString& aName);
|
2010-07-02 19:53:42 +04:00
|
|
|
|
2012-08-23 23:33:46 +04:00
|
|
|
virtual bool RecvLoadURIExternal(const URIParams& uri);
|
2010-08-10 21:14:45 +04:00
|
|
|
|
2012-08-02 10:02:29 +04:00
|
|
|
virtual bool RecvSyncMessage(const nsString& aMsg,
|
|
|
|
const ClonedMessageData& aData,
|
2010-11-09 05:49:00 +03:00
|
|
|
InfallibleTArray<nsString>* aRetvals);
|
2012-08-02 10:02:29 +04:00
|
|
|
virtual bool RecvAsyncMessage(const nsString& aMsg,
|
|
|
|
const ClonedMessageData& aData);
|
2010-08-31 22:58:35 +04:00
|
|
|
|
2013-01-09 19:03:28 +04:00
|
|
|
virtual bool RecvFilePathUpdateNotify(const nsString& aType,
|
|
|
|
const nsString& aFilePath,
|
|
|
|
const nsCString& aReason);
|
|
|
|
|
2013-01-03 01:21:37 +04:00
|
|
|
virtual bool RecvAddGeolocationListener(const IPC::Principal& aPrincipal);
|
2010-11-05 20:43:13 +03:00
|
|
|
virtual bool RecvRemoveGeolocationListener();
|
2012-12-31 20:36:46 +04:00
|
|
|
virtual bool RecvSetGeolocationHigherAccuracy(const bool& aEnable);
|
2010-09-21 08:16:37 +04:00
|
|
|
|
2010-09-24 05:39:32 +04:00
|
|
|
virtual bool RecvConsoleMessage(const nsString& aMessage);
|
|
|
|
virtual bool RecvScriptError(const nsString& aMessage,
|
|
|
|
const nsString& aSourceName,
|
|
|
|
const nsString& aSourceLine,
|
2012-08-22 19:56:38 +04:00
|
|
|
const uint32_t& aLineNumber,
|
|
|
|
const uint32_t& aColNumber,
|
|
|
|
const uint32_t& aFlags,
|
2010-09-24 05:39:32 +04:00
|
|
|
const nsCString& aCategory);
|
|
|
|
|
2012-04-20 04:13:20 +04:00
|
|
|
virtual bool RecvPrivateDocShellsExist(const bool& aExist);
|
2012-08-02 10:32:04 +04:00
|
|
|
|
2012-10-09 08:46:19 +04:00
|
|
|
virtual bool RecvFirstIdle();
|
|
|
|
|
2012-12-06 07:01:58 +04:00
|
|
|
virtual bool RecvAudioChannelGetMuted(const AudioChannelType& aType,
|
2013-01-09 11:18:16 +04:00
|
|
|
const bool& aElementHidden,
|
|
|
|
const bool& aElementWasHidden,
|
2012-12-06 07:01:58 +04:00
|
|
|
bool* aValue);
|
|
|
|
|
|
|
|
virtual bool RecvAudioChannelRegisterType(const AudioChannelType& aType);
|
2013-01-09 11:18:16 +04:00
|
|
|
virtual bool RecvAudioChannelUnregisterType(const AudioChannelType& aType,
|
|
|
|
const bool& aElementHidden);
|
|
|
|
|
|
|
|
virtual bool RecvAudioChannelChangedNotification();
|
2012-12-06 07:01:58 +04:00
|
|
|
|
2012-12-15 04:01:34 +04:00
|
|
|
virtual bool RecvBroadcastVolume(const nsString& aVolumeName);
|
|
|
|
|
2013-01-25 06:45:36 +04:00
|
|
|
virtual bool RecvRecordingDeviceEvents(const nsString& aRecordingStatus);
|
|
|
|
|
2011-07-13 10:52:31 +04:00
|
|
|
virtual void ProcessingError(Result what) MOZ_OVERRIDE;
|
|
|
|
|
2009-09-03 04:18:27 +04:00
|
|
|
GeckoChildProcessHost* mSubprocess;
|
2013-02-08 18:32:23 +04:00
|
|
|
base::ChildPrivileges mOSPrivileges;
|
2010-02-02 04:53:52 +03:00
|
|
|
|
2012-11-17 19:05:18 +04:00
|
|
|
uint64_t mChildID;
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mGeolocationWatchID;
|
2010-02-02 04:53:52 +03:00
|
|
|
int mRunToCompletionDepth;
|
2010-03-30 00:29:45 +04:00
|
|
|
bool mShouldCallUnblockChild;
|
2010-02-02 04:53:52 +03:00
|
|
|
|
2011-02-16 21:43:23 +03:00
|
|
|
// This is a cache of all of the memory reporters
|
|
|
|
// registered in the child process. To update this, one
|
|
|
|
// can broadcast the topic "child-memory-reporter-request" using
|
|
|
|
// the nsIObserverService.
|
|
|
|
nsCOMArray<nsIMemoryReporter> mMemoryReporters;
|
|
|
|
|
2012-07-14 01:10:20 +04:00
|
|
|
const nsString mAppManifestURL;
|
2011-08-02 23:57:48 +04:00
|
|
|
nsRefPtr<nsFrameMessageManager> mMessageManager;
|
2011-06-08 23:56:31 +04:00
|
|
|
|
2013-01-10 17:22:14 +04:00
|
|
|
// After we initiate shutdown, we also start a timer to ensure
|
|
|
|
// that even content processes that are 100% blocked (say from
|
|
|
|
// SIGSTOP), are still killed eventually. This task enforces that
|
|
|
|
// timer.
|
|
|
|
CancelableTask* mForceKillTask;
|
|
|
|
// How many tabs we're waiting to finish their destruction
|
|
|
|
// sequence. Precisely, how many TabParents have called
|
|
|
|
// NotifyTabDestroying() but not called NotifyTabDestroyed().
|
|
|
|
int32_t mNumDestroyingTabs;
|
2012-11-28 00:43:52 +04:00
|
|
|
// True only while this is ready to be used to host remote tabs.
|
|
|
|
// This must not be used for new purposes after mIsAlive goes to
|
|
|
|
// false, but some previously scheduled IPC traffic may still pass
|
|
|
|
// through.
|
2012-09-05 04:36:16 +04:00
|
|
|
bool mIsAlive;
|
2012-11-28 00:43:52 +04:00
|
|
|
// True after the OS-level shutdown sequence has been initiated.
|
|
|
|
// After going true, any use of this at all, including lingering
|
|
|
|
// IPC traffic passing through, will cause assertions to fail.
|
|
|
|
bool mIsDestroyed;
|
2012-09-05 04:36:16 +04:00
|
|
|
bool mSendPermissionUpdates;
|
|
|
|
bool mIsForBrowser;
|
|
|
|
|
2011-06-08 23:56:31 +04:00
|
|
|
friend class CrashReporterParent;
|
2012-11-09 21:52:09 +04:00
|
|
|
|
|
|
|
nsRefPtr<nsConsoleService> mConsoleService;
|
2012-11-09 22:23:18 +04:00
|
|
|
nsConsoleService* GetConsoleService();
|
2009-08-12 20:18:08 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|