Bug 1278816 - Move Performance API into dom/performance, r=smaug
authorAndrea Marchesini <amarchesini@mozilla.com>
Thu, 09 Jun 2016 12:42:21 +0200
changeset 301253 09b99113f95471769212a99b7fddb7651d7d2664
parent 301252 bf17125802afbb920b24660d176af5eac840c9b6
child 301254 0545d6c51c78557cefaff64ab0895dcd9fda96cd
push id78267
push useramarchesini@mozilla.com
push dateThu, 09 Jun 2016 10:45:17 +0000
treeherdermozilla-inbound@0c2668c814d0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1278816
milestone50.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 1278816 - Move Performance API into dom/performance, r=smaug
dom/base/PerformanceEntry.cpp
dom/base/PerformanceEntry.h
dom/base/PerformanceMark.cpp
dom/base/PerformanceMark.h
dom/base/PerformanceMeasure.cpp
dom/base/PerformanceMeasure.h
dom/base/PerformanceObserver.cpp
dom/base/PerformanceObserver.h
dom/base/PerformanceObserverEntryList.cpp
dom/base/PerformanceObserverEntryList.h
dom/base/PerformanceResourceTiming.cpp
dom/base/PerformanceResourceTiming.h
dom/base/TextInputProcessor.cpp
dom/base/moz.build
dom/base/nsFocusManager.cpp
dom/base/nsJSUtils.cpp
dom/base/nsPerformance.cpp
dom/base/nsPerformance.h
dom/base/nsScreen.cpp
dom/base/nsWindowMemoryReporter.cpp
dom/base/nsWindowMemoryReporter.h
dom/base/test/mochitest.ini
dom/base/test/performance_observer.html
dom/base/test/test_performance_observer.html
dom/base/test/test_performance_observer.js
dom/base/test/test_performance_user_timing.html
dom/base/test/test_performance_user_timing.js
dom/moz.build
dom/performance/PerformanceEntry.cpp
dom/performance/PerformanceEntry.h
dom/performance/PerformanceMark.cpp
dom/performance/PerformanceMark.h
dom/performance/PerformanceMeasure.cpp
dom/performance/PerformanceMeasure.h
dom/performance/PerformanceObserver.cpp
dom/performance/PerformanceObserver.h
dom/performance/PerformanceObserverEntryList.cpp
dom/performance/PerformanceObserverEntryList.h
dom/performance/PerformanceResourceTiming.cpp
dom/performance/PerformanceResourceTiming.h
dom/performance/moz.build
dom/performance/nsPerformance.cpp
dom/performance/nsPerformance.h
dom/performance/tests/mochitest.ini
dom/performance/tests/performance_observer.html
dom/performance/tests/test_performance_observer.html
dom/performance/tests/test_performance_observer.js
dom/performance/tests/test_performance_user_timing.html
dom/performance/tests/test_performance_user_timing.js
dom/workers/test/mochitest.ini
dom/workers/test/sharedworker_performance_user_timing.js
dom/workers/test/worker_performance_user_timing.js
--- a/dom/base/TextInputProcessor.cpp
+++ b/dom/base/TextInputProcessor.cpp
@@ -1,19 +1,21 @@
 /* -*- 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 "gfxPrefs.h"
+#include "mozilla/dom/Event.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/TextEventDispatcher.h"
 #include "mozilla/TextEvents.h"
 #include "mozilla/TextInputProcessor.h"
+#include "nsContentUtils.h"
 #include "nsIDocShell.h"
 #include "nsIWidget.h"
 #include "nsPIDOMWindow.h"
 #include "nsPresContext.h"
 
 using namespace mozilla::widget;
 
 namespace mozilla {
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -105,17 +105,16 @@ EXPORTS += [
     'nsIStyleSheetLinkingElement.h',
     'nsJSEnvironment.h',
     'nsJSUtils.h',
     'nsLineBreaker.h',
     'nsMappedAttributeElement.h',
     'nsNameSpaceManager.h',
     'nsNodeInfoManager.h',
     'nsNodeUtils.h',
-    'nsPerformance.h',
     'nsPIDOMWindow.h',
     'nsPIDOMWindowInlines.h',
     'nsPIWindowRoot.h',
     'nsPropertyTable.h',
     'nsRange.h',
     'nsReferencedElement.h',
     'nsSandboxFlags.h',
     'nsScriptLoader.h',
@@ -185,22 +184,16 @@ EXPORTS.mozilla.dom += [
     'ImageEncoder.h',
     'ImportManager.h',
     'Link.h',
     'NameSpaceConstants.h',
     'Navigator.h',
     'NodeInfo.h',
     'NodeInfoInlines.h',
     'NodeIterator.h',
-    'PerformanceEntry.h',
-    'PerformanceMark.h',
-    'PerformanceMeasure.h',
-    'PerformanceObserver.h',
-    'PerformanceObserverEntryList.h',
-    'PerformanceResourceTiming.h',
     'ProcessGlobal.h',
     'ResponsiveImageSelector.h',
     'SameProcessMessageQueue.h',
     'ScreenOrientation.h',
     'ScriptSettings.h',
     'ShadowRoot.h',
     'StructuredCloneHolder.h',
     'StructuredCloneTags.h',
@@ -297,17 +290,16 @@ UNIFIED_SOURCES += [
     'nsMappedAttributeElement.cpp',
     'nsMappedAttributes.cpp',
     'nsMimeTypeArray.cpp',
     'nsNameSpaceManager.cpp',
     'nsNoDataProtocolContentPolicy.cpp',
     'nsNodeInfoManager.cpp',
     'nsNodeUtils.cpp',
     'nsOpenURIInFrameParams.cpp',
-    'nsPerformance.cpp',
     'nsPlainTextSerializer.cpp',
     'nsPropertyTable.cpp',
     'nsQueryContentEventResult.cpp',
     'nsRange.cpp',
     'nsReferencedElement.cpp',
     'nsScreen.cpp',
     'nsScriptElement.cpp',
     'nsScriptLoader.cpp',
@@ -326,22 +318,16 @@ UNIFIED_SOURCES += [
     'nsViewportInfo.cpp',
     'nsWindowMemoryReporter.cpp',
     'nsWindowRoot.cpp',
     'nsWrapperCache.cpp',
     'nsXHTMLContentSerializer.cpp',
     'nsXMLContentSerializer.cpp',
     'nsXMLHttpRequest.cpp',
     'nsXMLNameSpaceMap.cpp',
-    'PerformanceEntry.cpp',
-    'PerformanceMark.cpp',
-    'PerformanceMeasure.cpp',
-    'PerformanceObserver.cpp',
-    'PerformanceObserverEntryList.cpp',
-    'PerformanceResourceTiming.cpp',
     'PostMessageEvent.cpp',
     'ProcessGlobal.cpp',
     'ResponsiveImageSelector.cpp',
     'SameProcessMessageQueue.cpp',
     'ScreenOrientation.cpp',
     'ScriptSettings.cpp',
     'ShadowRoot.cpp',
     'StructuredCloneHolder.cpp',
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -17,16 +17,17 @@
 #include "nsPIDOMWindow.h"
 #include "nsIDOMChromeWindow.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMRange.h"
 #include "nsIHTMLDocument.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeOwner.h"
+#include "nsIFormControl.h"
 #include "nsLayoutUtils.h"
 #include "nsIPresShell.h"
 #include "nsFrameTraversal.h"
 #include "nsIWebNavigation.h"
 #include "nsCaret.h"
 #include "nsIBaseWindow.h"
 #include "nsIXULWindow.h"
 #include "nsViewManager.h"
@@ -41,16 +42,17 @@
 #include "nsBindingManager.h"
 #include "nsStyleCoord.h"
 #include "TabChild.h"
 #include "nsFrameLoader.h"
 #include "nsNumberControlFrame.h"
 
 #include "mozilla/ContentEvents.h"
 #include "mozilla/dom/Element.h"
+#include "mozilla/dom/HTMLInputElement.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/EventStateManager.h"
 #include "mozilla/EventStates.h"
 #include "mozilla/IMEStateManager.h"
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "mozilla/unused.h"
--- a/dom/base/nsJSUtils.cpp
+++ b/dom/base/nsJSUtils.cpp
@@ -22,16 +22,17 @@
 #include "nsPIDOMWindow.h"
 #include "GeckoProfiler.h"
 #include "nsJSPrincipals.h"
 #include "xpcpublic.h"
 #include "nsContentUtils.h"
 #include "nsGlobalWindow.h"
 
 #include "mozilla/dom/BindingUtils.h"
+#include "mozilla/dom/Date.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/ScriptSettings.h"
 
 using namespace mozilla::dom;
 
 bool
 nsJSUtils::GetCallingLocation(JSContext* aContext, nsACString& aFilename,
                               uint32_t* aLineno, uint32_t* aColumn)
--- a/dom/base/nsScreen.cpp
+++ b/dom/base/nsScreen.cpp
@@ -1,16 +1,17 @@
 /* -*- 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/dom/Event.h" // for nsIDOMEvent::InternalDOMEvent()
 #include "mozilla/dom/ScreenBinding.h"
+#include "nsContentUtils.h"
 #include "nsScreen.h"
 #include "nsIDocument.h"
 #include "nsIDocShell.h"
 #include "nsIDocument.h"
 #include "nsPresContext.h"
 #include "nsCOMPtr.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsLayoutUtils.h"
--- a/dom/base/nsWindowMemoryReporter.cpp
+++ b/dom/base/nsWindowMemoryReporter.cpp
@@ -13,16 +13,17 @@
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "mozilla/StaticPtr.h"
 #include "nsNetCID.h"
 #include "nsPrintfCString.h"
 #include "XPCJSMemoryReporter.h"
 #include "js/MemoryMetrics.h"
+#include "nsQueryObject.h"
 #include "nsServiceManagerUtils.h"
 
 using namespace mozilla;
 
 StaticRefPtr<nsWindowMemoryReporter> sWindowReporter;
 
 /**
  * Don't trigger a ghost window check when a DOM window is detached if we've
--- a/dom/base/nsWindowMemoryReporter.h
+++ b/dom/base/nsWindowMemoryReporter.h
@@ -2,16 +2,17 @@
 /* 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 nsWindowMemoryReporter_h__
 #define nsWindowMemoryReporter_h__
 
+#include "nsGlobalWindow.h"
 #include "nsIMemoryReporter.h"
 #include "nsIObserver.h"
 #include "nsITimer.h"
 #include "nsDataHashtable.h"
 #include "nsWeakReference.h"
 #include "nsAutoPtr.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/Assertions.h"
--- a/dom/base/test/mochitest.ini
+++ b/dom/base/test/mochitest.ini
@@ -240,30 +240,27 @@ support-files =
   somedatas.resource
   somedatas.resource^headers^
   variable_style_sheet.sjs
   viewport_helpers.js
   w3element_traversal.svg
   wholeTexty-helper.xml
   file_nonascii_blob_url.html
   referrerHelper.js
-  test_performance_user_timing.js
   img_referrer_testserver.sjs
   file_audioLoop.html
   file_webaudioLoop.html
   file_webaudioLoop2.html
   file_pluginAudio.html
   file_pluginAudioNonAutoStart.html
   noaudio.webm
   referrer_helper.js
   referrer_testserver.sjs
   script_postmessages_fileList.js
   iframe_postMessages.html
-  test_performance_observer.js
-  performance_observer.html
   test_anonymousContent_style_csp.html^headers^
   file_explicit_user_agent.sjs
   referrer_change_server.sjs
   file_change_policy_redirect.html
   file_bug1198095.js
   file_bug1250148.sjs
   mozbrowser_api_utils.js
   websocket_helpers.js
@@ -792,18 +789,16 @@ tags = openwindow
 [test_orientation_alternate.html]
 skip-if = toolkit != 'gonk'
 [test_orientation_frame.html]
 skip-if = toolkit != 'gonk'
 [test_orientation_frame_lock.html]
 skip-if = toolkit != 'gonk'
 [test_orientation_sandbox_no_lock.html]
 skip-if = toolkit != 'gonk'
-[test_performance_observer.html]
-[test_performance_user_timing.html]
 [test_plugin_freezing.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' #CLICK_TO_PLAY
 [test_pluginAudioNotification.html]
 tags = audiochannel
 skip-if = (buildapp == 'b2g' || buildapp == 'mulet' || toolkit == 'android') # Plugins don't work on Android and/or B2G/Mulet
 [test_pluginMutedBeforePlay.html]
 tags = audiochannel
 skip-if = (buildapp == 'b2g' || buildapp == 'mulet' || toolkit == 'android') # Plugins don't work on Android and/or B2G/Mulet
--- a/dom/moz.build
+++ b/dom/moz.build
@@ -108,16 +108,17 @@ DIRS += [
     'xslt',
     'xul',
     'resourcestats',
     'manifest',
     'vr',
     'newapps',
     'u2f',
     'console',
+    'performance',
 ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     DIRS += ['plugins/ipc/hangui']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
     DIRS += [
         'speakermanager',
rename from dom/base/PerformanceEntry.cpp
rename to dom/performance/PerformanceEntry.cpp
rename from dom/base/PerformanceEntry.h
rename to dom/performance/PerformanceEntry.h
rename from dom/base/PerformanceMark.cpp
rename to dom/performance/PerformanceMark.cpp
rename from dom/base/PerformanceMark.h
rename to dom/performance/PerformanceMark.h
rename from dom/base/PerformanceMeasure.cpp
rename to dom/performance/PerformanceMeasure.cpp
rename from dom/base/PerformanceMeasure.h
rename to dom/performance/PerformanceMeasure.h
rename from dom/base/PerformanceObserver.cpp
rename to dom/performance/PerformanceObserver.cpp
rename from dom/base/PerformanceObserver.h
rename to dom/performance/PerformanceObserver.h
rename from dom/base/PerformanceObserverEntryList.cpp
rename to dom/performance/PerformanceObserverEntryList.cpp
rename from dom/base/PerformanceObserverEntryList.h
rename to dom/performance/PerformanceObserverEntryList.h
rename from dom/base/PerformanceResourceTiming.cpp
rename to dom/performance/PerformanceResourceTiming.cpp
rename from dom/base/PerformanceResourceTiming.h
rename to dom/performance/PerformanceResourceTiming.h
new file mode 100644
--- /dev/null
+++ b/dom/performance/moz.build
@@ -0,0 +1,36 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
+
+EXPORTS += [
+    'nsPerformance.h',
+]
+
+EXPORTS.mozilla.dom += [
+    'PerformanceEntry.h',
+    'PerformanceMark.h',
+    'PerformanceMeasure.h',
+    'PerformanceObserver.h',
+    'PerformanceObserverEntryList.h',
+    'PerformanceResourceTiming.h',
+]
+
+UNIFIED_SOURCES += [
+    'nsPerformance.cpp',
+    'PerformanceEntry.cpp',
+    'PerformanceMark.cpp',
+    'PerformanceMeasure.cpp',
+    'PerformanceObserver.cpp',
+    'PerformanceObserverEntryList.cpp',
+    'PerformanceResourceTiming.cpp',
+]
+
+LOCAL_INCLUDES += [
+    '/dom/workers',
+]
+
+MOCHITEST_MANIFESTS += [ 'tests/mochitest.ini' ]
+
+FINAL_LIBRARY = 'xul'
rename from dom/base/nsPerformance.cpp
rename to dom/performance/nsPerformance.cpp
rename from dom/base/nsPerformance.h
rename to dom/performance/nsPerformance.h
new file mode 100644
--- /dev/null
+++ b/dom/performance/tests/mochitest.ini
@@ -0,0 +1,8 @@
+[DEFAULT]
+support-files =
+  performance_observer.html
+  test_performance_observer.js
+  test_performance_user_timing.js
+
+[test_performance_observer.html]
+[test_performance_user_timing.html]
rename from dom/base/test/performance_observer.html
rename to dom/performance/tests/performance_observer.html
rename from dom/base/test/test_performance_observer.html
rename to dom/performance/tests/test_performance_observer.html
rename from dom/base/test/test_performance_observer.js
rename to dom/performance/tests/test_performance_observer.js
rename from dom/base/test/test_performance_user_timing.html
rename to dom/performance/tests/test_performance_user_timing.html
rename from dom/base/test/test_performance_user_timing.js
rename to dom/performance/tests/test_performance_user_timing.js
--- a/dom/workers/test/mochitest.ini
+++ b/dom/workers/test/mochitest.ini
@@ -141,18 +141,18 @@ support-files =
   !/dom/base/test/file_websocket_http_resource.txt
   !/dom/base/test/file_websocket_permessage_deflate_disabled_wsh.py
   !/dom/base/test/file_websocket_permessage_deflate_params_wsh.py
   !/dom/base/test/file_websocket_permessage_deflate_rejected_wsh.py
   !/dom/base/test/file_websocket_permessage_deflate_wsh.py
   !/dom/base/test/file_websocket_wsh.py
   !/dom/base/test/test_XHR_system.html
   !/dom/base/test/test_XHR_timeout.js
-  !/dom/base/test/test_performance_observer.js
-  !/dom/base/test/test_performance_user_timing.js
+  !/dom/performance/tests/test_performance_observer.js
+  !/dom/performance/tests/test_performance_user_timing.js
   !/dom/base/test/websocket_helpers.js
   !/dom/base/test/websocket_tests.js
   !/dom/tests/mochitest/notification/MockServices.js
   !/dom/tests/mochitest/notification/NotificationTest.js
 
 [test_404.html]
 [test_atob.html]
 [test_blobConstructor.html]
--- a/dom/workers/test/sharedworker_performance_user_timing.js
+++ b/dom/workers/test/sharedworker_performance_user_timing.js
@@ -10,17 +10,17 @@ function is(a, b, msg) {
   port.postMessage({type: 'status', status: a === b, msg: a + " === " + b + ": " + msg });
 }
 
 function isnot(a, b, msg) {
   dump("ISNOT: " + (a===b) + "  =>  " + a + " | " + b + " " + msg + "\n");
   port.postMessage({type: 'status', status: a != b, msg: a + " != " + b + ": " + msg });
 }
 
-importScripts('../../../dom/base/test/test_performance_user_timing.js');
+importScripts('../../../dom/performance/test/test_performance_user_timing.js');
 
 onconnect = function(evt) {
   port = evt.ports[0];
 
   for (var i = 0; i < steps.length; ++i) {
     performance.clearMarks();
     performance.clearMeasures();
     steps[i]();
--- a/dom/workers/test/worker_performance_user_timing.js
+++ b/dom/workers/test/worker_performance_user_timing.js
@@ -8,17 +8,17 @@ function is(a, b, msg) {
   postMessage({type: 'status', status: a === b, msg: a + " === " + b + ": " + msg });
 }
 
 function isnot(a, b, msg) {
   dump("ISNOT: " + (a===b) + "  =>  " + a + " | " + b + " " + msg + "\n");
   postMessage({type: 'status', status: a != b, msg: a + " != " + b + ": " + msg });
 }
 
-importScripts(['../../../dom/base/test/test_performance_user_timing.js']);
+importScripts(['../../../dom/performance/test/test_performance_user_timing.js']);
 
 for (var i = 0; i < steps.length; ++i) {
   performance.clearMarks();
   performance.clearMeasures();
   steps[i]();
 }
 
 postMessage({type: 'finish'});