Changeset 182842 in webkit


Ignore:
Timestamp:
Apr 15, 2015, 9:19:39 AM (11 years ago)
Author:
eric.carlson@apple.com
Message:

Generalize "isPlayingAudio" to include other media characteristics
https://bugs.webkit.org/show_bug.cgi?id=143713

Reviewed by Jer Noble.

Source/WebCore:

No new functionality.

  • Modules/webaudio/AudioContext.cpp:

(WebCore::AudioContext::stop): updateIsPlayingAudio -> updateIsPlayingMedia.
(WebCore::AudioContext::isPlayingAudioDidChange): Ditto.

  • dom/Document.cpp:

(WebCore::Document::addAudioProducer): Ditto.
(WebCore::Document::removeAudioProducer): Ditto.
(WebCore::Document::updateIsPlayingMedia): Renamed.
(WebCore::Document::updateIsPlayingAudio): Deleted.

  • dom/Document.h:
  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::setMuted): updateIsPlayingAudio -> updateIsPlayingMedia.
(WebCore::HTMLMediaElement::setPlaying): Ditto.

  • page/ChromeClient.h:
  • page/Page.cpp:

(WebCore::Page::updateIsPlayingMedia): Renamed.
(WebCore::Page::updateIsPlayingAudio): Deleted.

  • page/Page.h:

Source/WebKit2:

  • UIProcess/API/C/WKPage.cpp:

(toGenericCallbackFunction): Scope CallbackBase.
(WKPageForceRepaint): Ditto.
(WKPageValidateCommand): Ditto.
(WKPageComputePagesForPrinting): Ditto.

  • UIProcess/API/Cocoa/_WKThumbnailView.mm:

(-[_WKThumbnailView _requestSnapshotIfNeeded]): Ditto.

  • UIProcess/API/mac/WKView.mm:

(-[WKView becomeFirstResponder]): Ditto.
(-[WKView updateFontPanelIfNeeded]): Ditto.
(-[WKView validateUserInterfaceItem:]): Ditto.
(-[WKView startSpeaking:]): Ditto.
(-[WKView selectedRangeWithCompletionHandler:]): Ditto.
(-[WKView markedRangeWithCompletionHandler:]): Ditto.
(-[WKView hasMarkedTextWithCompletionHandler:]): Ditto.
(-[WKView attributedSubstringForProposedRange:completionHandler:]): Ditto.
(-[WKView firstRectForCharacterRange:completionHandler:]): Ditto.
(-[WKView characterIndexForPoint:completionHandler:]): Ditto.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::isPlayingMediaDidChange): Rename from isPlayingAudioDidChange.
(WebKit::WebPageProxy::isPlayingAudioDidChange): Deleted.

  • UIProcess/WebPageProxy.h:
  • UIProcess/WebPageProxy.messages.in:
  • UIProcess/mac/WKFullScreenWindowController.mm:

(-[WKFullScreenWindowController dealloc]): Scope CallbackBase.
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto.

  • UIProcess/mac/WKPrintingView.mm:

(-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): Ditto.
(-[WKPrintingView _askPageToComputePageRects]): Ditto.
(-[WKPrintingView _drawPreview:]): Ditto.

  • WebProcess/Plugins/PluginView.cpp:

(WebKit::PluginView::setPluginIsPlayingAudio):

  • WebProcess/WebCoreSupport/WebChromeClient.cpp:

(WebKit::WebChromeClient::isPlayingMediaDidChange):
(WebKit::WebChromeClient::isPlayingAudioDidChange): Deleted.

  • WebProcess/WebCoreSupport/WebChromeClient.h:
Location:
trunk/Source
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r182840 r182842  
     12015-04-15  Eric Carlson  <eric.carlson@apple.com>
     2
     3        Generalize "isPlayingAudio" to include other media characteristics
     4        https://bugs.webkit.org/show_bug.cgi?id=143713
     5
     6        Reviewed by Jer Noble.
     7
     8        No new functionality.
     9
     10        * Modules/webaudio/AudioContext.cpp:
     11        (WebCore::AudioContext::stop): updateIsPlayingAudio -> updateIsPlayingMedia.
     12        (WebCore::AudioContext::isPlayingAudioDidChange): Ditto.
     13
     14        * dom/Document.cpp:
     15        (WebCore::Document::addAudioProducer): Ditto.
     16        (WebCore::Document::removeAudioProducer): Ditto.
     17        (WebCore::Document::updateIsPlayingMedia): Renamed.
     18        (WebCore::Document::updateIsPlayingAudio): Deleted.
     19        * dom/Document.h:
     20
     21        * html/HTMLMediaElement.cpp:
     22        (WebCore::HTMLMediaElement::setMuted): updateIsPlayingAudio -> updateIsPlayingMedia.
     23        (WebCore::HTMLMediaElement::setPlaying): Ditto.
     24
     25        * page/ChromeClient.h:
     26        * page/Page.cpp:
     27        (WebCore::Page::updateIsPlayingMedia): Renamed.
     28        (WebCore::Page::updateIsPlayingAudio): Deleted.
     29        * page/Page.h:
     30
    1312015-04-15  Joonghun Park  <jh718.park@samsung.com>
    232
  • trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp

    r182544 r182842  
    345345    m_isStopScheduled = true;
    346346
    347     document()->updateIsPlayingAudio();
     347    document()->updateIsPlayingMedia();
    348348
    349349    m_eventQueue->close();
     
    10391039void AudioContext::isPlayingAudioDidChange()
    10401040{
    1041     document()->updateIsPlayingAudio();
     1041    document()->updateIsPlayingMedia();
    10421042}
    10431043
  • trunk/Source/WebCore/dom/Document.cpp

    r182782 r182842  
    34173417{
    34183418    m_audioProducers.add(audioProducer);
    3419     updateIsPlayingAudio();
     3419    updateIsPlayingMedia();
    34203420}
    34213421
     
    34233423{
    34243424    m_audioProducers.remove(audioProducer);
    3425     updateIsPlayingAudio();
    3426 }
    3427 
    3428 void Document::updateIsPlayingAudio()
     3425    updateIsPlayingMedia();
     3426}
     3427
     3428void Document::updateIsPlayingMedia()
    34293429{
    34303430    bool isPlayingAudio = false;
     
    34423442
    34433443    if (page())
    3444         page()->updateIsPlayingAudio();
     3444        page()->updateIsPlayingMedia();
    34453445}
    34463446
  • trunk/Source/WebCore/dom/Document.h

    r182630 r182842  
    12301230    WEBCORE_EXPORT void removeAudioProducer(AudioProducer*);
    12311231    bool isPlayingAudio() const { return m_isPlayingAudio; }
    1232     WEBCORE_EXPORT void updateIsPlayingAudio();
     1232    WEBCORE_EXPORT void updateIsPlayingMedia();
    12331233    void pageMutedStateDidChange();
    12341234    WeakPtr<Document> createWeakPtr() { return m_weakFactory.createWeakPtr(); }
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r182820 r182842  
    30173017        }
    30183018        scheduleEvent(eventNames().volumechangeEvent);
    3019         document().updateIsPlayingAudio();
     3019        document().updateIsPlayingMedia();
    30203020    }
    30213021#endif
     
    43454345        renderer()->updateFromElement();
    43464346
    4347     document().updateIsPlayingAudio();
     4347    document().updateIsPlayingMedia();
    43484348
    43494349    endProcessingMediaPlayerCallback();
     
    46004600   
    46014601    m_playing = playing;
    4602     document().updateIsPlayingAudio();
     4602    document().updateIsPlayingMedia();
    46034603}
    46044604
  • trunk/Source/WebCore/page/ChromeClient.h

    r182320 r182842  
    424424    virtual bool shouldUseTiledBackingForFrameView(const FrameView*) const { return false; }
    425425
    426     virtual void isPlayingAudioDidChange(bool) { }
     426    enum MediaState {
     427        IsNotPlaying = 0,
     428        IsPlayingAudio = 1 << 0,
     429        IsPlayingVideo = 1 << 1,
     430        IsPlayingToExternalDevice = 1 << 2,
     431    };
     432    typedef unsigned MediaStateFlags;
     433    virtual void isPlayingMediaDidChange(MediaStateFlags) { }
     434
    427435    virtual void setPageActivityState(PageActivityState::Flags) { }
    428436
  • trunk/Source/WebCore/page/Page.cpp

    r182630 r182842  
    109109#include "HTMLVideoElement.h"
    110110#include "MediaPlaybackTarget.h"
    111 #include "MediaPlaybackTargetPickerClient.h"
    112111#endif
    113112
     
    11991198}
    12001199
    1201 void Page::updateIsPlayingAudio()
     1200void Page::updateIsPlayingMedia()
    12021201{
    12031202    bool isPlayingAudio = false;
     
    12141213    m_isPlayingAudio = isPlayingAudio;
    12151214
    1216     chrome().client().isPlayingAudioDidChange(m_isPlayingAudio);
     1215    chrome().client().isPlayingMediaDidChange(m_isPlayingAudio ? ChromeClient::IsPlayingAudio : ChromeClient::IsNotPlaying);
    12171216}
    12181217
  • trunk/Source/WebCore/page/Page.h

    r182630 r182842  
    424424
    425425    bool isPlayingAudio() const { return m_isPlayingAudio; }
    426     void updateIsPlayingAudio();
     426    void updateIsPlayingMedia();
    427427    bool isMuted() const { return m_muted; }
    428428    WEBCORE_EXPORT void setMuted(bool);
  • trunk/Source/WebKit2/ChangeLog

    r182841 r182842  
     12015-04-15  Eric Carlson  <eric.carlson@apple.com>
     2
     3        Generalize "isPlayingAudio" to include other media characteristics
     4        https://bugs.webkit.org/show_bug.cgi?id=143713
     5
     6        Reviewed by Jer Noble.
     7
     8        * UIProcess/API/C/WKPage.cpp:
     9        (toGenericCallbackFunction): Scope CallbackBase.
     10        (WKPageForceRepaint): Ditto.
     11        (WKPageValidateCommand): Ditto.
     12        (WKPageComputePagesForPrinting): Ditto.
     13
     14        * UIProcess/API/Cocoa/_WKThumbnailView.mm:
     15        (-[_WKThumbnailView _requestSnapshotIfNeeded]): Ditto.
     16
     17        * UIProcess/API/mac/WKView.mm:
     18        (-[WKView becomeFirstResponder]): Ditto.
     19        (-[WKView updateFontPanelIfNeeded]): Ditto.
     20        (-[WKView validateUserInterfaceItem:]): Ditto.
     21        (-[WKView startSpeaking:]): Ditto.
     22        (-[WKView selectedRangeWithCompletionHandler:]): Ditto.
     23        (-[WKView markedRangeWithCompletionHandler:]): Ditto.
     24        (-[WKView hasMarkedTextWithCompletionHandler:]): Ditto.
     25        (-[WKView attributedSubstringForProposedRange:completionHandler:]): Ditto.
     26        (-[WKView firstRectForCharacterRange:completionHandler:]): Ditto.
     27        (-[WKView characterIndexForPoint:completionHandler:]): Ditto.
     28
     29        * UIProcess/WebPageProxy.cpp:
     30        (WebKit::WebPageProxy::isPlayingMediaDidChange): Rename from isPlayingAudioDidChange.
     31        (WebKit::WebPageProxy::isPlayingAudioDidChange): Deleted.
     32        * UIProcess/WebPageProxy.h:
     33
     34        * UIProcess/WebPageProxy.messages.in:
     35
     36        * UIProcess/mac/WKFullScreenWindowController.mm:
     37        (-[WKFullScreenWindowController dealloc]): Scope CallbackBase.
     38        (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto.
     39
     40        * UIProcess/mac/WKPrintingView.mm:
     41        (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): Ditto.
     42        (-[WKPrintingView _askPageToComputePageRects]): Ditto.
     43        (-[WKPrintingView _drawPreview:]): Ditto.
     44
     45        * WebProcess/Plugins/PluginView.cpp:
     46        (WebKit::PluginView::setPluginIsPlayingAudio):
     47        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     48        (WebKit::WebChromeClient::isPlayingMediaDidChange):
     49        (WebKit::WebChromeClient::isPlayingAudioDidChange): Deleted.
     50        * WebProcess/WebCoreSupport/WebChromeClient.h:
     51
    1522015-04-15  Antti Koivisto  <antti@apple.com>
    253
  • trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp

    r182303 r182842  
    19341934#endif
    19351935
    1936 static std::function<void (const String&, CallbackBase::Error)> toGenericCallbackFunction(void* context, void (*callback)(WKStringRef, WKErrorRef, void*))
    1937 {
    1938     return [context, callback](const String& returnValue, CallbackBase::Error error) {
    1939         callback(toAPI(API::String::create(returnValue).get()), error != CallbackBase::Error::None ? toAPI(API::Error::create().get()) : 0, context);
     1936static std::function<void (const String&, WebKit::CallbackBase::Error)> toGenericCallbackFunction(void* context, void (*callback)(WKStringRef, WKErrorRef, void*))
     1937{
     1938    return [context, callback](const String& returnValue, WebKit::CallbackBase::Error error) {
     1939        callback(toAPI(API::String::create(returnValue).get()), error != WebKit::CallbackBase::Error::None ? toAPI(API::Error::create().get()) : 0, context);
    19401940    };
    19411941}
     
    19801980void WKPageForceRepaint(WKPageRef pageRef, void* context, WKPageForceRepaintFunction callback)
    19811981{
    1982     toImpl(pageRef)->forceRepaint(VoidCallback::create([context, callback](CallbackBase::Error error) {
    1983         callback(error == CallbackBase::Error::None ? nullptr : toAPI(API::Error::create().get()), context);
     1982    toImpl(pageRef)->forceRepaint(VoidCallback::create([context, callback](WebKit::CallbackBase::Error error) {
     1983        callback(error == WebKit::CallbackBase::Error::None ? nullptr : toAPI(API::Error::create().get()), context);
    19841984    }));
    19851985}
     
    20172017void WKPageValidateCommand(WKPageRef pageRef, WKStringRef command, void* context, WKPageValidateCommandCallback callback)
    20182018{
    2019     toImpl(pageRef)->validateCommand(toImpl(command)->string(), [context, callback](const String& commandName, bool isEnabled, int32_t state, CallbackBase::Error error) {
    2020         callback(toAPI(API::String::create(commandName).get()), isEnabled, state, error != CallbackBase::Error::None ? toAPI(API::Error::create().get()) : 0, context);
     2019    toImpl(pageRef)->validateCommand(toImpl(command)->string(), [context, callback](const String& commandName, bool isEnabled, int32_t state, WebKit::CallbackBase::Error error) {
     2020        callback(toAPI(API::String::create(commandName).get()), isEnabled, state, error != WebKit::CallbackBase::Error::None ? toAPI(API::Error::create().get()) : 0, context);
    20212021    });
    20222022}
     
    20392039void WKPageComputePagesForPrinting(WKPageRef page, WKFrameRef frame, WKPrintInfo printInfo, WKPageComputePagesForPrintingFunction callback, void* context)
    20402040{
    2041     toImpl(page)->computePagesForPrinting(toImpl(frame), printInfoFromWKPrintInfo(printInfo), ComputedPagesCallback::create([context, callback](const Vector<WebCore::IntRect>& rects, double scaleFactor, CallbackBase::Error error) {
     2041    toImpl(page)->computePagesForPrinting(toImpl(frame), printInfoFromWKPrintInfo(printInfo), ComputedPagesCallback::create([context, callback](const Vector<WebCore::IntRect>& rects, double scaleFactor, WebKit::CallbackBase::Error error) {
    20422042        Vector<WKRect> wkRects(rects.size());
    20432043        for (size_t i = 0; i < rects.size(); ++i)
    20442044            wkRects[i] = toAPI(rects[i]);
    2045         callback(wkRects.data(), wkRects.size(), scaleFactor, error != CallbackBase::Error::None ? toAPI(API::Error::create().get()) : 0, context);
     2045        callback(wkRects.data(), wkRects.size(), scaleFactor, error != WebKit::CallbackBase::Error::None ? toAPI(API::Error::create().get()) : 0, context);
    20462046    }));
    20472047}
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm

    r182753 r182842  
    120120    bitmapSize.scale(_scale * _webPageProxy->deviceScaleFactor());
    121121    _lastSnapshotScale = _scale;
    122     _webPageProxy->takeSnapshot(snapshotRect, bitmapSize, options, [thumbnailView](const ShareableBitmap::Handle& imageHandle, CallbackBase::Error) {
     122    _webPageProxy->takeSnapshot(snapshotRect, bitmapSize, options, [thumbnailView](const ShareableBitmap::Handle& imageHandle, WebKit::CallbackBase::Error) {
    123123        RefPtr<ShareableBitmap> bitmap = ShareableBitmap::create(imageHandle, SharedMemory::Protection::ReadOnly);
    124124        RetainPtr<CGImageRef> cgImage = bitmap ? bitmap->makeCGImage() : nullptr;
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp

    r182175 r182842  
    28932893
    28942894    GTask* task = g_task_new(webView, cancellable, callback, userData);
    2895     getPage(webView)->validateCommand(String::fromUTF8(command), [task](const String&, bool isEnabled, int32_t, CallbackBase::Error) {
     2895    getPage(webView)->validateCommand(String::fromUTF8(command), [task](const String&, bool isEnabled, int32_t, WebKit::CallbackBase::Error) {
    28962896        g_task_return_boolean(adoptGRef(task).get(), isEnabled);       
    28972897    });
     
    30093009
    30103010    GTask* task = g_task_new(webView, cancellable, callback, userData);
    3011     getPage(webView)->runJavaScriptInMainFrame(String::fromUTF8(script), [task](API::SerializedScriptValue* serializedScriptValue, CallbackBase::Error) {
     3011    getPage(webView)->runJavaScriptInMainFrame(String::fromUTF8(script), [task](API::SerializedScriptValue* serializedScriptValue, WebKit::CallbackBase::Error) {
    30123012        webkitWebViewRunJavaScriptCallback(serializedScriptValue, adoptGRef(task).get());
    30133013    });
     
    31003100    gpointer outputStreamData = g_memory_output_stream_get_data(G_MEMORY_OUTPUT_STREAM(object));
    31013101    getPage(webView)->runJavaScriptInMainFrame(String::fromUTF8(reinterpret_cast<const gchar*>(outputStreamData)),
    3102         [task](API::SerializedScriptValue* serializedScriptValue, CallbackBase::Error) {
     3102        [task](API::SerializedScriptValue* serializedScriptValue, WebKit::CallbackBase::Error) {
    31033103            webkitWebViewRunJavaScriptCallback(serializedScriptValue, task.get());
    31043104        });
     
    32783278    g_task_set_source_tag(task, reinterpret_cast<gpointer>(webkit_web_view_save));
    32793279    g_task_set_task_data(task, createViewSaveAsyncData(), reinterpret_cast<GDestroyNotify>(destroyViewSaveAsyncData));
    3280     getPage(webView)->getContentsAsMHTMLData([task](API::Data* data, CallbackBase::Error) {
     3280    getPage(webView)->getContentsAsMHTMLData([task](API::Data* data, WebKit::CallbackBase::Error) {
    32813281        getContentsAsMHTMLDataCallback(data, task);
    32823282    }, false);
     
    33433343    g_task_set_task_data(task, data, reinterpret_cast<GDestroyNotify>(destroyViewSaveAsyncData));
    33443344
    3345     getPage(webView)->getContentsAsMHTMLData([task](API::Data* data, CallbackBase::Error) {
     3345    getPage(webView)->getContentsAsMHTMLData([task](API::Data* data, WebKit::CallbackBase::Error) {
    33463346        getContentsAsMHTMLDataCallback(data, task);
    33473347    }, false);
  • trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm

    r182781 r182842  
    471471        if ([event type] == NSKeyDown || [event type] == NSKeyUp)
    472472            keyboardEvent = event;
    473         _data->_page->setInitialFocus(direction == NSSelectingNext, keyboardEvent != nil, NativeWebKeyboardEvent(keyboardEvent, false, Vector<KeypressCommand>()), [](CallbackBase::Error) { });
     473        _data->_page->setInitialFocus(direction == NSSelectingNext, keyboardEvent != nil, NativeWebKeyboardEvent(keyboardEvent, false, Vector<KeypressCommand>()), [](WebKit::CallbackBase::Error) { });
    474474    }
    475475    return YES;
     
    836836        return;
    837837    if ([NSFontPanel sharedFontPanelExists] && [[NSFontPanel sharedFontPanel] isVisible]) {
    838         _data->_page->fontAtSelection([](const String& fontName, double fontSize, bool selectionHasMultipleFonts, CallbackBase::Error error) {
     838        _data->_page->fontAtSelection([](const String& fontName, double fontSize, bool selectionHasMultipleFonts, WebKit::CallbackBase::Error error) {
    839839            NSFont *font = [NSFont fontWithName:fontName size:fontSize];
    840840            if (font)
     
    996996        // FIXME: Theoretically, there is a race here; when we get the answer it might be old, from a previous time
    997997        // we asked for the same command; there is no guarantee the answer is still valid.
    998         _data->_page->validateCommand(commandName, [self](const String& commandName, bool isEnabled, int32_t state, CallbackBase::Error error) {
     998        _data->_page->validateCommand(commandName, [self](const String& commandName, bool isEnabled, int32_t state, WebKit::CallbackBase::Error error) {
    999999            // If the process exits before the command can be validated, we'll be called back with an error.
    1000             if (error != CallbackBase::Error::None)
     1000            if (error != WebKit::CallbackBase::Error::None)
    10011001                return;
    10021002           
     
    10131013- (IBAction)startSpeaking:(id)sender
    10141014{
    1015     _data->_page->getSelectionOrContentsAsString([self](const String& string, CallbackBase::Error error) {
    1016         if (error != CallbackBase::Error::None)
     1015    _data->_page->getSelectionOrContentsAsString([self](const String& string, WebKit::CallbackBase::Error error) {
     1016        if (error != WebKit::CallbackBase::Error::None)
    10171017            return;
    10181018        if (!string)
     
    16771677
    16781678    LOG(TextInput, "selectedRange");
    1679     _data->_page->getSelectedRangeAsync([completionHandler](const EditingRange& editingRangeResult, CallbackBase::Error error) {
     1679    _data->_page->getSelectedRangeAsync([completionHandler](const EditingRange& editingRangeResult, WebKit::CallbackBase::Error error) {
    16801680        void (^completionHandlerBlock)(NSRange) = (void (^)(NSRange))completionHandler.get();
    1681         if (error != CallbackBase::Error::None) {
     1681        if (error != WebKit::CallbackBase::Error::None) {
    16821682            LOG(TextInput, "    ...selectedRange failed.");
    16831683            completionHandlerBlock(NSMakeRange(NSNotFound, 0));
     
    16981698
    16991699    LOG(TextInput, "markedRange");
    1700     _data->_page->getMarkedRangeAsync([completionHandler](const EditingRange& editingRangeResult, CallbackBase::Error error) {
     1700    _data->_page->getMarkedRangeAsync([completionHandler](const EditingRange& editingRangeResult, WebKit::CallbackBase::Error error) {
    17011701        void (^completionHandlerBlock)(NSRange) = (void (^)(NSRange))completionHandler.get();
    1702         if (error != CallbackBase::Error::None) {
     1702        if (error != WebKit::CallbackBase::Error::None) {
    17031703            LOG(TextInput, "    ...markedRange failed.");
    17041704            completionHandlerBlock(NSMakeRange(NSNotFound, 0));
     
    17191719
    17201720    LOG(TextInput, "hasMarkedText");
    1721     _data->_page->getMarkedRangeAsync([completionHandler](const EditingRange& editingRangeResult, CallbackBase::Error error) {
     1721    _data->_page->getMarkedRangeAsync([completionHandler](const EditingRange& editingRangeResult, WebKit::CallbackBase::Error error) {
    17221722        void (^completionHandlerBlock)(BOOL) = (void (^)(BOOL))completionHandler.get();
    1723         if (error != CallbackBase::Error::None) {
     1723        if (error != WebKit::CallbackBase::Error::None) {
    17241724            LOG(TextInput, "    ...hasMarkedText failed.");
    17251725            completionHandlerBlock(NO);
     
    17371737
    17381738    LOG(TextInput, "attributedSubstringFromRange:(%u, %u)", nsRange.location, nsRange.length);
    1739     _data->_page->attributedSubstringForCharacterRangeAsync(nsRange, [completionHandler](const AttributedString& string, const EditingRange& actualRange, CallbackBase::Error error) {
     1739    _data->_page->attributedSubstringForCharacterRangeAsync(nsRange, [completionHandler](const AttributedString& string, const EditingRange& actualRange, WebKit::CallbackBase::Error error) {
    17401740        void (^completionHandlerBlock)(NSAttributedString *, NSRange) = (void (^)(NSAttributedString *, NSRange))completionHandler.get();
    1741         if (error != CallbackBase::Error::None) {
     1741        if (error != WebKit::CallbackBase::Error::None) {
    17421742            LOG(TextInput, "    ...attributedSubstringFromRange failed.");
    17431743            completionHandlerBlock(0, NSMakeRange(NSNotFound, 0));
     
    17671767    }
    17681768
    1769     _data->_page->firstRectForCharacterRangeAsync(theRange, [self, completionHandler](const IntRect& rect, const EditingRange& actualRange, CallbackBase::Error error) {
     1769    _data->_page->firstRectForCharacterRangeAsync(theRange, [self, completionHandler](const IntRect& rect, const EditingRange& actualRange, WebKit::CallbackBase::Error error) {
    17701770        void (^completionHandlerBlock)(NSRect, NSRange) = (void (^)(NSRect, NSRange))completionHandler.get();
    1771         if (error != CallbackBase::Error::None) {
     1771        if (error != WebKit::CallbackBase::Error::None) {
    17721772            LOG(TextInput, "    ...firstRectForCharacterRange failed.");
    17731773            completionHandlerBlock(NSZeroRect, NSMakeRange(NSNotFound, 0));
     
    17981798    thePoint = [self convertPoint:thePoint fromView:nil];  // the point is relative to the main frame
    17991799
    1800     _data->_page->characterIndexForPointAsync(IntPoint(thePoint), [completionHandler](uint64_t result, CallbackBase::Error error) {
     1800    _data->_page->characterIndexForPointAsync(IntPoint(thePoint), [completionHandler](uint64_t result, WebKit::CallbackBase::Error error) {
    18011801        void (^completionHandlerBlock)(NSUInteger) = (void (^)(NSUInteger))completionHandler.get();
    1802         if (error != CallbackBase::Error::None) {
     1802        if (error != WebKit::CallbackBase::Error::None) {
    18031803            LOG(TextInput, "    ...characterIndexForPoint failed.");
    18041804            completionHandlerBlock(0);
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r182772 r182842  
    56415641}
    56425642
    5643 void WebPageProxy::isPlayingAudioDidChange(bool newIsPlayingAudio)
    5644 {
    5645     if (m_isPlayingAudio == newIsPlayingAudio)
    5646         return;
    5647 
    5648     m_isPlayingAudio = newIsPlayingAudio;
     5643void WebPageProxy::isPlayingMediaDidChange(WebCore::ChromeClient::MediaStateFlags state)
     5644{
     5645    bool isPlayingAudio = state & WebCore::ChromeClient::IsPlayingAudio;
     5646    if (m_isPlayingAudio == isPlayingAudio)
     5647        return;
     5648
     5649    m_isPlayingAudio = isPlayingAudio;
    56495650    m_uiClient->isPlayingAudioDidChange(*this);
    56505651}
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r182772 r182842  
    6464#include "WebPopupMenuProxy.h"
    6565#include "WebProcessLifetimeTracker.h"
     66#include <WebCore/ChromeClient.h>
    6667#include <WebCore/Color.h>
    6768#include <WebCore/DragActions.h>
     
    983984    bool isShowingNavigationGestureSnapshot() const { return m_isShowingNavigationGestureSnapshot; }
    984985
    985     void isPlayingAudioDidChange(bool);
     986    void isPlayingMediaDidChange(WebCore::ChromeClient::MediaStateFlags);
    986987    bool isPlayingAudio() const { return m_isPlayingAudio; }
    987988
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in

    r182442 r182842  
    422422#endif
    423423
    424     IsPlayingAudioDidChange(bool newIsPlayingAudio)
     424    IsPlayingMediaDidChange(unsigned state)
    425425
    426426#if PLATFORM(MAC)
  • trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm

    r182749 r182842  
    15471547        return;
    15481548
    1549     _page->getSelectionOrContentsAsString([self](const String& string, CallbackBase::Error error) {
    1550         if (error != CallbackBase::Error::None)
     1549    _page->getSelectionOrContentsAsString([self](const String& string, WebKit::CallbackBase::Error error) {
     1550        if (error != WebKit::CallbackBase::Error::None)
    15511551            return;
    15521552        if (!string)
     
    15591559- (void)accessibilityRetrieveSpeakSelectionContent
    15601560{
    1561     _page->getSelectionOrContentsAsString([self](const String& string, CallbackBase::Error error) {
    1562         if (error != CallbackBase::Error::None)
     1561    _page->getSelectionOrContentsAsString([self](const String& string, WebKit::CallbackBase::Error error) {
     1562        if (error != WebKit::CallbackBase::Error::None)
    15631563            return;
    15641564        if ([self respondsToSelector:@selector(accessibilitySpeakSelectionSetContent:)])
     
    17781778}
    17791779
    1780 static void selectionChangedWithGesture(WKContentView *view, const WebCore::IntPoint& point, uint32_t gestureType, uint32_t gestureState, uint32_t flags, CallbackBase::Error error)
    1781 {
    1782     if (error != CallbackBase::Error::None) {
     1780static void selectionChangedWithGesture(WKContentView *view, const WebCore::IntPoint& point, uint32_t gestureType, uint32_t gestureState, uint32_t flags, WebKit::CallbackBase::Error error)
     1781{
     1782    if (error != WebKit::CallbackBase::Error::None) {
    17831783        ASSERT_NOT_REACHED();
    17841784        return;
     
    17901790}
    17911791
    1792 static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoint& point, uint32_t touch, CallbackBase::Error error)
    1793 {
    1794     if (error != CallbackBase::Error::None) {
     1792static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoint& point, uint32_t touch, WebKit::CallbackBase::Error error)
     1793{
     1794    if (error != WebKit::CallbackBase::Error::None) {
    17951795        ASSERT_NOT_REACHED();
    17961796        return;
     
    18121812{
    18131813    _usingGestureForSelection = YES;
    1814     _page->selectWithGesture(WebCore::IntPoint(point), CharacterGranularity, static_cast<uint32_t>(toGestureType(gestureType)), static_cast<uint32_t>(toGestureRecognizerState(state)), [self, state](const WebCore::IntPoint& point, uint32_t gestureType, uint32_t gestureState, uint32_t flags, CallbackBase::Error error) {
     1814    _page->selectWithGesture(WebCore::IntPoint(point), CharacterGranularity, static_cast<uint32_t>(toGestureType(gestureType)), static_cast<uint32_t>(toGestureRecognizerState(state)), [self, state](const WebCore::IntPoint& point, uint32_t gestureType, uint32_t gestureState, uint32_t flags, WebKit::CallbackBase::Error error) {
    18151815        selectionChangedWithGesture(self, point, gestureType, gestureState, flags, error);
    18161816        if (state == UIGestureRecognizerStateEnded || state == UIGestureRecognizerStateCancelled)
     
    18221822{
    18231823    _usingGestureForSelection = YES;
    1824     _page->updateSelectionWithTouches(WebCore::IntPoint(point), static_cast<uint32_t>(toSelectionTouch(touch)), baseIsStart, [self, touch](const WebCore::IntPoint& point, uint32_t touch, CallbackBase::Error error) {
     1824    _page->updateSelectionWithTouches(WebCore::IntPoint(point), static_cast<uint32_t>(toSelectionTouch(touch)), baseIsStart, [self, touch](const WebCore::IntPoint& point, uint32_t touch, WebKit::CallbackBase::Error error) {
    18251825        selectionChangedWithTouch(self, point, touch, error);
    18261826        if (touch != UIWKSelectionTouchStarted && touch != UIWKSelectionTouchMoved)
     
    18321832{
    18331833    _usingGestureForSelection = YES;
    1834     _page->selectWithTwoTouches(WebCore::IntPoint(from), WebCore::IntPoint(to), static_cast<uint32_t>(toGestureType(gestureType)), static_cast<uint32_t>(toGestureRecognizerState(gestureState)), [self, gestureState](const WebCore::IntPoint& point, uint32_t gestureType, uint32_t gestureState, uint32_t flags, CallbackBase::Error error) {
     1834    _page->selectWithTwoTouches(WebCore::IntPoint(from), WebCore::IntPoint(to), static_cast<uint32_t>(toGestureType(gestureType)), static_cast<uint32_t>(toGestureRecognizerState(gestureState)), [self, gestureState](const WebCore::IntPoint& point, uint32_t gestureType, uint32_t gestureState, uint32_t flags, WebKit::CallbackBase::Error error) {
    18351835        selectionChangedWithGesture(self, point, gestureType, gestureState, flags, error);
    18361836        if (gestureState == UIGestureRecognizerStateEnded || gestureState == UIGestureRecognizerStateCancelled)
     
    18511851   
    18521852    [self beginSelectionChange];
    1853     _page->moveSelectionByOffset(offset, [self](CallbackBase::Error) {
     1853    _page->moveSelectionByOffset(offset, [self](WebKit::CallbackBase::Error) {
    18541854        [self endSelectionChange];
    18551855    });
     
    18701870
    18711871    _autocorrectionData.autocorrectionHandler = [completionHandler copy];
    1872     _page->requestAutocorrectionData(input, [self](const Vector<FloatRect>& rects, const String& fontName, double fontSize, uint64_t traits, CallbackBase::Error) {
     1872    _page->requestAutocorrectionData(input, [self](const Vector<FloatRect>& rects, const String& fontName, double fontSize, uint64_t traits, WebKit::CallbackBase::Error) {
    18731873        CGRect firstRect = CGRectZero;
    18741874        CGRect lastRect = CGRectZero;
     
    18941894    UIWKSelectionCompletionHandler selectionHandler = [completionHandler copy];
    18951895   
    1896     _page->selectPositionAtPoint(WebCore::IntPoint(point), [selectionHandler](CallbackBase::Error error) {
     1896    _page->selectPositionAtPoint(WebCore::IntPoint(point), [selectionHandler](WebKit::CallbackBase::Error error) {
    18971897        selectionHandler();
    18981898        [selectionHandler release];
     
    19041904    UIWKSelectionCompletionHandler selectionHandler = [completionHandler copy];
    19051905   
    1906     _page->selectPositionAtBoundaryWithDirection(WebCore::IntPoint(point), toWKTextGranularity(granularity), toWKSelectionDirection(direction), [selectionHandler](CallbackBase::Error error) {
     1906    _page->selectPositionAtBoundaryWithDirection(WebCore::IntPoint(point), toWKTextGranularity(granularity), toWKSelectionDirection(direction), [selectionHandler](WebKit::CallbackBase::Error error) {
    19071907        selectionHandler();
    19081908        [selectionHandler release];
     
    19141914    UIWKSelectionCompletionHandler selectionHandler = [completionHandler copy];
    19151915
    1916     _page->selectTextWithGranularityAtPoint(WebCore::IntPoint(point), toWKTextGranularity(granularity), [selectionHandler](CallbackBase::Error error) {
     1916    _page->selectTextWithGranularityAtPoint(WebCore::IntPoint(point), toWKTextGranularity(granularity), [selectionHandler](WebKit::CallbackBase::Error error) {
    19171917        selectionHandler();
    19181918        [selectionHandler release];
     
    19241924    UIWKSelectionWithDirectionCompletionHandler selectionHandler = [completionHandler copy];
    19251925
    1926     _page->beginSelectionInDirection(toWKSelectionDirection(direction), [selectionHandler](bool endIsMoving, CallbackBase::Error error) {
     1926    _page->beginSelectionInDirection(toWKSelectionDirection(direction), [selectionHandler](bool endIsMoving, WebKit::CallbackBase::Error error) {
    19271927        selectionHandler(endIsMoving);
    19281928        [selectionHandler release];
     
    19341934    UIWKSelectionWithDirectionCompletionHandler selectionHandler = [completionHandler copy];
    19351935   
    1936     _page->updateSelectionWithExtentPoint(WebCore::IntPoint(point), [selectionHandler](bool endIsMoving, CallbackBase::Error error) {
     1936    _page->updateSelectionWithExtentPoint(WebCore::IntPoint(point), [selectionHandler](bool endIsMoving, WebKit::CallbackBase::Error error) {
    19371937        selectionHandler(endIsMoving);
    19381938        [selectionHandler release];
     
    19831983    UIWKDictationContextHandler dictationHandler = [completionHandler copy];
    19841984
    1985     _page->requestDictationContext([dictationHandler](const String& selectedText, const String& beforeText, const String& afterText, CallbackBase::Error) {
     1985    _page->requestDictationContext([dictationHandler](const String& selectedText, const String& beforeText, const String& afterText, WebKit::CallbackBase::Error) {
    19861986        dictationHandler(selectedText, beforeText, afterText);
    19871987        [dictationHandler release];
     
    20002000    }
    20012001    _autocorrectionData.autocorrectionHandler = [completionHandler copy];
    2002     _page->applyAutocorrection(correction, input, [self](const String& string, CallbackBase::Error error) {
     2002    _page->applyAutocorrection(correction, input, [self](const String& string, WebKit::CallbackBase::Error error) {
    20032003        _autocorrectionData.autocorrectionHandler(!string.isNull() ? [WKAutocorrectionRects autocorrectionRectsWithRects:_autocorrectionData.textFirstRect lastRect:_autocorrectionData.textLastRect] : nil);
    20042004        [_autocorrectionData.autocorrectionHandler release];
     
    20232023    } else {
    20242024        _autocorrectionData.autocorrectionContextHandler = [completionHandler copy];
    2025         _page->requestAutocorrectionContext([self](const String& beforeText, const String& markedText, const String& selectedText, const String& afterText, uint64_t location, uint64_t length, CallbackBase::Error) {
     2025        _page->requestAutocorrectionContext([self](const String& beforeText, const String& markedText, const String& selectedText, const String& afterText, uint64_t location, uint64_t length, WebKit::CallbackBase::Error) {
    20262026            _autocorrectionData.autocorrectionContextHandler([WKAutocorrectionContext autocorrectionContextWithData:beforeText markedText:markedText selectedText:selectedText afterText:afterText selectedRangeInMarkedText:NSMakeRange(location, length)]);
    20272027        });
     
    20582058    _didAccessoryTabInitiateFocus = YES; // Will be cleared in either -_displayFormNodeInputView or -cleanupInteraction.
    20592059    [self beginSelectionChange];
    2060     _page->focusNextAssistedNode(isNext, [self](CallbackBase::Error) {
     2060    _page->focusNextAssistedNode(isNext, [self](WebKit::CallbackBase::Error) {
    20612061        [self endSelectionChange];
    20622062        [self reloadInputViews];
     
    25452545{
    25462546    [self beginSelectionChange];
    2547     _page->executeEditCommand(commandName, [self](CallbackBase::Error) {
     2547    _page->executeEditCommand(commandName, [self](WebKit::CallbackBase::Error) {
    25482548        [self endSelectionChange];
    25492549    });
  • trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm

    r182295 r182842  
    126126
    127127    if (_repaintCallback) {
    128         _repaintCallback->invalidate(CallbackBase::Error::OwnerWasInvalidated);
     128        _repaintCallback->invalidate(WebKit::CallbackBase::Error::OwnerWasInvalidated);
    129129        // invalidate() calls completeFinishExitFullScreenAnimationAfterRepaint, which
    130130        // clears _repaintCallback.
     
    394394
    395395    if (_repaintCallback) {
    396         _repaintCallback->invalidate(CallbackBase::Error::OwnerWasInvalidated);
     396        _repaintCallback->invalidate(WebKit::CallbackBase::Error::OwnerWasInvalidated);
    397397        // invalidate() calls completeFinishExitFullScreenAnimationAfterRepaint, which
    398398        // clears _repaintCallback.
    399399        ASSERT(!_repaintCallback);
    400400    }
    401     _repaintCallback = VoidCallback::create([self](CallbackBase::Error) {
     401    _repaintCallback = VoidCallback::create([self](WebKit::CallbackBase::Error) {
    402402        [self completeFinishExitFullScreenAnimationAfterRepaint];
    403403    });
  • trunk/Source/WebKit2/UIProcess/mac/WKPrintingView.mm

    r182753 r182842  
    266266
    267267    IPCCallbackContext* context = new IPCCallbackContext;
    268     RefPtr<DataCallback> callback = DataCallback::create([context](API::Data* data, CallbackBase::Error) {
     268    RefPtr<DataCallback> callback = DataCallback::create([context](API::Data* data, WebKit::CallbackBase::Error) {
    269269        ASSERT(RunLoop::isMain());
    270270
     
    341341
    342342    IPCCallbackContext* context = new IPCCallbackContext;
    343     RefPtr<ComputedPagesCallback> callback = ComputedPagesCallback::create([context](const Vector<WebCore::IntRect>& pageRects, double totalScaleFactorForPrinting, CallbackBase::Error) {
     343    RefPtr<ComputedPagesCallback> callback = ComputedPagesCallback::create([context](const Vector<WebCore::IntRect>& pageRects, double totalScaleFactorForPrinting, WebKit::CallbackBase::Error) {
    344344        std::unique_ptr<IPCCallbackContext> contextDeleter(context);
    345345        pageDidComputePageRects(pageRects, totalScaleFactorForPrinting, context);
     
    493493
    494494                IPCCallbackContext* context = new IPCCallbackContext;
    495                 RefPtr<ImageCallback> callback = ImageCallback::create([context](const ShareableBitmap::Handle& imageHandle, CallbackBase::Error) {
     495                RefPtr<ImageCallback> callback = ImageCallback::create([context](const ShareableBitmap::Handle& imageHandle, WebKit::CallbackBase::Error) {
    496496                    std::unique_ptr<IPCCallbackContext> contextDeleter(context);
    497497                    pageDidDrawToImage(imageHandle, context);
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp

    r182748 r182842  
    14571457
    14581458    m_pluginIsPlayingAudio = pluginIsPlayingAudio;
    1459     m_pluginElement->document().updateIsPlayingAudio();
     1459    m_pluginElement->document().updateIsPlayingMedia();
    14601460}
    14611461
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp

    r182242 r182842  
    10511051}
    10521052
    1053 void WebChromeClient::isPlayingAudioDidChange(bool newIsPlayingAudio)
    1054 {
    1055     m_page->send(Messages::WebPageProxy::IsPlayingAudioDidChange(newIsPlayingAudio));
     1053void WebChromeClient::isPlayingMediaDidChange(MediaStateFlags state)
     1054{
     1055    m_page->send(Messages::WebPageProxy::IsPlayingMediaDidChange(state));
    10561056}
    10571057
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h

    r182242 r182842  
    293293    virtual bool shouldUseTiledBackingForFrameView(const WebCore::FrameView*) const override;
    294294
    295     virtual void isPlayingAudioDidChange(bool) override;
     295    virtual void isPlayingMediaDidChange(MediaStateFlags) override;
    296296    virtual void setPageActivityState(WebCore::PageActivityState::Flags) override;
    297297
Note: See TracChangeset for help on using the changeset viewer.