Changeset 156729 in webkit


Ignore:
Timestamp:
Oct 1, 2013 1:20:02 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Source/WebCore: Added adoptCOM to COMPtr on Windows.
https://bugs.webkit.org/show_bug.cgi?id=122069

Patch by Alex Christensen <achristensen@webkit.org> on 2013-10-01
Reviewed by Brent Fulgham.

  • platform/win/COMPtr.h:

(adoptCOM): Added.

Source/WebKit/win: Implemented createWebViewWithRequest in WinLauncher.
https://bugs.webkit.org/show_bug.cgi?id=122069

Patch by Alex Christensen <achristensen@webkit.org> on 2013-10-01
Reviewed by Brent Fulgham.

  • WebCoreSupport/WebChromeClient.cpp:

(WebChromeClient::createWindow):

  • WebCoreSupport/WebFrameLoaderClient.cpp:

(WebFrameLoaderClient::dispatchCreatePage):
Pass request url from the NavigationAction to createWebViewWithRequest.

Tools: Implemented createWebViewWithRequest in WinLauncher.
https://bugs.webkit.org/show_bug.cgi?id=122069

Patch by Alex Christensen <achristensen@webkit.org> on 2013-10-01
Reviewed by Brent Fulgham.

  • WinLauncher/PrintWebUIDelegate.cpp:

(PrintWebUIDelegate::createWebViewWithRequest): Added.

  • WinLauncher/PrintWebUIDelegate.h:

Removed createWebViewWithRequest stub.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r156726 r156729  
     12013-10-01  Alex Christensen  <achristensen@webkit.org>
     2
     3        Added adoptCOM to COMPtr on Windows.
     4        https://bugs.webkit.org/show_bug.cgi?id=122069
     5
     6        Reviewed by Brent Fulgham.
     7
     8        * platform/win/COMPtr.h:
     9        (adoptCOM): Added.
     10
    1112013-10-01  Jer Noble  <jer.noble@apple.com>
    212
  • trunk/Source/WebCore/platform/win/COMPtr.h

    r100030 r156729  
    102102};
    103103
     104template<typename T> inline COMPtr<T> adoptCOM(T *ptr)
     105{
     106    return COMPtr<T>(AdoptCOM, ptr);
     107}
     108
    104109template<typename T> inline void COMPtr<T>::clear()
    105110{
  • trunk/Source/WebKit/win/ChangeLog

    r156655 r156729  
     12013-10-01  Alex Christensen  <achristensen@webkit.org>
     2
     3        Implemented createWebViewWithRequest in WinLauncher.
     4        https://bugs.webkit.org/show_bug.cgi?id=122069
     5
     6        Reviewed by Brent Fulgham.
     7
     8        * WebCoreSupport/WebChromeClient.cpp:
     9        (WebChromeClient::createWindow):
     10        * WebCoreSupport/WebFrameLoaderClient.cpp:
     11        (WebFrameLoaderClient::dispatchCreatePage):
     12        Pass request url from the NavigationAction to createWebViewWithRequest.
     13
    1142013-09-30  Andreas Kling  <akling@apple.com>
    215
  • trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp

    r155544 r156729  
    195195}
    196196
    197 Page* WebChromeClient::createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures& features, const NavigationAction&)
     197Page* WebChromeClient::createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures& features, const NavigationAction& navigationAction)
    198198{
    199199    COMPtr<IWebUIDelegate> delegate = uiDelegate();
     
    201201        return 0;
    202202
    203     // Just create a blank request because createWindow() is only required to create window but not to load URL.
    204     COMPtr<IWebMutableURLRequest> request(AdoptCOM, WebMutableURLRequest::createInstance());
     203    COMPtr<WebMutableURLRequest> request = adoptCOM(WebMutableURLRequest::createInstance(ResourceRequest(navigationAction.url())));
    205204
    206205    COMPtr<IWebUIDelegatePrivate2> delegatePrivate(Query, delegate);
  • trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp

    r156550 r156729  
    530530}
    531531
    532 Frame* WebFrameLoaderClient::dispatchCreatePage(const NavigationAction&)
     532Frame* WebFrameLoaderClient::dispatchCreatePage(const NavigationAction& navigationAction)
    533533{
    534534    WebView* webView = m_webFrame->webView();
     
    539539
    540540    COMPtr<IWebView> newWebView;
    541     if (FAILED(ui->createWebViewWithRequest(webView, 0, &newWebView)))
     541    COMPtr<WebMutableURLRequest> request = adoptCOM(WebMutableURLRequest::createInstance(ResourceRequest(navigationAction.url())));
     542    if (FAILED(ui->createWebViewWithRequest(webView, request.get(), &newWebView)) || !newWebView)
    542543        return 0;
    543544
  • trunk/Tools/ChangeLog

    r156725 r156729  
     12013-10-01  Alex Christensen  <achristensen@webkit.org>
     2
     3        Implemented createWebViewWithRequest in WinLauncher.
     4        https://bugs.webkit.org/show_bug.cgi?id=122069
     5
     6        Reviewed by Brent Fulgham.
     7
     8        * WinLauncher/PrintWebUIDelegate.cpp:
     9        (PrintWebUIDelegate::createWebViewWithRequest): Added.
     10        * WinLauncher/PrintWebUIDelegate.h:
     11        Removed createWebViewWithRequest stub.
     12
    1132013-10-01  Tim Horton  <timothy_horton@apple.com>
    214
  • trunk/Tools/WinLauncher/PrintWebUIDelegate.cpp

    r155929 r156729  
    22 * Copyright (C) 2009, 2013 Apple Inc. All Rights Reserved.
    33 * Copyright (C) 2009 Brent Fulgham. All Rights Reserved.
     4 * Copyright (C) 2013 Alex Christensen. All Rights Reserved.
    45 *
    56 * Redistribution and use in source and binary forms, with or without
     
    3839static const int MARGIN = 20;
    3940
     41HRESULT STDMETHODCALLTYPE PrintWebUIDelegate::createWebViewWithRequest(IWebView*, IWebURLRequest* request, IWebView**)
     42{
     43    if (!request)
     44        return E_POINTER;
     45
     46    TCHAR executablePath[MAX_PATH];
     47    DWORD length = ::GetModuleFileName(GetModuleHandle(0), executablePath, ARRAYSIZE(executablePath));
     48    if (!length)
     49        return E_FAIL;
     50
     51    _bstr_t url;
     52    HRESULT hr = request->URL(&url.GetBSTR());
     53    if (FAILED(hr))
     54        return E_FAIL;
     55
     56    std::wstring command = std::wstring(L"\"") + executablePath + L"\" " + (const wchar_t*)url;
     57
     58    PROCESS_INFORMATION processInformation;
     59    STARTUPINFOW startupInfo;
     60    memset(&startupInfo, 0, sizeof(startupInfo));
     61    if (!::CreateProcessW(0, (LPWSTR)command.c_str(), 0, 0, 0, 0, 0, 0, &startupInfo, &processInformation))
     62        return E_FAIL;
     63
     64    return S_OK;
     65}
     66
    4067HRESULT PrintWebUIDelegate::QueryInterface(REFIID riid, void** ppvObject)
    4168{
  • trunk/Tools/WinLauncher/PrintWebUIDelegate.h

    r53154 r156729  
    3939    virtual ULONG STDMETHODCALLTYPE Release(void);
    4040
    41     virtual HRESULT STDMETHODCALLTYPE createWebViewWithRequest(IWebView*, IWebURLRequest*, IWebView**) { return E_NOTIMPL; }
     41    virtual HRESULT STDMETHODCALLTYPE createWebViewWithRequest(IWebView*, IWebURLRequest*, IWebView**);
    4242    virtual HRESULT STDMETHODCALLTYPE webViewShow(IWebView*) { return E_NOTIMPL; }
    4343    virtual HRESULT STDMETHODCALLTYPE webViewClose(IWebView*) { return E_NOTIMPL; }
Note: See TracChangeset for help on using the changeset viewer.