tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

ReportInternalError.h (1403B)


      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
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef mozilla_dom_indexeddb_reportinternalerror_h__
      8 #define mozilla_dom_indexeddb_reportinternalerror_h__
      9 
     10 #include "IndexedDatabase.h"
     11 #include "nsDebug.h"
     12 #include "nsPrintfCString.h"
     13 
     14 #define IDB_WARNING(...)                                                       \
     15  do {                                                                         \
     16    nsPrintfCString s(__VA_ARGS__);                                            \
     17    mozilla::dom::indexedDB::ReportInternalError(__FILE__, __LINE__, s.get()); \
     18    NS_WARNING(s.get());                                                       \
     19  } while (0)
     20 
     21 #define IDB_REPORT_INTERNAL_ERR() \
     22  mozilla::dom::indexedDB::ReportInternalError(__FILE__, __LINE__, "UnknownErr")
     23 
     24 #define IDB_REPORT_INTERNAL_ERR_LAMBDA \
     25  [](const auto&) { IDB_REPORT_INTERNAL_ERR(); }
     26 
     27 namespace mozilla::dom::indexedDB {
     28 
     29 MOZ_COLD void ReportInternalError(const char* aFile, uint32_t aLine,
     30                                  const char* aStr);
     31 
     32 }  // namespace mozilla::dom::indexedDB
     33 
     34 #endif  // mozilla_dom_indexeddb_reportinternalerror_h__