Bug 1545351 - Add some missing namespaces in macros - r=mstange
authorGerald Squelart <gsquelart@mozilla.com>
Mon, 29 Apr 2019 06:33:26 +0000
changeset 530529 e75bfefbe44260b79d057374184329bb19068a4f
parent 530528 ee37c856a47e46f3f548cef19d64b581119188fb
child 530530 2a26f848ec318a586ebe478651b0e20d72afc337
child 530532 0afabdb9bf0445c54b50f3fe03b548c51b2017ba
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1545351
milestone68.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 1545351 - Add some missing namespaces in macros - r=mstange Some macros would not work if they were used in a context where `namespace mozilla` is not directly accessible. Fixed by added appropriate `mozilla::` specifiers. Differential Revision: https://phabricator.services.mozilla.com/D28028
tools/profiler/public/GeckoProfiler.h
--- a/tools/profiler/public/GeckoProfiler.h
+++ b/tools/profiler/public/GeckoProfiler.h
@@ -560,17 +560,17 @@ mozilla::Maybe<ProfilerBufferInfo> profi
 //
 // Note: The use of the Maybe<>s ensures the scopes for the dynamic string and
 // the AutoProfilerLabel are appropriate, while also not incurring the runtime
 // cost of the string assignment unless the profiler is active. Therefore,
 // unlike AUTO_PROFILER_LABEL and AUTO_PROFILER_LABEL_DYNAMIC_CSTR, this macro
 // doesn't push/pop a label when the profiler is inactive.
 #  define AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING(label, categoryPair, nsCStr) \
     mozilla::Maybe<nsAutoCString> autoCStr;                                  \
-    mozilla::Maybe<AutoProfilerLabel> raiiObjectNsCString;                   \
+    mozilla::Maybe<mozilla::AutoProfilerLabel> raiiObjectNsCString;          \
     if (profiler_is_active()) {                                              \
       autoCStr.emplace(nsCStr);                                              \
       raiiObjectNsCString.emplace(label, autoCStr->get(),                    \
                                   JS::ProfilingCategoryPair::categoryPair);  \
     }
 
 // Similar to AUTO_PROFILER_LABEL_DYNAMIC_CSTR, but takes an nsString that is
 // is lossily converted to an ASCII string.
@@ -578,17 +578,17 @@ mozilla::Maybe<ProfilerBufferInfo> profi
 // Note: The use of the Maybe<>s ensures the scopes for the converted dynamic
 // string and the AutoProfilerLabel are appropriate, while also not incurring
 // the runtime cost of the string conversion unless the profiler is active.
 // Therefore, unlike AUTO_PROFILER_LABEL and AUTO_PROFILER_LABEL_DYNAMIC_CSTR,
 // this macro doesn't push/pop a label when the profiler is inactive.
 #  define AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING(label, categoryPair,   \
                                                      nsStr)                 \
     mozilla::Maybe<NS_LossyConvertUTF16toASCII> asciiStr;                   \
-    mozilla::Maybe<AutoProfilerLabel> raiiObjectLossyNsString;              \
+    mozilla::Maybe<mozilla::AutoProfilerLabel> raiiObjectLossyNsString;     \
     if (profiler_is_active()) {                                             \
       asciiStr.emplace(nsStr);                                              \
       raiiObjectLossyNsString.emplace(                                      \
           label, asciiStr->get(), JS::ProfilingCategoryPair::categoryPair); \
     }
 
 // Similar to AUTO_PROFILER_LABEL, but accepting a JSContext* parameter, and a
 // no-op if the profiler is disabled.
@@ -649,31 +649,31 @@ void profiler_add_network_marker(
 
 enum TracingKind {
   TRACING_EVENT,
   TRACING_INTERVAL_START,
   TRACING_INTERVAL_END,
 };
 
 // Helper macro to retrieve DocShellId and DocShellHistoryId from docShell
-#  define DECLARE_DOCSHELL_AND_HISTORY_ID(docShell) \
-    mozilla::Maybe<nsID> docShellId;                \
-    mozilla::Maybe<uint32_t> docShellHistoryId;     \
-    if (docShell) {                                 \
-      docShellId = Some(docShell->HistoryID());     \
-      uint32_t id;                                  \
-      nsresult rv = docShell->GetOSHEId(&id);       \
-      if (NS_SUCCEEDED(rv)) {                       \
-        docShellHistoryId = Some(id);               \
-      } else {                                      \
-        docShellHistoryId = Nothing();              \
-      }                                             \
-    } else {                                        \
-      docShellId = Nothing();                       \
-      docShellHistoryId = Nothing();                \
+#  define DECLARE_DOCSHELL_AND_HISTORY_ID(docShell)      \
+    mozilla::Maybe<nsID> docShellId;                     \
+    mozilla::Maybe<uint32_t> docShellHistoryId;          \
+    if (docShell) {                                      \
+      docShellId = mozilla::Some(docShell->HistoryID()); \
+      uint32_t id;                                       \
+      nsresult rv = docShell->GetOSHEId(&id);            \
+      if (NS_SUCCEEDED(rv)) {                            \
+        docShellHistoryId = mozilla::Some(id);           \
+      } else {                                           \
+        docShellHistoryId = mozilla::Nothing();          \
+      }                                                  \
+    } else {                                             \
+      docShellId = mozilla::Nothing();                   \
+      docShellHistoryId = mozilla::Nothing();            \
     }
 
 // Adds a tracing marker to the profile. A no-op if the profiler is inactive or
 // in privacy mode.
 
 #  define PROFILER_TRACING(categoryString, markerName, categoryPair, kind) \
     profiler_tracing(categoryString, markerName,                           \
                      JS::ProfilingCategoryPair::categoryPair, kind)
@@ -752,21 +752,21 @@ class MOZ_RAII AutoProfilerTextMarker {
   nsCString mText;
   const JS::ProfilingCategoryPair mCategoryPair;
   mozilla::TimeStamp mStartTime;
   UniqueProfilerBacktrace mCause;
   const mozilla::Maybe<nsID> mDocShellId;
   const mozilla::Maybe<uint32_t> mDocShellHistoryId;
 };
 
-#  define AUTO_PROFILER_TEXT_MARKER_CAUSE(markerName, text, categoryPair,     \
-                                          cause)                              \
-    AutoProfilerTextMarker PROFILER_RAII(                                     \
-        markerName, text, JS::ProfilingCategoryPair::categoryPair, Nothing(), \
-        Nothing(), cause)
+#  define AUTO_PROFILER_TEXT_MARKER_CAUSE(markerName, text, categoryPair, \
+                                          cause)                          \
+    AutoProfilerTextMarker PROFILER_RAII(                                 \
+        markerName, text, JS::ProfilingCategoryPair::categoryPair,        \
+        mozilla::Nothing(), mozilla::Nothing(), cause)
 
 #  define AUTO_PROFILER_TEXT_MARKER_DOCSHELL(markerName, text, categoryPair,   \
                                              docShell)                         \
     DECLARE_DOCSHELL_AND_HISTORY_ID(docShell);                                 \
     AutoProfilerTextMarker PROFILER_RAII(                                      \
         markerName, text, JS::ProfilingCategoryPair::categoryPair, docShellId, \
         docShellHistoryId)