Commit 0ee66a7f authored by Andrew McCreight's avatar Andrew McCreight
Browse files

Bug 1497707, part 5 - Inline mozilla::ModuleLoader into mozJSComponentLoader. r=froydnj

Now that the XPCOM component loader infrastructure has stopped
pretending to support other file extensions, this intermediate
interface is no longer needed.

Depends on D8171

Differential Revision: https://phabricator.services.mozilla.com/D8172

--HG--
extra : moz-landing-system : lando
parent f7cab62d
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -315,7 +315,6 @@ mozJSComponentLoader*
mozJSComponentLoader::sSelf;

NS_IMPL_ISUPPORTS(mozJSComponentLoader,
                  mozilla::ModuleLoader,
                  nsIObserver)

nsresult
+4 −5
Original line number Diff line number Diff line
@@ -8,8 +8,9 @@
#define mozJSComponentLoader_h

#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/FileLocation.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/ModuleLoader.h"
#include "mozilla/Module.h"
#include "nsAutoPtr.h"
#include "nsISupports.h"
#include "nsIObserver.h"
@@ -40,8 +41,7 @@ namespace mozilla {
#define STARTUP_RECORDER_ENABLED
#endif

class mozJSComponentLoader final : public mozilla::ModuleLoader,
                                   public nsIObserver
class mozJSComponentLoader final : public nsIObserver
{
 public:
    NS_DECL_ISUPPORTS
@@ -54,8 +54,7 @@ class mozJSComponentLoader final : public mozilla::ModuleLoader,
    nsresult GetModuleImportStack(const nsACString& aLocation, nsACString& aRetval);
    nsresult GetComponentLoadStack(const nsACString& aLocation, nsACString& aRetval);

    // ModuleLoader
    const mozilla::Module* LoadModule(mozilla::FileLocation& aFile) override;
    const mozilla::Module* LoadModule(mozilla::FileLocation& aFile);

    void FindTargetObject(JSContext* aCx,
                          JS::MutableHandleObject aTargetObject);

xpcom/components/ModuleLoader.h

deleted100644 → 0
+0 −44
Original line number Diff line number Diff line
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */

#ifndef mozilla_ModuleLoader_h
#define mozilla_ModuleLoader_h

#include "nsISupports.h"
#include "mozilla/Module.h"
#include "mozilla/FileLocation.h"

#define MOZILLA_MODULELOADER_PSEUDO_IID \
{ 0xD951A8CE, 0x6E9F, 0x464F, \
  { 0x8A, 0xC8, 0x14, 0x61, 0xC0, 0xD3, 0x63, 0xC8 } }

namespace mozilla {

/**
 * Module loaders are responsible for loading a component file. The static
 * component loader is special and does not use this abstract interface.
 *
 * @note Implementations of this interface should be threadsafe,
 *       methods may be called from any thread.
 */
class ModuleLoader : public nsISupports
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_MODULELOADER_PSEUDO_IID)

  /**
   * Return the module for a specified file. The caller should cache
   * the module: the implementer should not expect for the same file
   * to be loaded multiple times. The Module object should either be
   * statically or permanently allocated; it will not be freed.
   */
  virtual const Module* LoadModule(mozilla::FileLocation& aFile) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(ModuleLoader, MOZILLA_MODULELOADER_PSEUDO_IID)

} // namespace mozilla

#endif // mozilla_ModuleLoader_h
+0 −1
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ EXPORTS += [
EXPORTS.mozilla += [
    'GenericFactory.h',
    'Module.h',
    'ModuleLoader.h',
    'ModuleUtils.h',
]

+0 −1
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@
#include "mozilla/Atomics.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/Module.h"
#include "mozilla/ModuleLoader.h"
#include "mozilla/Mutex.h"
#include "nsXULAppAPI.h"
#include "nsIFactory.h"