⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 246076 in webkit


Ignore:
Timestamp:
Jun 4, 2019, 12:15:21 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

[WinCairo] Implement cpu and memory measuring functions.
https://bugs.webkit.org/show_bug.cgi?id=198466

Patch by Takashi Komori <Takashi.Komori@sony.com> on 2019-06-04
Reviewed by Don Olmstead.

.:

  • Source/cmake/OptionsWin.cmake:

Source/WebCore:

Tests: inspector/memory/tracking.html

inspector/cpu-profiler/tracking.html

  • PlatformWinCairo.cmake:
  • page/ResourceUsageThread.h:
  • page/win/ResourceUsageOverlayWin.cpp: Copied from Tools/WebKitTestRunner/InjectedBundle/win/TestRunnerWin.cpp.

(WebCore::ResourceUsageOverlay::platformInitialize):
(WebCore::ResourceUsageOverlay::platformDestroy):

  • page/win/ResourceUsageThreadWin.cpp: Added.

(WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
(WebCore::fileTimeToUint64):
(WebCore::getCurrentCpuTime):
(WebCore::cpuUsage):
(WebCore::memoryUsage):
(WebCore::ResourceUsageThread::platformCollectCPUData):
(WebCore::ResourceUsageThread::platformCollectMemoryData):

Tools:

  • WebKitTestRunner/InjectedBundle/win/TestRunnerWin.cpp:

(WTR::TestRunner::inspectorTestStubURL):

LayoutTests:

  • platform/wincairo/TestExpectations:
Location:
trunk
Files:
1 added
9 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r246033 r246076  
     12019-06-04  Takashi Komori  <Takashi.Komori@sony.com>
     2
     3        [WinCairo] Implement cpu and memory measuring functions.
     4        https://bugs.webkit.org/show_bug.cgi?id=198466
     5
     6        Reviewed by Don Olmstead.
     7
     8        * Source/cmake/OptionsWin.cmake:
     9
    1102019-06-03  Zan Dobersek  <zdobersek@igalia.com>
    211
  • trunk/LayoutTests/ChangeLog

    r246070 r246076  
     12019-06-04  Takashi Komori  <Takashi.Komori@sony.com>
     2
     3        [WinCairo] Implement cpu and memory measuring functions.
     4        https://bugs.webkit.org/show_bug.cgi?id=198466
     5
     6        Reviewed by Don Olmstead.
     7
     8        * platform/wincairo/TestExpectations:
     9
    1102019-06-02  Antoine Quint  <graouts@apple.com>
    211
  • trunk/LayoutTests/platform/wincairo/TestExpectations

    r245802 r246076  
    15651565imported/w3c [ Skip ]
    15661566inspector [ Skip ]
     1567inspector/memory/ [ Pass ]
     1568inspector/cpu-profiler/ [ Pass ]
     1569inspector/cpu-profiler/threads.html [ Failure ]
    15671570js/dom/deep-recursion-test.html [ Failure ]
    15681571js/dom/dom-static-property-for-in-iteration.html [ Failure ]
  • trunk/Source/WebCore/ChangeLog

    r246074 r246076  
     12019-06-04  Takashi Komori  <Takashi.Komori@sony.com>
     2
     3        [WinCairo] Implement cpu and memory measuring functions.
     4        https://bugs.webkit.org/show_bug.cgi?id=198466
     5
     6        Reviewed by Don Olmstead.
     7
     8        Tests: inspector/memory/tracking.html
     9               inspector/cpu-profiler/tracking.html
     10
     11        * PlatformWinCairo.cmake:
     12        * page/ResourceUsageThread.h:
     13        * page/win/ResourceUsageOverlayWin.cpp: Copied from Tools/WebKitTestRunner/InjectedBundle/win/TestRunnerWin.cpp.
     14        (WebCore::ResourceUsageOverlay::platformInitialize):
     15        (WebCore::ResourceUsageOverlay::platformDestroy):
     16        * page/win/ResourceUsageThreadWin.cpp: Added.
     17        (WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
     18        (WebCore::fileTimeToUint64):
     19        (WebCore::getCurrentCpuTime):
     20        (WebCore::cpuUsage):
     21        (WebCore::memoryUsage):
     22        (WebCore::ResourceUsageThread::platformCollectCPUData):
     23        (WebCore::ResourceUsageThread::platformCollectMemoryData):
     24
    1252019-06-04  Antoine Quint  <graouts@apple.com>
    226
  • trunk/Source/WebCore/PlatformWinCairo.cmake

    r244443 r246076  
    1313list(APPEND WebCore_SOURCES
    1414    page/win/FrameCairoWin.cpp
     15    page/win/ResourceUsageOverlayWin.cpp
     16    page/win/ResourceUsageThreadWin.cpp
    1517
    1618    platform/graphics/GLContext.cpp
  • trunk/Source/WebCore/page/ResourceUsageThread.h

    r240522 r246076  
    7373
    7474    void createThreadIfNeeded();
    75     void threadBody();
     75    NO_RETURN void threadBody();
    7676
    7777    void platformSaveStateBeforeStarting();
  • trunk/Source/WebCore/page/win/ResourceUsageOverlayWin.cpp

    r246075 r246076  
    11/*
    2  * Copyright (C) 2014 Igalia S.L.
     2 * Copyright (C) 2017 Igalia S.L.
     3 * Copyright (C) 2019 Sony Interactive Entertainment Inc.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    2526
    2627#include "config.h"
    27 #include "TestRunner.h"
     28#include "ResourceUsageOverlay.h"
    2829
    29 #include "ActivateFonts.h"
     30#if ENABLE(RESOURCE_USAGE)
    3031
    31 namespace WTR {
     32namespace WebCore {
    3233
    33 JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef)
    34 {
    35     return nullptr;
    36 }
    37 
    38 JSRetainPtr<JSStringRef> TestRunner::inspectorTestStubURL()
    39 {
    40     return JSStringCreateWithUTF8CString("");
    41 }
    42 
    43 void TestRunner::platformInitialize()
     34void ResourceUsageOverlay::platformInitialize()
    4435{
    4536}
    4637
    47 void TestRunner::installFakeHelvetica(JSStringRef configuration)
     38void ResourceUsageOverlay::platformDestroy()
    4839{
    49     WTR::installFakeHelvetica(toWK(configuration).get());
    5040}
    5141
    52 } // namespace WTR
     42}
     43
     44#endif
  • trunk/Source/cmake/OptionsWin.cmake

    r245567 r246076  
    9191    WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_REMOTE_INSPECTOR PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
    9292    WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_RESOURCE_LOAD_STATISTICS PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
     93    WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_RESOURCE_USAGE PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
    9394    WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SERVICE_WORKER PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
    9495    WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VARIATION_FONTS PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
  • trunk/Tools/ChangeLog

    r246059 r246076  
     12019-06-04  Takashi Komori  <Takashi.Komori@sony.com>
     2
     3        [WinCairo] Implement cpu and memory measuring functions.
     4        https://bugs.webkit.org/show_bug.cgi?id=198466
     5
     6        Reviewed by Don Olmstead.
     7
     8        * WebKitTestRunner/InjectedBundle/win/TestRunnerWin.cpp:
     9        (WTR::TestRunner::inspectorTestStubURL):
     10
    1112019-06-04  Zan Dobersek  <zdobersek@igalia.com>
    212
  • trunk/Tools/WebKitTestRunner/InjectedBundle/win/TestRunnerWin.cpp

    r244723 r246076  
    2828
    2929#include "ActivateFonts.h"
     30#include <shlwapi.h>
     31#include <wininet.h>
    3032
    3133namespace WTR {
     
    3840JSRetainPtr<JSStringRef> TestRunner::inspectorTestStubURL()
    3941{
    40     return JSStringCreateWithUTF8CString("");
     42    wchar_t exePath[MAX_PATH];
     43    if (::GetModuleFileName(nullptr, exePath, MAX_PATH)) {
     44        wchar_t drive[_MAX_DRIVE];
     45        wchar_t dir[_MAX_DIR];
     46        _wsplitpath(exePath, drive, dir, nullptr, nullptr);
     47
     48        wchar_t stubPath[MAX_PATH];
     49        wcsncpy(stubPath, drive, MAX_PATH);
     50        wcsncat(stubPath, dir, MAX_PATH - wcslen(stubPath));
     51        wcsncat(stubPath, L"\\WebKit.resources\\WebInspectorUI\\TestStub.html", MAX_PATH - wcslen(stubPath));
     52
     53        wchar_t fileURI[INTERNET_MAX_PATH_LENGTH];
     54        DWORD fileURILength = INTERNET_MAX_PATH_LENGTH;
     55        UrlCreateFromPathW(stubPath, fileURI, &fileURILength, 0);
     56
     57        return JSStringCreateWithCharacters(fileURI, fileURILength);
     58    }
     59
     60    return nullptr;
    4161}
    4262
Note: See TracChangeset for help on using the changeset viewer.