LCOV - code coverage report
Current view: directory - objdir/dist/include/mozilla/ipc - TestShellParent.h (source / functions) Found Hit Coverage
Test: app.info Lines: 1 0 0.0 %
Date: 2012-06-02 Functions: 1 0 0.0 %

       1                 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
       2                 :  * vim: sw=2 ts=8 et :
       3                 :  */
       4                 : /* ***** BEGIN LICENSE BLOCK *****
       5                 :  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
       6                 :  *
       7                 :  * The contents of this file are subject to the Mozilla Public License Version
       8                 :  * 1.1 (the "License"); you may not use this file except in compliance with
       9                 :  * the License. You may obtain a copy of the License at
      10                 :  * http://www.mozilla.org/MPL/
      11                 :  *
      12                 :  * Software distributed under the License is distributed on an "AS IS" basis,
      13                 :  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
      14                 :  * for the specific language governing rights and limitations under the
      15                 :  * License.
      16                 :  *
      17                 :  * The Original Code is Mozilla IPCShell.
      18                 :  *
      19                 :  * The Initial Developer of the Original Code is
      20                 :  *   Ben Turner <bent.mozilla@gmail.com>.
      21                 :  * Portions created by the Initial Developer are Copyright (C) 2009
      22                 :  * the Initial Developer. All Rights Reserved.
      23                 :  *
      24                 :  * Contributor(s):
      25                 :  *
      26                 :  * Alternatively, the contents of this file may be used under the terms of
      27                 :  * either the GNU General Public License Version 2 or later (the "GPL"), or
      28                 :  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
      29                 :  * in which case the provisions of the GPL or the LGPL are applicable instead
      30                 :  * of those above. If you wish to allow use of your version of this file only
      31                 :  * under the terms of either the GPL or the LGPL, and not to allow others to
      32                 :  * use your version of this file under the terms of the MPL, indicate your
      33                 :  * decision by deleting the provisions above and replace them with the notice
      34                 :  * and other provisions required by the GPL or the LGPL. If you do not delete
      35                 :  * the provisions above, a recipient may use your version of this file under
      36                 :  * the terms of any one of the MPL, the GPL or the LGPL.
      37                 :  *
      38                 :  * ***** END LICENSE BLOCK ***** */
      39                 : 
      40                 : #ifndef ipc_testshell_TestShellParent_h
      41                 : #define ipc_testshell_TestShellParent_h 1
      42                 : 
      43                 : #include "mozilla/ipc/PTestShellParent.h"
      44                 : #include "mozilla/ipc/PTestShellCommandParent.h"
      45                 : 
      46                 : #include "jsapi.h"
      47                 : #include "nsAutoJSValHolder.h"
      48                 : #include "nsStringGlue.h"
      49                 : 
      50                 : struct JSContext;
      51                 : struct JSObject;
      52                 : 
      53                 : namespace mozilla {
      54                 : 
      55                 : namespace jsipc {
      56                 : class PContextWrapperParent;
      57                 : }
      58                 : 
      59                 : namespace ipc {
      60                 : 
      61                 : class TestShellCommandParent;
      62                 : 
      63                 : class TestShellParent : public PTestShellParent
      64               0 : {
      65                 : public:
      66                 :   PTestShellCommandParent*
      67                 :   AllocPTestShellCommand(const nsString& aCommand);
      68                 : 
      69                 :   bool
      70                 :   DeallocPTestShellCommand(PTestShellCommandParent* aActor);
      71                 : 
      72                 :   bool
      73                 :   CommandDone(TestShellCommandParent* aActor, const nsString& aResponse);
      74                 : 
      75                 :   PContextWrapperParent* AllocPContextWrapper();
      76                 :   bool DeallocPContextWrapper(PContextWrapperParent* actor);
      77                 : 
      78                 :   JSBool GetGlobalJSObject(JSContext* cx, JSObject** globalp);
      79                 : };
      80                 : 
      81                 : 
      82                 : class TestShellCommandParent : public PTestShellCommandParent
      83                 : {
      84                 : public:
      85                 :   TestShellCommandParent() : mCx(NULL) { }
      86                 : 
      87                 :   JSBool SetCallback(JSContext* aCx,
      88                 :                      jsval aCallback);
      89                 : 
      90                 :   JSBool RunCallback(const nsString& aResponse);
      91                 : 
      92                 :   void ReleaseCallback();
      93                 : 
      94                 : protected:
      95                 :   bool ExecuteCallback(const nsString& aResponse);
      96                 : 
      97                 :   void ActorDestroy(ActorDestroyReason why);
      98                 :   
      99                 :   bool Recv__delete__(const nsString& aResponse) {
     100                 :     return ExecuteCallback(aResponse);
     101                 :   }
     102                 : 
     103                 : private:
     104                 :   JSContext* mCx;
     105                 :   nsAutoJSValHolder mCallback;
     106                 : };
     107                 : 
     108                 : 
     109                 : } /* namespace ipc */
     110                 : } /* namespace mozilla */
     111                 : 
     112                 : #endif /* ipc_testshell_TestShellParent_h */

Generated by: LCOV version 1.7