dom/base/ChromeUtils.h
author Birunthan Mohanathas <birunthan@mohanathas.com>
Mon, 13 Jul 2015 08:25:42 -0700
changeset 252629 91d6e262b662a0b4e47358665e222d3927337af9
parent 250170 dc2547747a19d98199737f14460edb145358378a
child 252950 696c6303dcd69c3dcc7a8ff8b9e5965ca4c94c12
permissions -rw-r--r--
Bug 1182996 - Fix and add missing namespace comments. rs=ehsan The bulk of this commit was generated by running: run-clang-tidy.py \ -checks='-*,llvm-namespace-comment' \ -header-filter=^/.../mozilla-central/.* \ -fix

/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
/* 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_dom_ChromeUtils__
#define mozilla_dom_ChromeUtils__

#include "mozilla/AlreadyAddRefed.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/ChromeUtilsBinding.h"
#include "mozilla/dom/ThreadSafeChromeUtilsBinding.h"
#include "mozilla/ErrorResult.h"

namespace mozilla {

namespace devtools {
class HeapSnapshot;
} // namespace devtools

namespace dom {

class ThreadSafeChromeUtils
{
public:
  // Implemented in toolkit/devtools/server/HeapSnapshot.cpp
  static void SaveHeapSnapshot(GlobalObject& global,
                               JSContext* cx,
                               const nsAString& filePath,
                               const HeapSnapshotBoundaries& boundaries,
                               ErrorResult& rv);

  // Implemented in toolkit/devtools/server/HeapSnapshot.cpp
  static already_AddRefed<devtools::HeapSnapshot> ReadHeapSnapshot(GlobalObject& global,
                                                                   JSContext* cx,
                                                                   const nsAString& filePath,
                                                                   ErrorResult& rv);
};

class ChromeUtils : public ThreadSafeChromeUtils
{
public:
  static void
  OriginAttributesToCookieJar(dom::GlobalObject& aGlobal,
                              const dom::OriginAttributesDictionary& aAttrs,
                              nsCString& aCookieJar);

  static void
  OriginAttributesToSuffix(dom::GlobalObject& aGlobal,
                           const dom::OriginAttributesDictionary& aAttrs,
                           nsCString& aSuffix);
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_ChromeUtils__