2009-08-18 12:05:15 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* vim: set sw=4 ts=8 et tw=80 : */
|
2009-09-09 15:00:14 -07:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is Mozilla Content App.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* The Mozilla Foundation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2009
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
2010-05-25 17:13:47 -07:00
|
|
|
* Frederic Plourde <frederic.plourde@collabora.co.uk>
|
2009-09-09 15:00:14 -07:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2009-08-12 09:18:08 -07:00
|
|
|
|
2010-07-19 11:33:33 -07:00
|
|
|
#ifndef mozilla_dom_ContentChild_h
|
|
|
|
#define mozilla_dom_ContentChild_h
|
2009-08-12 09:18:08 -07:00
|
|
|
|
2010-07-19 11:33:33 -07:00
|
|
|
#include "mozilla/dom/PContentChild.h"
|
2009-08-12 09:18:08 -07:00
|
|
|
|
2009-08-25 16:07:22 -07:00
|
|
|
#include "nsTArray.h"
|
|
|
|
|
2010-03-10 21:33:00 -08:00
|
|
|
struct ChromePackage;
|
2010-07-21 11:42:32 -07:00
|
|
|
class nsIObserver;
|
2010-03-10 21:33:00 -08:00
|
|
|
struct ResourceMapping;
|
|
|
|
struct OverrideMapping;
|
|
|
|
|
2009-08-12 09:18:08 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2010-07-21 11:42:32 -07:00
|
|
|
class PrefObserver;
|
|
|
|
|
2010-07-19 11:33:33 -07:00
|
|
|
class ContentChild : public PContentChild
|
2009-08-12 09:18:08 -07:00
|
|
|
{
|
|
|
|
public:
|
2010-07-19 11:33:33 -07:00
|
|
|
ContentChild();
|
|
|
|
virtual ~ContentChild();
|
2009-08-12 09:18:08 -07:00
|
|
|
|
2009-10-27 14:52:37 -07:00
|
|
|
bool Init(MessageLoop* aIOLoop,
|
|
|
|
base::ProcessHandle aParentHandle,
|
|
|
|
IPC::Channel* aChannel);
|
2009-08-12 09:18:08 -07:00
|
|
|
|
2010-07-19 11:33:33 -07:00
|
|
|
static ContentChild* GetSingleton() {
|
2009-08-12 17:32:50 -07:00
|
|
|
NS_ASSERTION(sSingleton, "not initialized");
|
|
|
|
return sSingleton;
|
|
|
|
}
|
|
|
|
|
2010-03-24 03:47:18 -07:00
|
|
|
/* if you remove this, please talk to cjones or dougt */
|
|
|
|
virtual bool RecvDummy(Shmem& foo) { return true; }
|
|
|
|
|
2010-07-19 11:33:33 -07:00
|
|
|
virtual PBrowserChild* AllocPBrowser(const PRUint32& aChromeFlags);
|
2010-07-19 11:33:33 -07:00
|
|
|
virtual bool DeallocPBrowser(PBrowserChild*);
|
2009-08-12 09:18:08 -07:00
|
|
|
|
2009-09-22 10:31:11 -07:00
|
|
|
virtual PTestShellChild* AllocPTestShell();
|
|
|
|
virtual bool DeallocPTestShell(PTestShellChild*);
|
2009-11-06 12:43:39 -08:00
|
|
|
virtual bool RecvPTestShellConstructor(PTestShellChild*);
|
2009-08-25 16:07:22 -07:00
|
|
|
|
2009-09-22 10:31:11 -07:00
|
|
|
virtual PNeckoChild* AllocPNecko();
|
|
|
|
virtual bool DeallocPNecko(PNeckoChild*);
|
2009-08-18 12:05:15 -07:00
|
|
|
|
2010-03-10 21:33:00 -08:00
|
|
|
virtual bool RecvRegisterChrome(const nsTArray<ChromePackage>& packages,
|
|
|
|
const nsTArray<ResourceMapping>& resources,
|
|
|
|
const nsTArray<OverrideMapping>& overrides);
|
|
|
|
|
2010-05-11 05:44:12 -07:00
|
|
|
virtual bool RecvSetOffline(const PRBool& offline);
|
|
|
|
|
2010-07-21 11:42:32 -07:00
|
|
|
/**
|
|
|
|
* Notify |aObserver| of changes to |aPrefRoot|.|aDomain|. If
|
|
|
|
* |aHoldWeak|, only a weak reference to |aObserver| is held.
|
|
|
|
*/
|
|
|
|
nsresult AddRemotePrefObserver(const nsCString& aDomain,
|
|
|
|
const nsCString& aPrefRoot,
|
|
|
|
nsIObserver* aObserver, PRBool aHoldWeak);
|
|
|
|
nsresult RemoveRemotePrefObserver(const nsCString& aDomain,
|
|
|
|
const nsCString& aPrefRoot,
|
|
|
|
nsIObserver* aObserver);
|
2010-05-25 17:13:47 -07:00
|
|
|
|
|
|
|
virtual bool RecvNotifyRemotePrefObserver(
|
|
|
|
const nsCString& aDomain);
|
|
|
|
|
2009-12-06 22:03:49 -08:00
|
|
|
private:
|
|
|
|
NS_OVERRIDE
|
|
|
|
virtual void ActorDestroy(ActorDestroyReason why);
|
|
|
|
|
2010-07-21 11:42:32 -07:00
|
|
|
nsTArray<nsAutoPtr<PrefObserver> > mPrefObservers;
|
|
|
|
bool mDead;
|
2009-08-12 17:32:50 -07:00
|
|
|
|
2010-07-21 11:42:32 -07:00
|
|
|
static ContentChild* sSingleton;
|
2010-05-25 17:13:47 -07:00
|
|
|
|
2010-07-19 11:33:33 -07:00
|
|
|
DISALLOW_EVIL_CONSTRUCTORS(ContentChild);
|
2009-08-12 09:18:08 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|