LCOV - code coverage report
Current view: top level - dom/workers - RegisterBindings.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 7 16 43.8 %
Date: 2017-07-14 16:53:18 Functions: 1 2 50.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
       2             : /* vim: set ts=8 sts=2 et sw=2 tw=80: */
       3             : /* This Source Code Form is subject to the terms of the Mozilla Public
       4             :  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
       5             :  * You can obtain one at http://mozilla.org/MPL/2.0/. */
       6             : 
       7             : #include "WorkerPrivate.h"
       8             : #include "ChromeWorkerScope.h"
       9             : #include "RuntimeService.h"
      10             : 
      11             : #include "jsapi.h"
      12             : #include "mozilla/dom/RegisterWorkerBindings.h"
      13             : #include "mozilla/dom/RegisterWorkerDebuggerBindings.h"
      14             : #include "mozilla/OSFileConstants.h"
      15             : 
      16             : USING_WORKERS_NAMESPACE
      17             : using namespace mozilla::dom;
      18             : 
      19             : bool
      20           1 : WorkerPrivate::RegisterBindings(JSContext* aCx, JS::Handle<JSObject*> aGlobal)
      21             : {
      22             :   // Init Web IDL bindings
      23           1 :   if (!RegisterWorkerBindings(aCx, aGlobal)) {
      24           0 :     return false;
      25             :   }
      26             : 
      27           1 :   if (IsChromeWorker()) {
      28           2 :     if (!DefineChromeWorkerFunctions(aCx, aGlobal) ||
      29           1 :         !DefineOSFileConstants(aCx, aGlobal)) {
      30           0 :       return false;
      31             :     }
      32             :   }
      33             : 
      34           1 :   if (!JS_DefineProfilingFunctions(aCx, aGlobal)) {
      35           0 :     return false;
      36             :   }
      37             : 
      38           1 :   return true;
      39             : }
      40             : 
      41             : bool
      42           0 : WorkerPrivate::RegisterDebuggerBindings(JSContext* aCx,
      43             :                                         JS::Handle<JSObject*> aGlobal)
      44             : {
      45             :   // Init Web IDL bindings
      46           0 :   if (!RegisterWorkerDebuggerBindings(aCx, aGlobal)) {
      47           0 :     return false;
      48             :   }
      49             : 
      50           0 :   if (!JS_DefineDebuggerObject(aCx, aGlobal)) {
      51           0 :     return false;
      52             :   }
      53             : 
      54           0 :   return true;
      55             : }

Generated by: LCOV version 1.13