Bug 1278799 - Moving Console API into dom/console, r=smaug
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 08 Jun 2016 14:46:50 +0200
changeset 341104 b9a49ba7f5e5bc6125482d40cdf292cbbeecfcff
parent 341103 74e887c08f20fd40ebef662bf4ec1826fa786572
child 341105 1e841da3ed13b9cee72f568a66dc48e60abe05e4
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1278799
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 1278799 - Moving Console API into dom/console, r=smaug
dom/base/Console.cpp
dom/base/Console.h
dom/base/ConsoleAPI.manifest
dom/base/ConsoleAPIStorage.js
dom/base/ConsoleReportCollector.cpp
dom/base/ConsoleReportCollector.h
dom/base/Link.cpp
dom/base/moz.build
dom/base/nsIConsoleAPIStorage.idl
dom/base/nsIConsoleReportCollector.h
dom/base/nsOpenURIInFrameParams.cpp
dom/base/nsOpenURIInFrameParams.h
dom/base/test/chrome.ini
dom/base/test/mochitest.ini
dom/base/test/test_bug659625.html
dom/base/test/test_bug978522.html
dom/base/test/test_bug979109.html
dom/base/test/test_bug989665.html
dom/base/test/test_console.xul
dom/base/test/test_consoleEmptyStack.html
dom/base/test/test_console_binding.html
dom/base/test/test_console_proto.html
dom/console/Console.cpp
dom/console/Console.h
dom/console/ConsoleAPI.manifest
dom/console/ConsoleAPIStorage.js
dom/console/ConsoleReportCollector.cpp
dom/console/ConsoleReportCollector.h
dom/console/moz.build
dom/console/nsIConsoleAPIStorage.idl
dom/console/nsIConsoleReportCollector.h
dom/console/tests/chrome.ini
dom/console/tests/file_empty.html
dom/console/tests/mochitest.ini
dom/console/tests/test_bug659625.html
dom/console/tests/test_bug978522.html
dom/console/tests/test_bug979109.html
dom/console/tests/test_bug989665.html
dom/console/tests/test_console.xul
dom/console/tests/test_consoleEmptyStack.html
dom/console/tests/test_console_binding.html
dom/console/tests/test_console_proto.html
dom/moz.build
--- a/dom/base/Link.cpp
+++ b/dom/base/Link.cpp
@@ -9,16 +9,17 @@
 #include "mozilla/EventStates.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/dom/Element.h"
 #include "nsIURL.h"
 #include "nsISizeOf.h"
 #include "nsIDocShell.h"
 #include "nsIPrefetchService.h"
 #include "nsCPrefetchService.h"
+#include "nsStyleLinkElement.h"
 
 #include "nsEscape.h"
 #include "nsGkAtoms.h"
 #include "nsHTMLDNSPrefetch.h"
 #include "nsString.h"
 #include "mozAutoDocUpdate.h"
 
 #include "mozilla/Services.h"
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -3,17 +3,16 @@
 # 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/.
 
 TEST_DIRS += ['test']
 
 XPIDL_SOURCES += [
     'mozIDOMWindow.idl',
-    'nsIConsoleAPIStorage.idl',
     'nsIContentPolicy.idl',
     'nsIContentPolicyBase.idl',
     'nsIDocumentEncoder.idl',
     'nsIDOMBlob.idl',
     'nsIDOMDataChannel.idl',
     'nsIDOMDOMCursor.idl',
     'nsIDOMDOMRequest.idl',
     'nsIDOMFileList.idl',
@@ -79,17 +78,16 @@ EXPORTS += [
     'nsFrameMessageManager.h',
     'nsGenericDOMDataNode.h',
     'nsGkAtomList.h',
     'nsGkAtoms.h',
     'nsHostObjectProtocolHandler.h',
     'nsHostObjectURI.h',
     'nsIAnimationObserver.h',
     'nsIAttribute.h',
-    'nsIConsoleReportCollector.h',
     'nsIContent.h',
     'nsIContentInlines.h',
     'nsIContentIterator.h',
     'nsIContentSerializer.h',
     'nsIDocument.h',
     'nsIDocumentInlines.h',
     'nsIDocumentObserver.h',
     'nsIDOMClassInfo.h',
@@ -138,17 +136,16 @@ EXPORTS += [
 
 if CONFIG['MOZ_WEBRTC']:
     EXPORTS += [
         'nsDOMDataChannel.h',
         'nsDOMDataChannelDeclarations.h',
     ]
 
 EXPORTS.mozilla += [
-    'ConsoleReportCollector.h',
     'CORSMode.h',
     'FeedWriterEnabled.h',
     'TextInputProcessor.h',
     'UseCounter.h',
 ]
 
 EXPORTS.mozilla.dom += [
     '!UseCounterList.h',
@@ -156,17 +153,16 @@ EXPORTS.mozilla.dom += [
     'Attr.h',
     'BarProps.h',
     'BlobSet.h',
     'BodyUtil.h',
     'ChildIterator.h',
     'ChromeNodeList.h',
     'ChromeUtils.h',
     'Comment.h',
-    'Console.h',
     'DirectionalityUtils.h',
     'DocumentFragment.h',
     'DocumentType.h',
     'DOMCursor.h',
     'DOMError.h',
     'DOMException.h',
     'DOMImplementation.h',
     'DOMMatrix.h',
@@ -223,18 +219,16 @@ UNIFIED_SOURCES += [
     'AnonymousContent.cpp',
     'Attr.cpp',
     'BarProps.cpp',
     'BodyUtil.cpp',
     'ChildIterator.cpp',
     'ChromeNodeList.cpp',
     'ChromeUtils.cpp',
     'Comment.cpp',
-    'Console.cpp',
-    'ConsoleReportCollector.cpp',
     'Crypto.cpp',
     'DirectionalityUtils.cpp',
     'DocumentFragment.cpp',
     'DocumentType.cpp',
     'DOMCursor.cpp',
     'DOMError.cpp',
     'DOMException.cpp',
     'DOMImplementation.cpp',
@@ -390,18 +384,16 @@ SOURCES += [
 
 # Are we targeting x86-32 or x86-64?  If so, we want to include SSE2 code for
 # nsTextFragment.cpp
 if CONFIG['INTEL_ARCHITECTURE']:
     SOURCES += ['nsTextFragmentSSE2.cpp']
     SOURCES['nsTextFragmentSSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
 
 EXTRA_COMPONENTS += [
-    'ConsoleAPI.manifest',
-    'ConsoleAPIStorage.js',
     'contentAreaDropListener.js',
     'contentAreaDropListener.manifest',
     'messageWakeupService.js',
     'messageWakeupService.manifest',
     'SlowScriptDebug.js',
     'SlowScriptDebug.manifest',
 ]
 
--- a/dom/base/nsOpenURIInFrameParams.cpp
+++ b/dom/base/nsOpenURIInFrameParams.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 "nsOpenURIInFrameParams.h"
 #include "mozilla/BasePrincipal.h"
+#include "mozilla/dom/ToJSValue.h"
 
 NS_IMPL_ISUPPORTS(nsOpenURIInFrameParams, nsIOpenURIInFrameParams)
 
 nsOpenURIInFrameParams::nsOpenURIInFrameParams(const mozilla::DocShellOriginAttributes& aOriginAttributes)
   : mOpenerOriginAttributes(aOriginAttributes)
   , mIsPrivate(false)
 {
 }
--- a/dom/base/nsOpenURIInFrameParams.h
+++ b/dom/base/nsOpenURIInFrameParams.h
@@ -1,14 +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/BasePrincipal.h"
 #include "nsIBrowserDOMWindow.h"
 #include "nsString.h"
 
 namespace mozilla {
 class DocShellOriginAttributes;
 }
 
 class nsOpenURIInFrameParams final : public nsIOpenURIInFrameParams
--- a/dom/base/test/chrome.ini
+++ b/dom/base/test/chrome.ini
@@ -7,17 +7,16 @@ support-files =
   file_bug945152_worker.js
   file_bug1008126_worker.js
 
 [test_anonymousContent_xul_window.xul]
 [test_bug715041.xul]
 [test_bug715041_removal.xul]
 [test_domrequesthelper.xul]
 [test_url.xul]
-[test_console.xul]
 [test_navigator_resolve_identity_xrays.xul]
 support-files = file_navigator_resolve_identity_xrays.xul
 [test_sendQueryContentAndSelectionSetEvent.html]
 [test_bug1016960.html]
 [test_copypaste.xul]
 subsuite = clipboard
 [test_messagemanager_principal.html]
 [test_messagemanager_send_principal.html]
--- a/dom/base/test/mochitest.ini
+++ b/dom/base/test/mochitest.ini
@@ -550,17 +550,16 @@ skip-if = toolkit == 'android' #bug 6870
 [test_bug628938.html]
 [test_bug631615.html]
 [test_bug638112.html]
 [test_bug647518.html]
 [test_bug650001.html]
 [test_bug650776.html]
 [test_bug650784.html]
 [test_bug656283.html]
-[test_bug659625.html]
 [test_bug664916.html]
 [test_bug666604.html]
 skip-if = buildapp == 'b2g' # b2g(dom.disable_open_during_load not implemented in b2g) b2g-debug(dom.disable_open_during_load not implemented in b2g) b2g-desktop(dom.disable_open_during_load not implemented in b2g)
 [test_bug675121.html]
 skip-if = buildapp == 'b2g' # b2g(bug 901378) b2g-debug(bug 901378) b2g-desktop(bug 901378)
 [test_bug675166.html]
 [test_bug682463.html]
 [test_bug682554.html]
@@ -635,20 +634,17 @@ skip-if = (buildapp == 'b2g' && toolkit 
 [test_bug895974.html]
 [test_bug902847.html]
 [test_bug907892.html]
 [test_bug913761.html]
 [test_bug922681.html]
 [test_bug927196.html]
 [test_bug962251.html]
 [test_bug976673.html]
-[test_bug978522.html]
-[test_bug979109.html]
 [test_bug982153.html]
-[test_bug989665.html]
 [test_bug999456.html]
 [test_bug1022229.html]
 [test_bug1025933.html]
 [test_bug1037687.html]
 [test_bug1043106.html]
 [test_bug1057176.html]
 [test_bug1060938.html]
 [test_bug1064481.html]
@@ -672,17 +668,16 @@ skip-if = buildapp == 'b2g'
 [test_bug1250148.html]
 [test_bug1259588.html]
 [test_bug1263696.html]
 [test_caretPositionFromPoint.html]
 [test_change_policy.html]
 skip-if = buildapp == 'b2g' #no ssl support
 [test_classList.html]
 [test_clearTimeoutIntervalNoArg.html]
-[test_consoleEmptyStack.html]
 [test_constructor-assignment.html]
 [test_constructor.html]
 [test_copyimage.html]
 subsuite = clipboard
 skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || (toolkit != 'cocoa' && toolkit != 'gonk' && toolkit != 'gtk2' && toolkit != 'gtk3' && toolkit != 'windows') #b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
 [test_copypaste.html]
 subsuite = clipboard
 skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 904183 # b2g(clipboard undefined) b2g-debug(clipboard undefined) b2g-desktop(clipboard undefined)
@@ -911,11 +906,9 @@ skip-if = toolkit == 'android'
 skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(12 total, 2 failing - .mozSystem == true - got false, expected true + ) b2g-desktop(12 total, 2 failing - .mozSystem == true - got false, expected true + )
 [test_XHR_timeout.html]
 skip-if = buildapp == 'b2g' || (android_version == '18' && debug) # b2g(flaky on B2G, bug 960743) b2g-debug(flaky on B2G, bug 960743) b2g-desktop(flaky on B2G, bug 960743)
 support-files = test_XHR_timeout.js
 [test_xhr_withCredentials.html]
 [test_XHRDocURI.html]
 [test_XHRResponseURL.html]
 [test_XHRSendData.html]
-[test_console_binding.html]
 [test_unknown_url_origin.html]
-[test_console_proto.html]
rename from dom/base/Console.cpp
rename to dom/console/Console.cpp
rename from dom/base/Console.h
rename to dom/console/Console.h
rename from dom/base/ConsoleAPI.manifest
rename to dom/console/ConsoleAPI.manifest
rename from dom/base/ConsoleAPIStorage.js
rename to dom/console/ConsoleAPIStorage.js
rename from dom/base/ConsoleReportCollector.cpp
rename to dom/console/ConsoleReportCollector.cpp
rename from dom/base/ConsoleReportCollector.h
rename to dom/console/ConsoleReportCollector.h
new file mode 100644
--- /dev/null
+++ b/dom/console/moz.build
@@ -0,0 +1,45 @@
+# -*- 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/.
+
+XPIDL_SOURCES += [
+    'nsIConsoleAPIStorage.idl',
+]
+
+XPIDL_MODULE = 'dom'
+
+EXPORTS += [
+    'nsIConsoleReportCollector.h',
+]
+
+EXPORTS.mozilla += [
+    'ConsoleReportCollector.h',
+]
+
+EXPORTS.mozilla.dom += [
+    'Console.h',
+]
+
+UNIFIED_SOURCES += [
+    'Console.cpp',
+    'ConsoleReportCollector.cpp',
+]
+
+EXTRA_COMPONENTS += [
+    'ConsoleAPI.manifest',
+    'ConsoleAPIStorage.js',
+]
+
+LOCAL_INCLUDES += [
+    '/docshell/base',
+    '/dom/base',
+    '/dom/workers',
+    '/js/xpconnect/src',
+]
+
+MOCHITEST_MANIFESTS += [ 'tests/mochitest.ini' ]
+MOCHITEST_CHROME_MANIFESTS += [ 'tests/chrome.ini' ]
+
+FINAL_LIBRARY = 'xul'
rename from dom/base/nsIConsoleAPIStorage.idl
rename to dom/console/nsIConsoleAPIStorage.idl
rename from dom/base/nsIConsoleReportCollector.h
rename to dom/console/nsIConsoleReportCollector.h
new file mode 100644
--- /dev/null
+++ b/dom/console/tests/chrome.ini
@@ -0,0 +1,6 @@
+[DEFAULT]
+skip-if = buildapp == 'b2g' || os == 'android'
+support-files =
+  file_empty.html
+
+[test_console.xul]
new file mode 100644
--- /dev/null
+++ b/dom/console/tests/file_empty.html
@@ -0,0 +1,1 @@
+<!DOCTYPE html><html><body></body></html>
new file mode 100644
--- /dev/null
+++ b/dom/console/tests/mochitest.ini
@@ -0,0 +1,11 @@
+[DEFAULT]
+support-files =
+  file_empty.html
+
+[test_bug659625.html]
+[test_bug978522.html]
+[test_bug979109.html]
+[test_bug989665.html]
+[test_consoleEmptyStack.html]
+[test_console_binding.html]
+[test_console_proto.html]
rename from dom/base/test/test_bug659625.html
rename to dom/console/tests/test_bug659625.html
rename from dom/base/test/test_bug978522.html
rename to dom/console/tests/test_bug978522.html
rename from dom/base/test/test_bug979109.html
rename to dom/console/tests/test_bug979109.html
rename from dom/base/test/test_bug989665.html
rename to dom/console/tests/test_bug989665.html
rename from dom/base/test/test_console.xul
rename to dom/console/tests/test_console.xul
--- a/dom/base/test/test_console.xul
+++ b/dom/console/tests/test_console.xul
@@ -16,17 +16,17 @@
   ok("console" in window, "Console exists");
   window.console.log(42);
   ok("table" in console, "Console has the 'table' method.");
   window.console = 42;
   is(window.console, 42, "Console is replacable");
 
   var frame = document.getElementById("iframe");
   ok(frame, "Frame must exist");
-  frame.src="http://mochi.test:8888/tests/dom/base/test/file_empty.html";
+  frame.src="http://mochi.test:8888/tests/dom/console/test/file_empty.html";
   frame.onload = function() {
     ok("console" in frame.contentWindow, "Console exists in the iframe");
     frame.contentWindow.console.log(42);
     frame.contentWindow.console = 42;
     is(frame.contentWindow.console, 42, "Console is replacable in the iframe");
     SimpleTest.finish();
   }
 
rename from dom/base/test/test_consoleEmptyStack.html
rename to dom/console/tests/test_consoleEmptyStack.html
rename from dom/base/test/test_console_binding.html
rename to dom/console/tests/test_console_binding.html
rename from dom/base/test/test_console_proto.html
rename to dom/console/tests/test_console_proto.html
--- a/dom/moz.build
+++ b/dom/moz.build
@@ -107,16 +107,17 @@ DIRS += [
     'xml',
     'xslt',
     'xul',
     'resourcestats',
     'manifest',
     'vr',
     'newapps',
     'u2f',
+    'console',
 ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     DIRS += ['plugins/ipc/hangui']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
     DIRS += [
         'speakermanager',