function ToolbarController::savePerformanceTimingAction

Parameters

\Symfony\Component\HttpKernel\Profiler\Profile $profile:

\Symfony\Component\HttpFoundation\Request $request:

Return value

\Symfony\Component\HttpFoundation\JsonResponse

1 string reference to 'ToolbarController::savePerformanceTimingAction'
webprofiler.routing.yml in webprofiler/webprofiler.routing.yml
webprofiler/webprofiler.routing.yml

File

webprofiler/src/Controller/ToolbarController.php, line 98

Class

ToolbarController
Class ToolbarController

Namespace

Drupal\webprofiler\Controller

Code

public function savePerformanceTimingAction(Profile $profile, Request $request) {
    $this->profiler
        ->disable();
    $data = Json::decode($request->getContent());
    
    /** @var  $collector */
    $collector = $profile->getCollector('performance_timing');
    $collector->setData($data);
    $this->profiler
        ->updateProfile($profile);
    return new JsonResponse([
        'success' => TRUE,
    ]);
}