Changeset 252872 in webkit


Ignore:
Timestamp:
Nov 25, 2019 6:56:33 PM (4 years ago)
Author:
Ross Kirsling
Message:

[Win] Ensure MiniBrowser can be built with !ENABLE(WEBKIT_LEGACY)
https://bugs.webkit.org/show_bug.cgi?id=204592

Reviewed by Don Olmstead.

  • MiniBrowser/win/CMakeLists.txt:
  • MiniBrowser/win/Common.cpp:

(parseCommandLine):

  • MiniBrowser/win/Common.h:
  • MiniBrowser/win/MainWindow.cpp:

(MainWindow::init):
(MainWindow::WndProc):

  • MiniBrowser/win/WinMain.cpp:

(wWinMain):

  • PlatformWin.cmake:
Location:
trunk/Tools
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r252870 r252872  
     12019-11-25  Ross Kirsling  <ross.kirsling@sony.com>
     2
     3        [Win] Ensure MiniBrowser can be built with !ENABLE(WEBKIT_LEGACY)
     4        https://bugs.webkit.org/show_bug.cgi?id=204592
     5
     6        Reviewed by Don Olmstead.
     7
     8        * MiniBrowser/win/CMakeLists.txt:
     9        * MiniBrowser/win/Common.cpp:
     10        (parseCommandLine):
     11        * MiniBrowser/win/Common.h:
     12        * MiniBrowser/win/MainWindow.cpp:
     13        (MainWindow::init):
     14        (MainWindow::WndProc):
     15        * MiniBrowser/win/WinMain.cpp:
     16        (wWinMain):
     17        * PlatformWin.cmake:
     18
    1192019-11-25  Fujii Hironori  <Hironori.Fujii@sony.com>
    220
  • trunk/Tools/MiniBrowser/win/CMakeLists.txt

    r250019 r252872  
    22    ${PAL_FRAMEWORK_HEADERS_DIR}
    33    ${WebCore_PRIVATE_FRAMEWORK_HEADERS_DIR}
    4     ${WebKitLegacy_FRAMEWORK_HEADERS_DIR}
    5     ${WebKit_FRAMEWORK_HEADERS_DIR}
    6     ${WebKit_PRIVATE_FRAMEWORK_HEADERS_DIR}
    74)
    85
    96set(MiniBrowser_SOURCES
    10     AccessibilityDelegate.cpp
    117    BrowserWindow.cpp
    128    Common.cpp
    139    MainWindow.cpp
    14     PrintWebUIDelegate.cpp
    15     ResourceLoadDelegate.cpp
    16     WebDownloadDelegate.cpp
    1710    MiniBrowserLib.rc
    18     MiniBrowserWebHost.cpp
    19     WebKitLegacyBrowserWindow.cpp
    2011    WinMain.cpp
    2112    stdafx.cpp
     
    2516    DbgHelp
    2617    WebKit::WTF
    27     WebKitLegacy
    28     WebKitLegacyGUID
    2918    comctl32
    3019    comsupp
     
    3928endif ()
    4029
     30if (ENABLE_WEBKIT_LEGACY)
     31    add_definitions(-DENABLE_WEBKIT_LEGACY)
     32    list(APPEND MiniBrowser_INCLUDE_DIRECTORIES
     33        ${WebKitLegacy_FRAMEWORK_HEADERS_DIR}
     34    )
     35    list(APPEND MiniBrowser_SOURCES
     36        AccessibilityDelegate.cpp
     37        MiniBrowserWebHost.cpp
     38        PrintWebUIDelegate.cpp
     39        ResourceLoadDelegate.cpp
     40        WebDownloadDelegate.cpp
     41        WebKitLegacyBrowserWindow.cpp
     42    )
     43    list(APPEND MiniBrowser_LIBRARIES
     44        WebKitLegacy
     45        WebKitLegacyGUID
     46    )
     47endif ()
     48
    4149if (ENABLE_WEBKIT)
    4250    add_definitions(-DENABLE_WEBKIT)
     51    list(APPEND MiniBrowser_INCLUDE_DIRECTORIES
     52        ${WebKit_FRAMEWORK_HEADERS_DIR}
     53        ${WebKit_PRIVATE_FRAMEWORK_HEADERS_DIR}
     54    )
    4355    list(APPEND MiniBrowser_SOURCES
    4456        WebKitBrowserWindow.cpp
    4557    )
    46     list(APPEND MiniBrowser_LIBRARIES WebKit)
     58    list(APPEND MiniBrowser_LIBRARIES
     59        WebKit
     60    )
    4761endif ()
    4862
  • trunk/Tools/MiniBrowser/win/Common.cpp

    r247896 r252872  
    272272        else if (!wcsicmp(argv[i], L"--desktop"))
    273273            options.useFullDesktop = true;
     274#if ENABLE(WEBKIT_LEGACY)
    274275        else if (!wcsicmp(argv[i], L"--wk1") || !wcsicmp(argv[i], L"--legacy"))
    275276            options.windowType = BrowserWindowType::WebKitLegacy;
     277#endif
    276278#if ENABLE(WEBKIT)
    277279        else if (!wcsicmp(argv[i], L"--wk2") || !wcsicmp(argv[i], L"--webkit"))
  • trunk/Tools/MiniBrowser/win/Common.h

    r247896 r252872  
    2828#include "stdafx.h"
    2929#include "MainWindow.h"
    30 #include "WebKitLegacyBrowserWindow.h"
    3130
    3231enum class BrowserWindowType {
  • trunk/Tools/MiniBrowser/win/MainWindow.cpp

    r249789 r252872  
    2929#include "Common.h"
    3030#include "MiniBrowserLibResource.h"
    31 #include "WebKitLegacyBrowserWindow.h"
     31#include <sstream>
     32
     33#if USE(CF)
    3234#include <CoreFoundation/CoreFoundation.h>
    33 #include <sstream>
     35#endif
    3436
    3537#if ENABLE(WEBKIT)
    3638#include "WebKitBrowserWindow.h"
     39#endif
     40
     41#if ENABLE(WEBKIT_LEGACY)
     42#include "WebKitLegacyBrowserWindow.h"
    3743#endif
    3844
     
    116122    EnableMenuItem(GetMenu(m_hMainWnd), IDM_NEW_WEBKIT_WINDOW, MF_GRAYED);
    117123#endif
     124#if !ENABLE(WEBKIT_LEGACY)
     125    EnableMenuItem(GetMenu(m_hMainWnd), IDM_NEW_WEBKITLEGACY_WINDOW, MF_GRAYED);
     126#endif
    118127
    119128    m_hBackButtonWnd = CreateWindow(L"BUTTON", L"<", WS_CHILD | WS_VISIBLE  | BS_TEXT, 0, 0, 0, 0, m_hMainWnd, reinterpret_cast<HMENU>(IDM_HISTORY_BACKWARD), hInstance, 0);
     
    194203        }
    195204#endif
     205#if ENABLE(WEBKIT_LEGACY)
    196206        case IDM_NEW_WEBKITLEGACY_WINDOW: {
    197207            auto& newWindow = MainWindow::create().leakRef();
     
    200210            break;
    201211        }
     212#endif
    202213        case IDM_CLOSE_WINDOW:
    203214            PostMessage(hWnd, WM_CLOSE, 0, 0);
  • trunk/Tools/MiniBrowser/win/WinMain.cpp

    r250117 r252872  
    3333#include "MiniBrowserLibResource.h"
    3434#include "MiniBrowserReplace.h"
    35 #include "WebKitLegacyBrowserWindow.h"
    36 #include <WebKitLegacy/WebKitCOMAPI.h>
    3735#include <wtf/win/SoftLinking.h>
     36
     37#if USE(CF)
     38#include <CoreFoundation/CoreFoundation.h>
     39#endif
    3840
    3941#if ENABLE(WEBKIT)
    4042#include "WebKitBrowserWindow.h"
     43#endif
     44
     45#if ENABLE(WEBKIT_LEGACY)
     46#include "WebKitLegacyBrowserWindow.h"
     47#include <WebKitLegacy/WebKitCOMAPI.h>
    4148#endif
    4249
     
    7380        ::SetProcessDPIAware();
    7481
     82#if !ENABLE(WEBKIT_LEGACY)
     83    auto factory = WebKitBrowserWindow::create;
     84#elif !ENABLE(WEBKIT)
    7585    auto factory = WebKitLegacyBrowserWindow::create;
    76 #if ENABLE(WEBKIT)
    77     if (options.windowType == BrowserWindowType::WebKit)
    78         factory = WebKitBrowserWindow::create;
     86#else
     87    auto factory = options.windowType == BrowserWindowType::WebKit ? WebKitBrowserWindow::create : WebKitLegacyBrowserWindow::create;
    7988#endif
    8089    auto& mainWindow = MainWindow::create().leakRef();
     
    96105    // Main message loop:
    97106    __try {
     107#if ENABLE(WEBKIT)
     108        while (GetMessage(&msg, nullptr, 0, 0)) {
     109#if USE(CF)
     110            CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true);
     111#endif
     112            if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) {
     113                TranslateMessage(&msg);
     114                DispatchMessage(&msg);
     115            }
     116        }
     117#else
    98118        IWebKitMessageLoopPtr messageLoop;
    99119
     
    103123
    104124        messageLoop->run(hAccelTable);
    105 
     125#endif
    106126    } __except(createCrashReport(GetExceptionInformation()), EXCEPTION_EXECUTE_HANDLER) { }
    107127
    108128exit:
     129#if !ENABLE(WEBKIT)
    109130    shutDownWebKit();
     131#endif
    110132#ifdef _CRTDBG_MAP_ALLOC
    111133    _CrtDumpMemoryLeaks();
  • trunk/Tools/PlatformWin.cmake

    r241858 r252872  
    11add_subdirectory(ImageDiff)
     2
     3if (ENABLE_WEBKIT OR ENABLE_WEBKIT_LEGACY)
     4    add_subdirectory(MiniBrowser/win)
     5endif ()
    26
    37if (ENABLE_WEBKIT_LEGACY)
    48    add_subdirectory(DumpRenderTree)
    5     add_subdirectory(MiniBrowser/win)
    69endif ()
    710
Note: See TracChangeset for help on using the changeset viewer.