jenkins-bot has submitted this change and it was merged.

Change subject: Hygiene: Kill obsolete profiling
......................................................................


Hygiene: Kill obsolete profiling

Removed in I781f62be9747bb41af6faad6fbe265414fb77669
Deprecation notice added for 1.25

Change-Id: Ie4e37d1d0c86300944a9b34c0ceaf9ca482a7afe
---
M includes/DeviceDetection.php
M includes/MobileContext.php
M includes/MobileFormatter.php
M includes/MobileFrontend.body.php
M includes/MobileFrontend.hooks.php
M includes/MobileUserInfo.php
M includes/api/ApiMobileView.php
M includes/api/ApiParseExtender.php
M includes/diff/InlineDiffFormatter.php
M includes/diff/InlineDifferenceEngine.php
M includes/skins/SkinMinerva.php
M includes/skins/SkinMinervaBeta.php
M includes/specials/MobileSpecialPageFeed.php
M includes/specials/SpecialMobileContributions.php
M includes/specials/SpecialMobileDiff.php
M includes/specials/SpecialMobileEditWatchlist.php
M includes/specials/SpecialMobileEditor.php
M includes/specials/SpecialMobileHistory.php
M includes/specials/SpecialMobileLanguages.php
M includes/specials/SpecialMobileOptions.php
M includes/specials/SpecialMobileWatchlist.php
M includes/specials/SpecialUserProfile.php
22 files changed, 22 insertions(+), 171 deletions(-)

Approvals:
  Jdlrobson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/DeviceDetection.php b/includes/DeviceDetection.php
index a628781..40bac67 100644
--- a/includes/DeviceDetection.php
+++ b/includes/DeviceDetection.php
@@ -116,8 +116,6 @@
         * @return bool
         */
        private function detectMobileDevice() {
-               wfProfileIn( __METHOD__ );
-
                $patterns = array(
                        'mobi',
                        '240x240',
@@ -178,7 +176,6 @@
                $regex = '/^(' . implode( '|', $patternsStart ) . ')|(' . 
implode( '|', $patterns ) . ')/i';
                $isMobile = (bool)preg_match( $regex, $this->userAgent );
 
-               wfProfileOut( __METHOD__ );
                return $isMobile;
        }
 
@@ -187,8 +184,6 @@
         * @return bool
         */
        private function detectTablet() {
-               wfProfileIn( __METHOD__ );
-
                // The only way to distinguish Android browsers on tablet from 
Android browsers on
                // mobile is that Android browsers on tablet usually don't 
include the word
                // "mobile". We look for "mobi" instead of "mobile" due to 
Opera Mobile. Note that
@@ -202,7 +197,6 @@
                        $isTablet = (bool)preg_match( $pattern, 
$this->userAgent );
                }
 
-               wfProfileOut( __METHOD__ );
                return $isTablet;
        }
 }
diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index 9b5b5dd..f8d575c 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -129,9 +129,7 @@
        public function getDevice() {
                $mobileHeader = $this->getMFConfig()->get( 'MFMobileHeader' );
 
-               wfProfileIn( __METHOD__ );
                if ( $this->device ) {
-                       wfProfileOut( __METHOD__ );
                        return $this->device;
                }
                $detector = DeviceDetection::factory();
@@ -146,7 +144,6 @@
                        $this->device = $detector->detectDeviceProperties( 
$userAgent, $acceptHeader );
                }
 
-               wfProfileOut( __METHOD__ );
                return $this->device;
        }
 
@@ -302,7 +299,6 @@
         * @param string $mode Mode to set
         */
        public function setMobileMode( $mode ) {
-               wfProfileIn( __METHOD__ );
                if ( $mode !== 'alpha' && $mode !== 'beta' ) {
                        $mode = '';
                }
@@ -330,7 +326,6 @@
                $this->getRequest()->response()->setcookie( 'optin', $mode, 0,
                        array( 'prefix' => '', 'domain' => $host )
                );
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -366,7 +361,6 @@
                if ( !is_null( $this->mobileView ) ) {
                        return $this->mobileView;
                }
-               wfProfileIn( __METHOD__ );
                // check if we need to toggle between mobile/desktop view
                $this->checkToggleView();
                $this->mobileView = $this->shouldDisplayMobileViewInternal();
@@ -374,7 +368,6 @@
                        $this->redirectMobileEnabledPages();
                        wfRunHooks( 'EnterMobileMode', array( $this ) );
                }
-               wfProfileOut( __METHOD__ );
                return $this->mobileView;
        }
 
@@ -462,14 +455,9 @@
         * @return bool
         */
        public function isBlacklistedPage() {
-
-               wfProfileIn( __METHOD__ );
-
                if ( is_null( $this->blacklistedPage ) ) {
                        $this->blacklistedPage = 
$this->isBlacklistedPageInternal();
                }
-
-               wfProfileOut( __METHOD__ );
 
                return $this->blacklistedPage;
        }
@@ -611,7 +599,6 @@
        public function getBaseDomain() {
                $server = $this->getConfig()->get( 'Server' );
 
-               wfProfileIn( __METHOD__ );
                $parsedUrl = wfParseUrl( $server );
                $host = $parsedUrl['host'];
                // Validates value as IP address
@@ -622,7 +609,7 @@
                        // ยป RFC 2109 requires it to be included.
                        $host = count( $domainParts ) >= 2 ? '.' . 
$domainParts[1] . '.' . $domainParts[0] : $host;
                }
-               wfProfileOut( __METHOD__ );
+
                return $host;
        }
 
@@ -730,10 +717,7 @@
         * @return string
         */
        public function getMobileHostToken( $mobileUrlHostTemplate ) {
-               wfProfileIn( __METHOD__ );
-               $mobileToken = preg_replace( '/%h[0-9]\.{0,1}/', '', 
$mobileUrlHostTemplate );
-               wfProfileOut( __METHOD__ );
-               return $mobileToken;
+               return preg_replace( '/%h[0-9]\.{0,1}/', '', 
$mobileUrlHostTemplate );
        }
 
        /**
diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php
index d336581..e2e23c9 100644
--- a/includes/MobileFormatter.php
+++ b/includes/MobileFormatter.php
@@ -59,7 +59,6 @@
         */
        public static function newFromContext( $context, $html ) {
                global $wgMFSpecialCaseMainPage;
-               wfProfileIn( __METHOD__ );
 
                $title = $context->getTitle();
                $isMainPage = $title->isMainPage() && $wgMFSpecialCaseMainPage;
@@ -75,7 +74,6 @@
                        $formatter->setRemoveMedia( $context->imagesDisabled() 
);
                }
 
-               wfProfileOut( __METHOD__ );
                return $formatter;
        }
 
@@ -146,12 +144,11 @@
         * @return string Processed HTML
         */
        public function getText( $element = null ) {
-               wfProfileIn( __METHOD__ );
                if ( $this->mainPage ) {
                        $element = $this->parseMainPage( $this->getDoc() );
                }
                $html = parent::getText( $element );
-               wfProfileOut( __METHOD__ );
+
                return $html;
        }
 
@@ -170,8 +167,6 @@
         * @return DOMElement|null
         */
        protected function parseMainPage( DOMDocument $mainPage ) {
-               wfProfileIn( __METHOD__ );
-
                $featuredArticle = $mainPage->getElementById( 'mp-tfa' );
                $newsItems = $mainPage->getElementById( 'mp-itn' );
 
@@ -221,7 +216,6 @@
                        $content = null;
                }
 
-               wfProfileOut( __METHOD__ );
                return $content;
        }
 
@@ -233,7 +227,6 @@
         * @return string
         */
        protected function headingTransform( $s, $tagName = 'h2' ) {
-               wfProfileIn( __METHOD__ );
                $tagRegEx = '<' . $tagName . '.*</' . $tagName . '>';
                $s = $this->pageTransformStart .
                        preg_replace(
@@ -241,7 +234,7 @@
                                $s
                        ) .
                        $this->pageTransformEnd;
-               wfProfileOut( __METHOD__ );
+
                return $s;
        }
 
@@ -269,12 +262,11 @@
         * @return string
         */
        protected function onHtmlReady( $html ) {
-               wfProfileIn( __METHOD__ );
                if ( $this->expandableSections ) {
                        $tagName = $this->findTopHeading( $html );
                        $html = $this->headingTransform( $html, $tagName );
                }
-               wfProfileOut( __METHOD__ );
+
                return $html;
        }
 }
diff --git a/includes/MobileFrontend.body.php b/includes/MobileFrontend.body.php
index 836a843..28f2abc 100644
--- a/includes/MobileFrontend.body.php
+++ b/includes/MobileFrontend.body.php
@@ -31,19 +31,14 @@
         * @return string
         */
        public static function DOMParse( OutputPage $out ) {
-               wfProfileIn( __METHOD__ );
-
                $html = $out->getHTML();
 
-               wfProfileIn( __METHOD__ . '-formatter-init' );
                $context = MobileContext::singleton();
 
                $formatter = MobileFormatter::newFromContext( $context, $html );
-               wfProfileOut( __METHOD__ . '-formatter-init' );
 
                wfRunHooks( 'MobileFrontendBeforeDOM', array( $context, 
$formatter ) );
 
-               wfProfileIn( __METHOD__ . '-filter' );
                $title = $out->getTitle();
                $isSpecialPage = $title->isSpecialPage();
                $formatter->enableExpandableSections(
@@ -62,13 +57,9 @@
                        // Remove images if they're disabled from special 
pages, but don't transform otherwise
                        $formatter->filterContent( /* remove defaults */ 
!$isSpecialPage );
                }
-               wfProfileOut( __METHOD__ . '-filter' );
 
-               wfProfileIn( __METHOD__ . '-getText' );
                $contentHtml = $formatter->getText();
-               wfProfileOut( __METHOD__ . '-getText' );
 
-               wfProfileOut( __METHOD__ );
                return $contentHtml;
        }
 
diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index e16266b..55517c7 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -149,8 +149,6 @@
         * @return bool
         */
        public static function onSkinTemplateOutputPageBeforeExec( &$skin, 
&$tpl ) {
-               wfProfileIn( __METHOD__ );
-
                $title = $skin->getTitle();
                $context = MobileContext::singleton();
 
@@ -173,7 +171,7 @@
                        $footerlinks['places'][] = 'mobileview';
                        $tpl->set( 'footerlinks', $footerlinks );
                }
-               wfProfileOut( __METHOD__ );
+
                return true;
        }
 
@@ -188,12 +186,9 @@
         * @return bool
         */
        public static function onBeforePageRedirect( $out, &$redirect, &$code ) 
{
-               wfProfileIn( __METHOD__ );
-
                $context = MobileContext::singleton();
                $shouldDisplayMobileView = $context->shouldDisplayMobileView();
                if ( !$shouldDisplayMobileView ) {
-                       wfProfileOut( __METHOD__ );
                        return true;
                }
 
@@ -204,7 +199,6 @@
                        $redirect = $context->getMobileUrl( $redirect );
                }
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -575,12 +569,11 @@
         * @return bool
         */
        public static function onUserLoginForm( &$template ) {
-               wfProfileIn( __METHOD__ );
                $context = MobileContext::singleton();
                if ( $context->shouldDisplayMobileView() && 
!$context->isAlphaGroupMember() ) {
                        $template = new UserLoginMobileTemplate( $template );
                }
-               wfProfileOut( __METHOD__ );
+
                return true;
        }
 
@@ -592,12 +585,11 @@
         * @return bool
         */
        public static function onUserCreateForm( &$template ) {
-               wfProfileIn( __METHOD__ );
                $context = MobileContext::singleton();
                if ( $context->shouldDisplayMobileView() && 
!$context->isAlphaGroupMember() ) {
                        $template = new UserAccountCreateMobileTemplate( 
$template );
                }
-               wfProfileOut( __METHOD__ );
+
                return true;
        }
 
@@ -611,7 +603,6 @@
         */
        public static function onBeforePageDisplay( &$out, &$sk ) {
                global $wgMFEnableXAnalyticsLogging, $wgMFAppPackageId, 
$wgMFAppScheme;
-               wfProfileIn( __METHOD__ );
 
                $context = MobileContext::singleton();
 
@@ -640,7 +631,6 @@
                }
 
                if ( !$context->shouldDisplayMobileView() ) {
-                       wfProfileOut( __METHOD__);
                        return true;
                }
 
@@ -655,7 +645,6 @@
 
                $out->addVaryHeader( 'Cookie' );
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
diff --git a/includes/MobileUserInfo.php b/includes/MobileUserInfo.php
index 4d9e210..24622f8 100644
--- a/includes/MobileUserInfo.php
+++ b/includes/MobileUserInfo.php
@@ -35,7 +35,6 @@
         * @return int the amount of edits
         */
        public function countRecentEdits( $fromDate ) {
-               wfProfileIn( __METHOD__ );
                $dbr = wfGetDB( DB_SLAVE );
                $where = array(
                        'rc_user_text' => $this->user->getName(),
@@ -53,7 +52,6 @@
                        $constraints
                );
 
-               wfProfileOut( __METHOD__ );
                return $result;
        }
 
@@ -67,7 +65,6 @@
        public function countRecentUploads( $fromDate ) {
                global $wgMFPhotoUploadWiki, $wgConf;
 
-               wfProfileIn( __METHOD__ );
                if ( !$wgMFPhotoUploadWiki ) {
                        $dbr = wfGetDB( DB_SLAVE );
                } elseif (
@@ -75,7 +72,6 @@
                        !in_array( $wgMFPhotoUploadWiki, 
$wgConf->getLocalDatabases() )
                ) {
                        // early return if the database is invalid
-                       wfProfileOut( __METHOD__ );
                        return false;
                } else {
                        $dbr = wfGetDB( DB_SLAVE, array(), $wgMFPhotoUploadWiki 
);
@@ -89,7 +85,6 @@
 
                $result = $dbr->selectRowCount( 'image', 'img_timestamp', 
$where, __METHOD__, $constraints );
 
-               wfProfileOut( __METHOD__ );
                return $result;
        }
 
@@ -101,7 +96,6 @@
        public function getLastUpload() {
                global $wgMFPhotoUploadWiki, $wgConf;
 
-               wfProfileIn( __METHOD__ );
                if ( !$wgMFPhotoUploadWiki ) {
                        $dbr = wfGetDB( DB_SLAVE );
                } elseif (
@@ -109,7 +103,6 @@
                        !in_array( $wgMFPhotoUploadWiki, 
$wgConf->getLocalDatabases() )
                ) {
                        // early return if the database is invalid
-                       wfProfileOut( __METHOD__ );
                        return false;
                } else {
                        $dbr = wfGetDB( DB_SLAVE, array(), $wgMFPhotoUploadWiki 
);
@@ -119,7 +112,7 @@
                $constraints = array( 'ORDER BY' => 'img_timestamp DESC' );
                $name = $dbr->selectField( 'image', 'img_name', $where, 
__METHOD__, $constraints );
                $file = $name === false ? null : wfFindFile( $name );
-               wfProfileOut( __METHOD__ );
+
                return $file;
        }
 
@@ -129,7 +122,6 @@
         * @return Revision|false
         */
        public function getLastEdit() {
-               wfProfileIn( __METHOD__ );
                $conds = array(
                        'rev_user' => $this->user->getId(),
                );
@@ -146,7 +138,7 @@
                } else {
                        $rev = false;
                }
-               wfProfileOut( __METHOD__ );
+
                return $rev;
        }
 
@@ -156,7 +148,6 @@
         * @return array|null
         */
        public function getLastThanking() {
-               wfProfileIn( __METHOD__ );
                $thank = false;
                // Check that the Thank Extension and Echo extension are both 
installed
                // before doing this (bug 56825).
@@ -174,7 +165,7 @@
                                }
                        }
                }
-               wfProfileOut( __METHOD__ );
+
                return $thank;
        }
 }
diff --git a/includes/api/ApiMobileView.php b/includes/api/ApiMobileView.php
index feb6b17..a9ab69b 100644
--- a/includes/api/ApiMobileView.php
+++ b/includes/api/ApiMobileView.php
@@ -47,8 +47,6 @@
         * @todo: Write some unit tests for API results
         */
        public function execute() {
-               wfProfileIn( __METHOD__ );
-
                // Logged-in users' parser options depend on preferences
                $this->getMain()->setCacheMode( 'anon-public-user-private' );
 
@@ -248,8 +246,6 @@
                                array( 'continue-offset' => $params['offset'] + 
$params['maxlen'] )
                        );
                }
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -393,7 +389,6 @@
         * @return ParserOutput
         */
        protected function getParserOutput( WikiPage $wp, ParserOptions 
$parserOptions ) {
-               wfProfileIn( __METHOD__ );
                $time = microtime( true );
                $parserOutput = $wp->getParserOutput( $parserOptions );
                $time = microtime( true ) - $time;
@@ -403,7 +398,7 @@
                        throw new Exception( __METHOD__ . ": PoolCounter didn't 
return parser output" );
                }
                $parserOutput->setTOCEnabled( false );
-               wfProfileOut( __METHOD__ );
+
                return $parserOutput;
        }
 
@@ -435,7 +430,6 @@
                global $wgMemc, $wgUseTidy, $wgMFTidyMobileViewSections, 
$wgMFMinCachedPageSize,
                        $wgMFSpecialCaseMainPage;
 
-               wfProfileIn( __METHOD__ );
                $wp = $this->makeWikiPage( $title );
                if ( $this->followRedirects && $wp->isRedirect() ) {
                        $newTitle = $wp->getRedirectTarget();
@@ -448,7 +442,6 @@
                                        $this->getResult()->addValue( null, 
$this->getModuleName(),
                                                array( 'viewable' => 'no' )
                                        );
-                                       wfProfileOut( __METHOD__ );
                                        return array();
                                }
                                $wp = $this->makeWikiPage( $title );
@@ -480,7 +473,6 @@
                $data = $wgMemc->get( $key );
                if ( $data ) {
                        wfIncrStats( 'mobile.view.cache-hit' );
-                       wfProfileOut( __METHOD__ );
                        return $data;
                }
                wfIncrStats( 'mobile.view.cache-miss' );
@@ -492,7 +484,6 @@
                        $cacheExpiry = $parserOutput->getCacheExpiry();
                }
 
-               wfProfileIn( __METHOD__ . '-MobileFormatter' );
                if ( !$this->noTransform ) {
                        $mf = new MobileFormatter( MobileFormatter::wrapHTML( 
$html ), $title );
                        $mf->setRemoveMedia( $noImages );
@@ -500,7 +491,6 @@
                        $mf->setIsMainPage( $this->mainPage && 
$wgMFSpecialCaseMainPage );
                        $html = $mf->getText();
                }
-               wfProfileOut( __METHOD__ . '-MobileFormatter' );
 
                if ( $this->mainPage || $this->file ) {
                        $data = array(
@@ -509,7 +499,6 @@
                                'refsections' => array(),
                        );
                } else {
-                       wfProfileIn( __METHOD__ . '-sections' );
                        $data = array();
                        $data['sections'] = $parserOutput->getSections();
                        $sectionCount = count( $data['sections'] );
@@ -532,9 +521,7 @@
                                        $chunk = "<h$chunk";
                                }
                                if ( $wgUseTidy && $wgMFTidyMobileViewSections 
&& count( $chunks ) > 1 ) {
-                                       wfProfileIn( __METHOD__ . '-tidy' );
                                        $chunk = MWTidy::tidy( $chunk );
-                                       wfProfileOut( __METHOD__ . '-tidy' );
                                }
                                if ( preg_match( 
'/<ol\b[^>]*?class="references"/', $chunk ) ) {
                                        $data['refsections'][count( 
$data['text'] )] = true;
@@ -547,7 +534,6 @@
                                        $data['image'] = 
$image->getTitle()->getText();
                                }
                        }
-                       wfProfileOut( __METHOD__ . '-sections' );
                }
 
                $data['lastmodified'] = wfTimestamp( TS_ISO_8601, 
$wp->getTimestamp() );
@@ -586,7 +572,7 @@
                        // store for the same time as original parser output
                        $wgMemc->set( $key, $data, $cacheExpiry );
                }
-               wfProfileOut( __METHOD__ );
+
                return $data;
        }
 
@@ -597,7 +583,6 @@
         */
        private function getFilePage( Title $title ) {
                //HACK: HACK: HACK:
-               wfProfileIn( __METHOD__ );
                $context = new DerivativeContext( $this->getContext() );
                $context->setTitle( $title );
                $context->setOutput( new OutputPage( $context ) );
@@ -605,7 +590,7 @@
                $page->setContext( $context );
                $page->view();
                $html = $context->getOutput()->getHTML();
-               wfProfileOut( __METHOD__ );
+
                return $html;
        }
 
diff --git a/includes/api/ApiParseExtender.php 
b/includes/api/ApiParseExtender.php
index dd3ee2f..443213f 100644
--- a/includes/api/ApiParseExtender.php
+++ b/includes/api/ApiParseExtender.php
@@ -65,11 +65,9 @@
                global $wgMFSpecialCaseMainPage;
 
                if ( $module->getModuleName() == 'parse' ) {
-                       wfProfileIn( __METHOD__ );
                        $data = $module->getResultData();
                        $params = $module->extractRequestParams();
                        if ( isset( $data['parse']['text'] ) && 
$params['mobileformat'] ) {
-                               wfProfileIn( __METHOD__ . '-mobiletransform' );
                                $result = $module->getResult();
                                $result->reset();
 
@@ -88,9 +86,7 @@
                                $data['parse']['text'] = $arr;
 
                                $result->addValue( null, 
$module->getModuleName(), $data['parse'] );
-                               wfProfileOut( __METHOD__ . '-mobiletransform' );
                        }
-                       wfProfileOut( __METHOD__ );
                }
                return true;
        }
diff --git a/includes/diff/InlineDiffFormatter.php 
b/includes/diff/InlineDiffFormatter.php
index 97a92a5..2b3c583 100644
--- a/includes/diff/InlineDiffFormatter.php
+++ b/includes/diff/InlineDiffFormatter.php
@@ -95,8 +95,6 @@
         * @param string[] $closing New content to compare with
         */
        function changed( $orig, $closing ) {
-               wfProfileIn( __METHOD__ );
-
                echo '<div class="mw-diff-inline-changed">';
                $diff = new WordLevelDiff( $orig, $closing );
                $edits = $this->inlineWordDiff( $diff );
@@ -105,7 +103,6 @@
                echo implode( '', $edits );
 
                echo "</div>\n";
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -114,7 +111,6 @@
         * @return array Array of changed lines
         */
        private function inlineWordDiff( $diff ) {
-               wfProfileIn( __METHOD__ );
                $inline = new HWLDFWordAccumulator;
                $inline->insClass = $inline->delClass = '';
 
@@ -131,7 +127,6 @@
                        }
                }
                $lines = $inline->getLines();
-               wfProfileOut( __METHOD__ );
 
                return $lines;
        }
diff --git a/includes/diff/InlineDifferenceEngine.php 
b/includes/diff/InlineDifferenceEngine.php
index 34e6e0a..3a3f879 100644
--- a/includes/diff/InlineDifferenceEngine.php
+++ b/includes/diff/InlineDifferenceEngine.php
@@ -101,14 +101,10 @@
        function generateTextDiffBody( $otext, $ntext ) {
                global $wgContLang;
 
-               wfProfileIn( __METHOD__ );
                # First try wikidiff2
                if ( function_exists( 'wikidiff2_inline_diff' ) ) {
-                       wfProfileIn( 'wikidiff2_inline_diff' );
                        $text = wikidiff2_inline_diff( $otext, $ntext, 2 );
                        $text .= $this->debug( 'wikidiff2-inline' );
-                       wfProfileOut( 'wikidiff2_inline_diff' );
-                       wfProfileOut( __METHOD__ );
 
                        return $text;
                }
@@ -118,8 +114,7 @@
                $nta = explode( "\n", $wgContLang->segmentForDiff( $ntext ) );
                $diffs = new Diff( $ota, $nta );
                $formatter = new InlineDiffFormatter();
-               $difftext = $wgContLang->unsegmentForDiff( $formatter->format( 
$diffs ) ) .
-               wfProfileOut( __METHOD__ );
+               $difftext = $wgContLang->unsegmentForDiff( $formatter->format( 
$diffs ) );
 
                return $difftext;
        }
diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index f1626f9..41af82d 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -37,7 +37,7 @@
         */
        protected function prepareQuickTemplate() {
                global $wgAppleTouchIcon, $wgMFNoindexPages;
-               wfProfileIn( __METHOD__ );
+
                $out = $this->getOutput();
                // add head items
                if ( $wgAppleTouchIcon !== false ) {
@@ -100,7 +100,6 @@
                        $this->prepareMobileFooterLinks( $tpl );
                }
 
-               wfProfileOut( __METHOD__ );
                return $tpl;
        }
 
@@ -484,7 +483,7 @@
         */
        protected function getLogInOutLink() {
                global $wgSecureLogin;
-               wfProfileIn( __METHOD__ );
+
                $query = array();
                if ( !$this->getRequest()->wasPosted() ) {
                        $returntoquery = $this->getRequest()->getValues();
@@ -542,7 +541,6 @@
                        );
                }
 
-               wfProfileOut( __METHOD__ );
                return $loginLogoutLink;
        }
 
@@ -994,8 +992,6 @@
         * @param OutputPage $out optional parameter: The OutputPage Obj.
         */
        public function outputPage( OutputPage $out = null ) {
-               wfProfileIn( __METHOD__ );
-
                // This might seem weird but now the meaning of 'mobile' is 
morphing to mean 'minerva skin'
                // FIXME: Explore disabling this via a user preference and see 
what explodes
                // Important: This must run before outputPage which generates 
script and style tags
@@ -1010,7 +1006,6 @@
                        wfRunHooks( 'BeforePageDisplayMobile', array( &$out ) );
                }
                parent::outputPage();
-               wfProfileOut( __METHOD__ );
        }
 
        //
diff --git a/includes/skins/SkinMinervaBeta.php 
b/includes/skins/SkinMinervaBeta.php
index e1e7741..414ad4f 100644
--- a/includes/skins/SkinMinervaBeta.php
+++ b/includes/skins/SkinMinervaBeta.php
@@ -17,7 +17,6 @@
         * @param OutputPage $out optional parameter: The OutputPage Obj.
         */
        public function outputPage( OutputPage $out = null ) {
-               wfProfileIn( __METHOD__ );
                if ( !$out ) {
                        $out = $this->getOutput();
                }
diff --git a/includes/specials/MobileSpecialPageFeed.php 
b/includes/specials/MobileSpecialPageFeed.php
index f94b960..f4e793b 100644
--- a/includes/specials/MobileSpecialPageFeed.php
+++ b/includes/specials/MobileSpecialPageFeed.php
@@ -80,7 +80,6 @@
        protected function renderFeedItemHtml( $ts, $diffLink = '', $username = 
'', $comment = '',
                $title = null, $isAnon = false, $bytes = 0, $isMinor = false ) {
 
-               wfProfileIn( __METHOD__ );
                $output = $this->getOutput();
                $user = $this->getUser();
                $lang = $this->getLanguage();
@@ -146,6 +145,5 @@
                $html .= Html::closeElement( 'li' );
 
                $output->addHtml( $html );
-               wfProfileOut( __METHOD__ );
        }
 }
diff --git a/includes/specials/SpecialMobileContributions.php 
b/includes/specials/SpecialMobileContributions.php
index db2c300..cac225b 100644
--- a/includes/specials/SpecialMobileContributions.php
+++ b/includes/specials/SpecialMobileContributions.php
@@ -45,7 +45,6 @@
         * @param string $par The username
         */
        public function executeWhenAvailable( $par = '' ) {
-               wfProfileIn( __METHOD__ );
                $this->offset = $this->getRequest()->getVal( 'offset', false );
                if ( $par ) {
                        // enter article history view
@@ -66,12 +65,10 @@
                                }
                                $res = $this->doQuery();
                                $this->showContributions( $res );
-                               wfProfileOut( __METHOD__ );
                                return;
                        }
                }
                $this->showPageNotFound();
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -116,7 +113,6 @@
         * @param Revision $rev
         */
        protected function showContributionsRow( Revision $rev ) {
-               wfProfileIn( __METHOD__ );
                $user = $this->getUser();
                $userId = $rev->getUser( Revision::FOR_THIS_USER, $user );
                if ( $userId === 0 ) {
@@ -158,8 +154,6 @@
                $this->renderFeedItemHtml( $ts, $diffLink, $username, $comment,
                        $rev->getTitle(), $isAnon, $bytes, $isMinor
                );
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
diff --git a/includes/specials/SpecialMobileDiff.php 
b/includes/specials/SpecialMobileDiff.php
index 3829606..ac6d91f 100644
--- a/includes/specials/SpecialMobileDiff.php
+++ b/includes/specials/SpecialMobileDiff.php
@@ -89,7 +89,6 @@
         * @param string $par Revision IDs separated by three points (e.g. 
123...124)
         */
        function executeWhenAvailable( $par ) {
-               wfProfileIn( __METHOD__ );
                $ctx = MobileContext::singleton();
                $this->setHeaders();
                $output = $this->getOutput();
@@ -101,7 +100,6 @@
 
                if ( is_null( $rev ) ) {
                        $this->executeBadQuery();
-                       wfProfileOut( __METHOD__ );
                        return false;
                }
                $this->revId = $rev->getId();
@@ -130,7 +128,7 @@
                $this->showFooter();
 
                $output->addHtml( '</div>' );
-               wfProfileOut( __METHOD__ );
+
                return true;
        }
 
diff --git a/includes/specials/SpecialMobileEditWatchlist.php 
b/includes/specials/SpecialMobileEditWatchlist.php
index a34c270..638a3ae 100644
--- a/includes/specials/SpecialMobileEditWatchlist.php
+++ b/includes/specials/SpecialMobileEditWatchlist.php
@@ -37,7 +37,6 @@
         * @return string
         */
        public static function getLineHtml( Title $title, $ts, $thumb ) {
-               wfProfileIn( __METHOD__ );
                $titleText = $title->getPrefixedText();
                if ( $ts ) {
                        $ts = new MWTimestamp( $ts );
@@ -65,7 +64,6 @@
                        Html::closeElement( 'a' ) .
                        Html::closeElement( 'li' );
 
-               wfProfileOut( __METHOD__ );
                return $html;
        }
 
diff --git a/includes/specials/SpecialMobileEditor.php 
b/includes/specials/SpecialMobileEditor.php
index e97a200..c3a8a79 100644
--- a/includes/specials/SpecialMobileEditor.php
+++ b/includes/specials/SpecialMobileEditor.php
@@ -20,8 +20,6 @@
         * @param string $subpage The name of the page to edit
         */
        public function executeWhenAvailable( $subpage ) {
-               wfProfileIn( __METHOD__ );
-
                $title = Title::newFromText( $subpage );
 
                if ( is_null( $title )) {
@@ -69,7 +67,5 @@
                        Html::closeElement( 'div' ); // #mw-mf-editorunavailable
 
                $output->addHTML( $html );
-
-               wfProfileOut( __METHOD__ );
        }
 }
diff --git a/includes/specials/SpecialMobileHistory.php 
b/includes/specials/SpecialMobileHistory.php
index f12c904..576f955 100644
--- a/includes/specials/SpecialMobileHistory.php
+++ b/includes/specials/SpecialMobileHistory.php
@@ -91,8 +91,6 @@
         * @param string $par parameter as subpage of specialpage
         */
        public function executeWhenAvailable( $par = '' ) {
-               wfProfileIn( __METHOD__ );
-
                $out = $this->getOutput();
                $out->setPageTitle( $this->msg( 'history' ) );
                $this->offset = $this->getRequest()->getVal( 'offset', false );
@@ -103,13 +101,11 @@
                                $this->renderHeaderBar( $this->title );
                                $res = $this->doQuery();
                                $this->showHistory( $res );
-                               wfProfileOut( __METHOD__ );
                                return;
                        }
                }
 
                $this->showPageNotFound();
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -118,7 +114,6 @@
         * @return ResultWrapper
         */
        protected function doQuery() {
-               wfProfileIn( __METHOD__ );
                $dbr = wfGetDB( DB_SLAVE, self::DB_REVISIONS_TABLE );
                $conds = $this->getQueryConditions();
                $options = array(
@@ -130,11 +125,8 @@
                $tables = array( self::DB_REVISIONS_TABLE );
                $fields = array( '*' );
 
-               wfProfileIn( __METHOD__ . '-query' );
                $res = $dbr->select( $tables, $fields, $conds, __METHOD__, 
$options );
-               wfProfileOut( __METHOD__ . '-query' );
 
-               wfProfileOut( __METHOD__ );
                return $res;
        }
 
@@ -148,7 +140,6 @@
         * @param Revision|null $prev Revision id of previous Revision to 
display the difference
         */
        protected function showRow( Revision $rev, $prev ) {
-               wfProfileIn( __METHOD__ );
                $user = $this->getUser();
                $userId = $rev->getUser( Revision::FOR_THIS_USER, $user );
                if ( $userId === 0 ) {
@@ -198,8 +189,6 @@
                $isMinor = $rev->isMinor();
                $this->renderFeedItemHtml( $ts, $diffLink, $username, $comment, 
$title, $isAnon, $bytes,
                        $isMinor );
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
diff --git a/includes/specials/SpecialMobileLanguages.php 
b/includes/specials/SpecialMobileLanguages.php
index 6389529..9985e79 100644
--- a/includes/specials/SpecialMobileLanguages.php
+++ b/includes/specials/SpecialMobileLanguages.php
@@ -117,13 +117,11 @@
         * @param string $pagename The name of the page
         */
        public function executeWhenAvailable( $pagename ) {
-               wfProfileIn( __METHOD__ );
-
                if ( $pagename === '' ) {
                        wfHttpError( 404, $this->msg( 
'mobile-frontend-languages-404-title' )->text(),
                                $this->msg( 
'mobile-frontend-languages-404-desc' )->text()
                        );
-                       wfProfileOut( __METHOD__ );
+
                        return;
                }
 
@@ -194,6 +192,5 @@
 
                $output->setPageTitle( $pageTitle );
                $output->addHTML( $html );
-               wfProfileOut( __METHOD__ );
        }
 }
diff --git a/includes/specials/SpecialMobileOptions.php 
b/includes/specials/SpecialMobileOptions.php
index 42af520..917549a 100644
--- a/includes/specials/SpecialMobileOptions.php
+++ b/includes/specials/SpecialMobileOptions.php
@@ -173,7 +173,6 @@
        private function getSiteSelector() {
                global $wgLanguageCode;
 
-               wfProfileIn( __METHOD__ );
                $selector = '';
                $count = 0;
                $language = $this->getLanguage();
@@ -207,7 +206,7 @@
                        </ul>
 HTML;
                }
-               wfProfileOut( __METHOD__ );
+
                return $selector;
        }
 
diff --git a/includes/specials/SpecialMobileWatchlist.php 
b/includes/specials/SpecialMobileWatchlist.php
index 7d14646..6a8741f 100644
--- a/includes/specials/SpecialMobileWatchlist.php
+++ b/includes/specials/SpecialMobileWatchlist.php
@@ -56,7 +56,6 @@
                // Anons don't get a watchlist
                $this->requireLogin( 'watchlistanontext' );
 
-               wfProfileIn( __METHOD__ );
                $ctx = MobileContext::singleton();
                $this->usePageImages = !$ctx->imagesDisabled() && defined( 
'PAGE_IMAGES_INSTALLED' );
 
@@ -89,8 +88,6 @@
                } else {
                        $output->redirect( SpecialPage::getTitleFor( 
'EditWatchlist' )->getLocalURL() );
                }
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -211,8 +208,6 @@
         * @see doPageImages()
         */
        protected function doFeedQuery() {
-               wfProfileIn( __METHOD__ );
-
                $user = $this->getUser();
                $dbr = wfGetDB( DB_SLAVE, 'watchlist' );
 
@@ -257,11 +252,8 @@
                        array( &$conds, &$tables, &$join_conds, &$fields, 
&$values )
                );
 
-               wfProfileIn( __METHOD__ . '-query' );
                $res = $dbr->select( $tables, $fields, $conds, __METHOD__, 
$options, $join_conds );
-               wfProfileOut( __METHOD__ . '-query' );
 
-               wfProfileOut( __METHOD__ );
                return $res;
        }
 
@@ -284,8 +276,6 @@
         * are available to keep consistent with nearby view
         */
        protected function showResults( ResultWrapper $res, $feed ) {
-               wfProfileIn( __METHOD__ );
-
                $output = $this->getOutput();
 
                if ( $feed ) {
@@ -295,8 +285,6 @@
                }
 
                $output->addHtml( '</ul>' );
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -346,10 +334,7 @@
         * @param object $row a row of db result
         */
        protected function showFeedResultRow( $row ) {
-               wfProfileIn( __METHOD__ );
-
                if ( $row->rc_deleted ) {
-                       wfProfileOut( __METHOD__ );
                        return;
                }
 
@@ -380,7 +365,6 @@
 
                $this->renderFeedItemHtml( $ts, $diffLink, $username, $comment, 
$title, $isAnon, $bytes,
                        $isMinor );
-               wfProfileOut( __METHOD__ );
        }
 
        /**
diff --git a/includes/specials/SpecialUserProfile.php 
b/includes/specials/SpecialUserProfile.php
index 843f50c..78cc2d2 100644
--- a/includes/specials/SpecialUserProfile.php
+++ b/includes/specials/SpecialUserProfile.php
@@ -44,11 +44,8 @@
         * @return String HTML string representing the last upload by the user
         */
        protected function getLastUploadHtml() {
-               wfProfileIn( __METHOD__ );
-
                $file = $this->userInfo->getLastUpload();
                if ( !$file ) {
-                       wfProfileOut( __METHOD__ );
                        return '';
                }
 
@@ -70,7 +67,7 @@
                        Html::closeElement( 'div' ) .
                        Html::closeElement( 'a' ) .
                        Html::closeElement( 'div' );
-               wfProfileOut( __METHOD__ );
+
                return $img;
        }
 
@@ -80,7 +77,6 @@
         * @return String HTML string representing the last thank by the user
         */
        protected function getLastThanksHtml() {
-               wfProfileIn( __METHOD__ );
                $html = '';
                $thank = $this->userInfo->getLastThanking();
                if ( $thank ) {
@@ -97,7 +93,7 @@
                                . '</div>'
                                . '</div>';
                }
-               wfProfileOut( __METHOD__ );
+
                return $html;
        }
 
@@ -107,7 +103,6 @@
         * @return String HTML string representing the last edit by the user
         */
        protected function getLastEditHtml() {
-               wfProfileIn( __METHOD__ );
                $rev = $this->userInfo->getLastEdit();
                if ( $rev ) {
                        $daysAgo = $this->getDaysAgo( new MWTimestamp( 
wfTimestamp( TS_UNIX, $rev->getTimestamp() ) ) );
@@ -133,7 +128,6 @@
                        $html = '';
                }
 
-               wfProfileOut( __METHOD__ );
                return $html;
        }
 
@@ -220,7 +214,6 @@
         * @param string $par The username of the user to display
         */
        public function executeWhenAvailable( $par ) {
-               wfProfileIn( __METHOD__ );
                $out = $this->getOutput();
                $this->setHeaders();
                $out->addJsConfigVars( array( 'wgMFMaxDescriptionChars' => 
self::MAX_DESCRIPTION_CHARS ) );
@@ -257,7 +250,6 @@
                        wfHttpError( 404, $this->msg( 
'mobile-frontend-profile-error' )->text(),
                                $this->msg( 'mobile-frontend-profile-noargs' 
)->text() );
                }
-               wfProfileOut( __METHOD__ );
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/184801
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie4e37d1d0c86300944a9b34c0ceaf9ca482a7afe
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to