Bug 1673660 - Move FOG C++ and JS API scaffolding headers to subdir r=janerik
authorChris H-C <chutten@mozilla.com>
Mon, 14 Dec 2020 16:49:43 +0000
changeset 560678 551fd43769cad9f5242b8faaa31292a7b8526523
parent 560677 ed77ed36df18eeab70127b9bf1600c65a070e871
child 560679 f6c62f38a583ef1b7f33d7484afae6f6bf1eb031
push id132752
push userchutten@mozilla.com
push dateMon, 14 Dec 2020 19:51:33 +0000
treeherderautoland@f6c62f38a583 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjanerik
bugs1673660
milestone85.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1673660 - Move FOG C++ and JS API scaffolding headers to subdir r=janerik Headers we want our consumers to use remain in mozilla/glean, but scaffolding now lives in mozilla/glean/bindings. This will allow me to have a binding for the GleanPings global in GleanPings.h AS WELL AS a GleanPings.h which is the C++ consumer API for custom pings. Differential Revision: https://phabricator.services.mozilla.com/D98670
dom/base/nsGlobalWindowInner.h
dom/bindings/Bindings.conf
js/xpconnect/src/Sandbox.cpp
toolkit/components/glean/bindings/Category.cpp
toolkit/components/glean/bindings/Glean.cpp
toolkit/components/glean/bindings/Glean.h
toolkit/components/glean/bindings/MetricTypes.h
toolkit/components/glean/bindings/private/Boolean.cpp
toolkit/components/glean/bindings/private/Counter.cpp
toolkit/components/glean/bindings/private/Datetime.cpp
toolkit/components/glean/bindings/private/Event.cpp
toolkit/components/glean/bindings/private/MemoryDistribution.cpp
toolkit/components/glean/bindings/private/String.cpp
toolkit/components/glean/bindings/private/Timespan.cpp
toolkit/components/glean/bindings/private/Uuid.cpp
toolkit/components/glean/build_scripts/glean_parser_ext/templates/cpp.jinja2
toolkit/components/glean/build_scripts/glean_parser_ext/templates/js.jinja2
toolkit/components/glean/moz.build
toolkit/components/glean/pytest/metrics_test_output_cpp
toolkit/components/glean/pytest/metrics_test_output_js
--- a/dom/base/nsGlobalWindowInner.h
+++ b/dom/base/nsGlobalWindowInner.h
@@ -46,17 +46,17 @@
 #include "mozilla/LinkedList.h"
 #include "mozilla/OwningNonNull.h"
 #include "mozilla/TimeStamp.h"
 #include "nsWrapperCacheInlines.h"
 #include "mozilla/dom/EventTarget.h"
 #include "mozilla/dom/WindowBinding.h"
 #include "mozilla/dom/WindowProxyHolder.h"
 #ifdef MOZ_GLEAN
-#  include "mozilla/glean/Glean.h"
+#  include "mozilla/glean/bindings/Glean.h"
 #endif
 #include "Units.h"
 #include "nsComponentManagerUtils.h"
 #include "nsSize.h"
 #include "nsCheapSets.h"
 #include "mozilla/dom/ImageBitmapSource.h"
 #include "mozilla/UniquePtr.h"
 #include "nsRefreshObservers.h"
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -1457,21 +1457,21 @@ DOMInterfaces = {
 'GPUVertexFormat': {
     'concrete': False,
 },
 
 # Glean
 
 'GleanImpl': {
     'nativeType': 'mozilla::glean::Glean',
-    'headerFile': 'mozilla/glean/Glean.h',
+    'headerFile': 'mozilla/glean/bindings/Glean.h',
 },
 'GleanCategory': {
     'nativeType': 'mozilla::glean::Category',
-    'headerFile': 'mozilla/glean/Category.h',
+    'headerFile': 'mozilla/glean/bindings/Category.h',
 },
 
 # WebRTC
 
 'WebrtcGlobalInformation': {
     'nativeType': 'mozilla::dom::WebrtcGlobalInformation',
     'headerFile': 'WebrtcGlobalInformation.h',
 },
--- a/js/xpconnect/src/Sandbox.cpp
+++ b/js/xpconnect/src/Sandbox.cpp
@@ -72,17 +72,17 @@
 #include "mozilla/dom/UnionConversions.h"
 #include "mozilla/dom/URLBinding.h"
 #include "mozilla/dom/URLSearchParamsBinding.h"
 #include "mozilla/dom/XMLHttpRequest.h"
 #include "mozilla/dom/XMLSerializerBinding.h"
 #include "mozilla/dom/FormDataBinding.h"
 #include "mozilla/dom/nsCSPContext.h"
 #ifdef MOZ_GLEAN
-#  include "mozilla/glean/Glean.h"
+#  include "mozilla/glean/bindings/Glean.h"
 #endif
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/DeferredFinalize.h"
 #include "mozilla/ExtensionPolicyService.h"
 #include "mozilla/NullPrincipal.h"
 #include "mozilla/ResultExtensions.h"
 #include "mozilla/StaticPrefs_extensions.h"
 
--- a/toolkit/components/glean/bindings/Category.cpp
+++ b/toolkit/components/glean/bindings/Category.cpp
@@ -1,18 +1,18 @@
 /* -*- 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/. */
 
-#include "mozilla/glean/Glean.h"
-#include "mozilla/glean/Category.h"
 #include "mozilla/dom/GleanBinding.h"
-#include "mozilla/glean/GleanJSMetricsLookup.h"
+#include "mozilla/glean/bindings/Glean.h"
+#include "mozilla/glean/bindings/Category.h"
+#include "mozilla/glean/bindings/GleanJSMetricsLookup.h"
 
 namespace mozilla::glean {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(Category)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(Category)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(Category)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Category)
--- a/toolkit/components/glean/bindings/Glean.cpp
+++ b/toolkit/components/glean/bindings/Glean.cpp
@@ -2,19 +2,19 @@
 /* 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/. */
 
 #include "mozilla/dom/DOMJSClass.h"
 #include "mozilla/dom/GleanBinding.h"
 #include "mozilla/dom/BindingUtils.h"
-#include "mozilla/glean/Glean.h"
-#include "mozilla/glean/Category.h"
-#include "mozilla/glean/GleanJSMetricsLookup.h"
+#include "mozilla/glean/bindings/Glean.h"
+#include "mozilla/glean/bindings/Category.h"
+#include "mozilla/glean/bindings/GleanJSMetricsLookup.h"
 #include "MainThreadUtils.h"
 
 namespace mozilla::glean {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(Glean)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(Glean)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(Glean)
--- a/toolkit/components/glean/bindings/Glean.h
+++ b/toolkit/components/glean/bindings/Glean.h
@@ -3,19 +3,19 @@
 /* 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_glean_Glean_h
 #define mozilla_glean_Glean_h
 
 #include "mozilla/dom/BindingDeclarations.h"
+#include "mozilla/glean/bindings/Category.h"
 #include "nsISupports.h"
 #include "nsWrapperCache.h"
-#include "mozilla/glean/Category.h"
 
 namespace mozilla::glean {
 
 class Glean final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Glean)
 
--- a/toolkit/components/glean/bindings/MetricTypes.h
+++ b/toolkit/components/glean/bindings/MetricTypes.h
@@ -1,17 +1,17 @@
 /* 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_Glean_MetricTypes_h
 #define mozilla_Glean_MetricTypes_h
 
-#include "mozilla/glean/Boolean.h"
-#include "mozilla/glean/Counter.h"
-#include "mozilla/glean/Datetime.h"
-#include "mozilla/glean/Event.h"
-#include "mozilla/glean/MemoryDistribution.h"
-#include "mozilla/glean/Timespan.h"
-#include "mozilla/glean/String.h"
-#include "mozilla/glean/Uuid.h"
+#include "mozilla/glean/bindings/Boolean.h"
+#include "mozilla/glean/bindings/Counter.h"
+#include "mozilla/glean/bindings/Datetime.h"
+#include "mozilla/glean/bindings/Event.h"
+#include "mozilla/glean/bindings/MemoryDistribution.h"
+#include "mozilla/glean/bindings/Timespan.h"
+#include "mozilla/glean/bindings/String.h"
+#include "mozilla/glean/bindings/Uuid.h"
 
 #endif  // mozilla_Glean_MetricTypes_h
--- a/toolkit/components/glean/bindings/private/Boolean.cpp
+++ b/toolkit/components/glean/bindings/private/Boolean.cpp
@@ -1,15 +1,15 @@
 /* -*- 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/. */
 
-#include "mozilla/glean/Boolean.h"
+#include "mozilla/glean/bindings/Boolean.h"
 
 #include "nsString.h"
 #include "mozilla/Components.h"
 #include "nsIClassInfoImpl.h"
 
 namespace mozilla {
 namespace glean {
 
--- a/toolkit/components/glean/bindings/private/Counter.cpp
+++ b/toolkit/components/glean/bindings/private/Counter.cpp
@@ -1,15 +1,15 @@
 /* -*- 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/. */
 
-#include "mozilla/glean/Counter.h"
+#include "mozilla/glean/bindings/Counter.h"
 
 #include "nsString.h"
 #include "mozilla/Components.h"
 #include "nsIClassInfoImpl.h"
 
 namespace mozilla::glean {
 
 NS_IMPL_CLASSINFO(GleanCounter, nullptr, 0, {0})
--- a/toolkit/components/glean/bindings/private/Datetime.cpp
+++ b/toolkit/components/glean/bindings/private/Datetime.cpp
@@ -1,15 +1,15 @@
 /* -*- 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/. */
 
-#include "mozilla/glean/Datetime.h"
+#include "mozilla/glean/bindings/Datetime.h"
 
 #include "nsString.h"
 #include "mozilla/Components.h"
 #include "nsIClassInfoImpl.h"
 #include "prtime.h"
 
 namespace mozilla::glean {
 
--- a/toolkit/components/glean/bindings/private/Event.cpp
+++ b/toolkit/components/glean/bindings/private/Event.cpp
@@ -1,15 +1,15 @@
 /* -*- 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/. */
 
-#include "mozilla/glean/Event.h"
+#include "mozilla/glean/bindings/Event.h"
 
 #include "Common.h"
 #include "nsString.h"
 #include "mozilla/Components.h"
 #include "nsIClassInfoImpl.h"
 #include "jsapi.h"
 #include "nsIScriptError.h"
 
--- a/toolkit/components/glean/bindings/private/MemoryDistribution.cpp
+++ b/toolkit/components/glean/bindings/private/MemoryDistribution.cpp
@@ -1,15 +1,15 @@
 /* -*- 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/. */
 
-#include "mozilla/glean/MemoryDistribution.h"
+#include "mozilla/glean/bindings/MemoryDistribution.h"
 
 #include "mozilla/Components.h"
 #include "nsIClassInfoImpl.h"
 #include "nsJSUtils.h"
 #include "nsPrintfCString.h"
 #include "nsString.h"
 
 namespace mozilla::glean {
--- a/toolkit/components/glean/bindings/private/String.cpp
+++ b/toolkit/components/glean/bindings/private/String.cpp
@@ -1,15 +1,15 @@
 /* -*- 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/. */
 
-#include "mozilla/glean/String.h"
+#include "mozilla/glean/bindings/String.h"
 
 #include "nsString.h"
 #include "mozilla/Components.h"
 #include "nsIClassInfoImpl.h"
 
 namespace mozilla::glean {
 
 NS_IMPL_CLASSINFO(GleanString, nullptr, 0, {0})
--- a/toolkit/components/glean/bindings/private/Timespan.cpp
+++ b/toolkit/components/glean/bindings/private/Timespan.cpp
@@ -1,15 +1,15 @@
 /* -*- 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/. */
 
-#include "mozilla/glean/Timespan.h"
+#include "mozilla/glean/bindings/Timespan.h"
 
 #include "nsString.h"
 #include "mozilla/Components.h"
 #include "nsIClassInfoImpl.h"
 
 namespace mozilla::glean {
 
 NS_IMPL_CLASSINFO(GleanTimespan, nullptr, 0, {0})
--- a/toolkit/components/glean/bindings/private/Uuid.cpp
+++ b/toolkit/components/glean/bindings/private/Uuid.cpp
@@ -1,15 +1,15 @@
 /* -*- 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/. */
 
-#include "mozilla/glean/Uuid.h"
+#include "mozilla/glean/bindings/Uuid.h"
 
 #include "nsString.h"
 #include "mozilla/Components.h"
 #include "nsIClassInfoImpl.h"
 
 namespace mozilla::glean {
 
 NS_IMPL_CLASSINFO(GleanUuid, nullptr, 0, {0})
--- a/toolkit/components/glean/build_scripts/glean_parser_ext/templates/cpp.jinja2
+++ b/toolkit/components/glean/build_scripts/glean_parser_ext/templates/cpp.jinja2
@@ -6,17 +6,17 @@ Jinja2 template is not. Please file bugs
 
 /* 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_Metrics_h
 #define mozilla_Metrics_h
 
-#include "mozilla/glean/MetricTypes.h"
+#include "mozilla/glean/bindings/MetricTypes.h"
 
 namespace mozilla::glean {
 
 enum class NoExtraKeys {};
 
 {% macro generate_extra_keys(obj) %}
 {% for name, suffix in obj["_generate_enums"] %}
 {% if obj|attr(name)|length %}
--- a/toolkit/components/glean/build_scripts/glean_parser_ext/templates/js.jinja2
+++ b/toolkit/components/glean/build_scripts/glean_parser_ext/templates/js.jinja2
@@ -8,17 +8,17 @@ Jinja2 template is not. Please file bugs
  * 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_GleanJSMetricsLookup_h
 #define mozilla_GleanJSMetricsLookup_h
 
 #include "mozilla/PerfectHash.h"
 #include "mozilla/Maybe.h"
-#include "mozilla/glean/MetricTypes.h"
+#include "mozilla/glean/bindings/MetricTypes.h"
 
 #define GLEAN_INDEX_BITS ({{index_bits}})
 #define GLEAN_ID_BITS ({{id_bits}})
 #define GLEAN_TYPE_ID(id) ((id) >> GLEAN_ID_BITS)
 #define GLEAN_METRIC_ID(id) ((id) & ((1ULL << GLEAN_ID_BITS) - 1))
 #define GLEAN_OFFSET(entry) (entry & ((1ULL << GLEAN_INDEX_BITS) - 1))
 
 namespace mozilla::glean {
--- a/toolkit/components/glean/moz.build
+++ b/toolkit/components/glean/moz.build
@@ -18,18 +18,21 @@ if CONFIG["MOZ_GLEAN"]:
 
     FINAL_LIBRARY = "xul"
 
     EXPORTS.mozilla += [
         "ipc/FOGIPC.h",
     ]
 
     EXPORTS.mozilla.glean += [
+        "!GleanMetrics.h",
+    ]
+
+    EXPORTS.mozilla.glean.bindings += [
         "!GleanJSMetricsLookup.h",
-        "!GleanMetrics.h",
         "bindings/Category.h",
         "bindings/Glean.h",
         "bindings/MetricTypes.h",
         "bindings/private/Boolean.h",
         "bindings/private/Counter.h",
         "bindings/private/Datetime.h",
         "bindings/private/Event.h",
         "bindings/private/MemoryDistribution.h",
--- a/toolkit/components/glean/pytest/metrics_test_output_cpp
+++ b/toolkit/components/glean/pytest/metrics_test_output_cpp
@@ -4,17 +4,17 @@
 
 /* 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_Metrics_h
 #define mozilla_Metrics_h
 
-#include "mozilla/glean/MetricTypes.h"
+#include "mozilla/glean/bindings/MetricTypes.h"
 
 namespace mozilla::glean {
 
 enum class NoExtraKeys {};
 
 
 namespace test {
     /**
--- a/toolkit/components/glean/pytest/metrics_test_output_js
+++ b/toolkit/components/glean/pytest/metrics_test_output_js
@@ -6,17 +6,17 @@
  * 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_GleanJSMetricsLookup_h
 #define mozilla_GleanJSMetricsLookup_h
 
 #include "mozilla/PerfectHash.h"
 #include "mozilla/Maybe.h"
-#include "mozilla/glean/MetricTypes.h"
+#include "mozilla/glean/bindings/MetricTypes.h"
 
 #define GLEAN_INDEX_BITS (32)
 #define GLEAN_ID_BITS (27)
 #define GLEAN_TYPE_ID(id) ((id) >> GLEAN_ID_BITS)
 #define GLEAN_METRIC_ID(id) ((id) & ((1ULL << GLEAN_ID_BITS) - 1))
 #define GLEAN_OFFSET(entry) (entry & ((1ULL << GLEAN_INDEX_BITS) - 1))
 
 namespace mozilla::glean {