Changeset 182842 in webkit
- Timestamp:
- Apr 15, 2015, 9:19:39 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 22 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/Modules/webaudio/AudioContext.cpp (modified) (2 diffs)
-
WebCore/dom/Document.cpp (modified) (3 diffs)
-
WebCore/dom/Document.h (modified) (1 diff)
-
WebCore/html/HTMLMediaElement.cpp (modified) (3 diffs)
-
WebCore/page/ChromeClient.h (modified) (1 diff)
-
WebCore/page/Page.cpp (modified) (3 diffs)
-
WebCore/page/Page.h (modified) (1 diff)
-
WebKit2/ChangeLog (modified) (1 diff)
-
WebKit2/UIProcess/API/C/WKPage.cpp (modified) (4 diffs)
-
WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm (modified) (1 diff)
-
WebKit2/UIProcess/API/gtk/WebKitWebView.cpp (modified) (5 diffs)
-
WebKit2/UIProcess/API/mac/WKView.mm (modified) (10 diffs)
-
WebKit2/UIProcess/WebPageProxy.cpp (modified) (1 diff)
-
WebKit2/UIProcess/WebPageProxy.h (modified) (2 diffs)
-
WebKit2/UIProcess/WebPageProxy.messages.in (modified) (1 diff)
-
WebKit2/UIProcess/ios/WKContentViewInteraction.mm (modified) (19 diffs)
-
WebKit2/UIProcess/mac/WKFullScreenWindowController.mm (modified) (2 diffs)
-
WebKit2/UIProcess/mac/WKPrintingView.mm (modified) (3 diffs)
-
WebKit2/WebProcess/Plugins/PluginView.cpp (modified) (1 diff)
-
WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (modified) (1 diff)
-
WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r182840 r182842 1 2015-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 1 31 2015-04-15 Joonghun Park <jh718.park@samsung.com> 2 32 -
trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp
r182544 r182842 345 345 m_isStopScheduled = true; 346 346 347 document()->updateIsPlaying Audio();347 document()->updateIsPlayingMedia(); 348 348 349 349 m_eventQueue->close(); … … 1039 1039 void AudioContext::isPlayingAudioDidChange() 1040 1040 { 1041 document()->updateIsPlaying Audio();1041 document()->updateIsPlayingMedia(); 1042 1042 } 1043 1043 -
trunk/Source/WebCore/dom/Document.cpp
r182782 r182842 3417 3417 { 3418 3418 m_audioProducers.add(audioProducer); 3419 updateIsPlaying Audio();3419 updateIsPlayingMedia(); 3420 3420 } 3421 3421 … … 3423 3423 { 3424 3424 m_audioProducers.remove(audioProducer); 3425 updateIsPlaying Audio();3426 } 3427 3428 void Document::updateIsPlaying Audio()3425 updateIsPlayingMedia(); 3426 } 3427 3428 void Document::updateIsPlayingMedia() 3429 3429 { 3430 3430 bool isPlayingAudio = false; … … 3442 3442 3443 3443 if (page()) 3444 page()->updateIsPlaying Audio();3444 page()->updateIsPlayingMedia(); 3445 3445 } 3446 3446 -
trunk/Source/WebCore/dom/Document.h
r182630 r182842 1230 1230 WEBCORE_EXPORT void removeAudioProducer(AudioProducer*); 1231 1231 bool isPlayingAudio() const { return m_isPlayingAudio; } 1232 WEBCORE_EXPORT void updateIsPlaying Audio();1232 WEBCORE_EXPORT void updateIsPlayingMedia(); 1233 1233 void pageMutedStateDidChange(); 1234 1234 WeakPtr<Document> createWeakPtr() { return m_weakFactory.createWeakPtr(); } -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r182820 r182842 3017 3017 } 3018 3018 scheduleEvent(eventNames().volumechangeEvent); 3019 document().updateIsPlaying Audio();3019 document().updateIsPlayingMedia(); 3020 3020 } 3021 3021 #endif … … 4345 4345 renderer()->updateFromElement(); 4346 4346 4347 document().updateIsPlaying Audio();4347 document().updateIsPlayingMedia(); 4348 4348 4349 4349 endProcessingMediaPlayerCallback(); … … 4600 4600 4601 4601 m_playing = playing; 4602 document().updateIsPlaying Audio();4602 document().updateIsPlayingMedia(); 4603 4603 } 4604 4604 -
trunk/Source/WebCore/page/ChromeClient.h
r182320 r182842 424 424 virtual bool shouldUseTiledBackingForFrameView(const FrameView*) const { return false; } 425 425 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 427 435 virtual void setPageActivityState(PageActivityState::Flags) { } 428 436 -
trunk/Source/WebCore/page/Page.cpp
r182630 r182842 109 109 #include "HTMLVideoElement.h" 110 110 #include "MediaPlaybackTarget.h" 111 #include "MediaPlaybackTargetPickerClient.h"112 111 #endif 113 112 … … 1199 1198 } 1200 1199 1201 void Page::updateIsPlaying Audio()1200 void Page::updateIsPlayingMedia() 1202 1201 { 1203 1202 bool isPlayingAudio = false; … … 1214 1213 m_isPlayingAudio = isPlayingAudio; 1215 1214 1216 chrome().client().isPlaying AudioDidChange(m_isPlayingAudio);1215 chrome().client().isPlayingMediaDidChange(m_isPlayingAudio ? ChromeClient::IsPlayingAudio : ChromeClient::IsNotPlaying); 1217 1216 } 1218 1217 -
trunk/Source/WebCore/page/Page.h
r182630 r182842 424 424 425 425 bool isPlayingAudio() const { return m_isPlayingAudio; } 426 void updateIsPlaying Audio();426 void updateIsPlayingMedia(); 427 427 bool isMuted() const { return m_muted; } 428 428 WEBCORE_EXPORT void setMuted(bool); -
trunk/Source/WebKit2/ChangeLog
r182841 r182842 1 2015-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 1 52 2015-04-15 Antti Koivisto <antti@apple.com> 2 53 -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp
r182303 r182842 1934 1934 #endif 1935 1935 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);1936 static 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); 1940 1940 }; 1941 1941 } … … 1980 1980 void WKPageForceRepaint(WKPageRef pageRef, void* context, WKPageForceRepaintFunction callback) 1981 1981 { 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); 1984 1984 })); 1985 1985 } … … 2017 2017 void WKPageValidateCommand(WKPageRef pageRef, WKStringRef command, void* context, WKPageValidateCommandCallback callback) 2018 2018 { 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); 2021 2021 }); 2022 2022 } … … 2039 2039 void WKPageComputePagesForPrinting(WKPageRef page, WKFrameRef frame, WKPrintInfo printInfo, WKPageComputePagesForPrintingFunction callback, void* context) 2040 2040 { 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) { 2042 2042 Vector<WKRect> wkRects(rects.size()); 2043 2043 for (size_t i = 0; i < rects.size(); ++i) 2044 2044 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); 2046 2046 })); 2047 2047 } -
trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm
r182753 r182842 120 120 bitmapSize.scale(_scale * _webPageProxy->deviceScaleFactor()); 121 121 _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) { 123 123 RefPtr<ShareableBitmap> bitmap = ShareableBitmap::create(imageHandle, SharedMemory::Protection::ReadOnly); 124 124 RetainPtr<CGImageRef> cgImage = bitmap ? bitmap->makeCGImage() : nullptr; -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
r182175 r182842 2893 2893 2894 2894 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) { 2896 2896 g_task_return_boolean(adoptGRef(task).get(), isEnabled); 2897 2897 }); … … 3009 3009 3010 3010 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) { 3012 3012 webkitWebViewRunJavaScriptCallback(serializedScriptValue, adoptGRef(task).get()); 3013 3013 }); … … 3100 3100 gpointer outputStreamData = g_memory_output_stream_get_data(G_MEMORY_OUTPUT_STREAM(object)); 3101 3101 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) { 3103 3103 webkitWebViewRunJavaScriptCallback(serializedScriptValue, task.get()); 3104 3104 }); … … 3278 3278 g_task_set_source_tag(task, reinterpret_cast<gpointer>(webkit_web_view_save)); 3279 3279 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) { 3281 3281 getContentsAsMHTMLDataCallback(data, task); 3282 3282 }, false); … … 3343 3343 g_task_set_task_data(task, data, reinterpret_cast<GDestroyNotify>(destroyViewSaveAsyncData)); 3344 3344 3345 getPage(webView)->getContentsAsMHTMLData([task](API::Data* data, CallbackBase::Error) {3345 getPage(webView)->getContentsAsMHTMLData([task](API::Data* data, WebKit::CallbackBase::Error) { 3346 3346 getContentsAsMHTMLDataCallback(data, task); 3347 3347 }, false); -
trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm
r182781 r182842 471 471 if ([event type] == NSKeyDown || [event type] == NSKeyUp) 472 472 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) { }); 474 474 } 475 475 return YES; … … 836 836 return; 837 837 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) { 839 839 NSFont *font = [NSFont fontWithName:fontName size:fontSize]; 840 840 if (font) … … 996 996 // FIXME: Theoretically, there is a race here; when we get the answer it might be old, from a previous time 997 997 // 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) { 999 999 // 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) 1001 1001 return; 1002 1002 … … 1013 1013 - (IBAction)startSpeaking:(id)sender 1014 1014 { 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) 1017 1017 return; 1018 1018 if (!string) … … 1677 1677 1678 1678 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) { 1680 1680 void (^completionHandlerBlock)(NSRange) = (void (^)(NSRange))completionHandler.get(); 1681 if (error != CallbackBase::Error::None) {1681 if (error != WebKit::CallbackBase::Error::None) { 1682 1682 LOG(TextInput, " ...selectedRange failed."); 1683 1683 completionHandlerBlock(NSMakeRange(NSNotFound, 0)); … … 1698 1698 1699 1699 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) { 1701 1701 void (^completionHandlerBlock)(NSRange) = (void (^)(NSRange))completionHandler.get(); 1702 if (error != CallbackBase::Error::None) {1702 if (error != WebKit::CallbackBase::Error::None) { 1703 1703 LOG(TextInput, " ...markedRange failed."); 1704 1704 completionHandlerBlock(NSMakeRange(NSNotFound, 0)); … … 1719 1719 1720 1720 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) { 1722 1722 void (^completionHandlerBlock)(BOOL) = (void (^)(BOOL))completionHandler.get(); 1723 if (error != CallbackBase::Error::None) {1723 if (error != WebKit::CallbackBase::Error::None) { 1724 1724 LOG(TextInput, " ...hasMarkedText failed."); 1725 1725 completionHandlerBlock(NO); … … 1737 1737 1738 1738 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) { 1740 1740 void (^completionHandlerBlock)(NSAttributedString *, NSRange) = (void (^)(NSAttributedString *, NSRange))completionHandler.get(); 1741 if (error != CallbackBase::Error::None) {1741 if (error != WebKit::CallbackBase::Error::None) { 1742 1742 LOG(TextInput, " ...attributedSubstringFromRange failed."); 1743 1743 completionHandlerBlock(0, NSMakeRange(NSNotFound, 0)); … … 1767 1767 } 1768 1768 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) { 1770 1770 void (^completionHandlerBlock)(NSRect, NSRange) = (void (^)(NSRect, NSRange))completionHandler.get(); 1771 if (error != CallbackBase::Error::None) {1771 if (error != WebKit::CallbackBase::Error::None) { 1772 1772 LOG(TextInput, " ...firstRectForCharacterRange failed."); 1773 1773 completionHandlerBlock(NSZeroRect, NSMakeRange(NSNotFound, 0)); … … 1798 1798 thePoint = [self convertPoint:thePoint fromView:nil]; // the point is relative to the main frame 1799 1799 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) { 1801 1801 void (^completionHandlerBlock)(NSUInteger) = (void (^)(NSUInteger))completionHandler.get(); 1802 if (error != CallbackBase::Error::None) {1802 if (error != WebKit::CallbackBase::Error::None) { 1803 1803 LOG(TextInput, " ...characterIndexForPoint failed."); 1804 1804 completionHandlerBlock(0); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r182772 r182842 5641 5641 } 5642 5642 5643 void WebPageProxy::isPlayingAudioDidChange(bool newIsPlayingAudio) 5644 { 5645 if (m_isPlayingAudio == newIsPlayingAudio) 5646 return; 5647 5648 m_isPlayingAudio = newIsPlayingAudio; 5643 void 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; 5649 5650 m_uiClient->isPlayingAudioDidChange(*this); 5650 5651 } -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r182772 r182842 64 64 #include "WebPopupMenuProxy.h" 65 65 #include "WebProcessLifetimeTracker.h" 66 #include <WebCore/ChromeClient.h> 66 67 #include <WebCore/Color.h> 67 68 #include <WebCore/DragActions.h> … … 983 984 bool isShowingNavigationGestureSnapshot() const { return m_isShowingNavigationGestureSnapshot; } 984 985 985 void isPlaying AudioDidChange(bool);986 void isPlayingMediaDidChange(WebCore::ChromeClient::MediaStateFlags); 986 987 bool isPlayingAudio() const { return m_isPlayingAudio; } 987 988 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r182442 r182842 422 422 #endif 423 423 424 IsPlaying AudioDidChange(bool newIsPlayingAudio)424 IsPlayingMediaDidChange(unsigned state) 425 425 426 426 #if PLATFORM(MAC) -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
r182749 r182842 1547 1547 return; 1548 1548 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) 1551 1551 return; 1552 1552 if (!string) … … 1559 1559 - (void)accessibilityRetrieveSpeakSelectionContent 1560 1560 { 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) 1563 1563 return; 1564 1564 if ([self respondsToSelector:@selector(accessibilitySpeakSelectionSetContent:)]) … … 1778 1778 } 1779 1779 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) {1780 static 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) { 1783 1783 ASSERT_NOT_REACHED(); 1784 1784 return; … … 1790 1790 } 1791 1791 1792 static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoint& point, uint32_t touch, CallbackBase::Error error)1793 { 1794 if (error != CallbackBase::Error::None) {1792 static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoint& point, uint32_t touch, WebKit::CallbackBase::Error error) 1793 { 1794 if (error != WebKit::CallbackBase::Error::None) { 1795 1795 ASSERT_NOT_REACHED(); 1796 1796 return; … … 1812 1812 { 1813 1813 _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) { 1815 1815 selectionChangedWithGesture(self, point, gestureType, gestureState, flags, error); 1816 1816 if (state == UIGestureRecognizerStateEnded || state == UIGestureRecognizerStateCancelled) … … 1822 1822 { 1823 1823 _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) { 1825 1825 selectionChangedWithTouch(self, point, touch, error); 1826 1826 if (touch != UIWKSelectionTouchStarted && touch != UIWKSelectionTouchMoved) … … 1832 1832 { 1833 1833 _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) { 1835 1835 selectionChangedWithGesture(self, point, gestureType, gestureState, flags, error); 1836 1836 if (gestureState == UIGestureRecognizerStateEnded || gestureState == UIGestureRecognizerStateCancelled) … … 1851 1851 1852 1852 [self beginSelectionChange]; 1853 _page->moveSelectionByOffset(offset, [self]( CallbackBase::Error) {1853 _page->moveSelectionByOffset(offset, [self](WebKit::CallbackBase::Error) { 1854 1854 [self endSelectionChange]; 1855 1855 }); … … 1870 1870 1871 1871 _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) { 1873 1873 CGRect firstRect = CGRectZero; 1874 1874 CGRect lastRect = CGRectZero; … … 1894 1894 UIWKSelectionCompletionHandler selectionHandler = [completionHandler copy]; 1895 1895 1896 _page->selectPositionAtPoint(WebCore::IntPoint(point), [selectionHandler]( CallbackBase::Error error) {1896 _page->selectPositionAtPoint(WebCore::IntPoint(point), [selectionHandler](WebKit::CallbackBase::Error error) { 1897 1897 selectionHandler(); 1898 1898 [selectionHandler release]; … … 1904 1904 UIWKSelectionCompletionHandler selectionHandler = [completionHandler copy]; 1905 1905 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) { 1907 1907 selectionHandler(); 1908 1908 [selectionHandler release]; … … 1914 1914 UIWKSelectionCompletionHandler selectionHandler = [completionHandler copy]; 1915 1915 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) { 1917 1917 selectionHandler(); 1918 1918 [selectionHandler release]; … … 1924 1924 UIWKSelectionWithDirectionCompletionHandler selectionHandler = [completionHandler copy]; 1925 1925 1926 _page->beginSelectionInDirection(toWKSelectionDirection(direction), [selectionHandler](bool endIsMoving, CallbackBase::Error error) {1926 _page->beginSelectionInDirection(toWKSelectionDirection(direction), [selectionHandler](bool endIsMoving, WebKit::CallbackBase::Error error) { 1927 1927 selectionHandler(endIsMoving); 1928 1928 [selectionHandler release]; … … 1934 1934 UIWKSelectionWithDirectionCompletionHandler selectionHandler = [completionHandler copy]; 1935 1935 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) { 1937 1937 selectionHandler(endIsMoving); 1938 1938 [selectionHandler release]; … … 1983 1983 UIWKDictationContextHandler dictationHandler = [completionHandler copy]; 1984 1984 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) { 1986 1986 dictationHandler(selectedText, beforeText, afterText); 1987 1987 [dictationHandler release]; … … 2000 2000 } 2001 2001 _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) { 2003 2003 _autocorrectionData.autocorrectionHandler(!string.isNull() ? [WKAutocorrectionRects autocorrectionRectsWithRects:_autocorrectionData.textFirstRect lastRect:_autocorrectionData.textLastRect] : nil); 2004 2004 [_autocorrectionData.autocorrectionHandler release]; … … 2023 2023 } else { 2024 2024 _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) { 2026 2026 _autocorrectionData.autocorrectionContextHandler([WKAutocorrectionContext autocorrectionContextWithData:beforeText markedText:markedText selectedText:selectedText afterText:afterText selectedRangeInMarkedText:NSMakeRange(location, length)]); 2027 2027 }); … … 2058 2058 _didAccessoryTabInitiateFocus = YES; // Will be cleared in either -_displayFormNodeInputView or -cleanupInteraction. 2059 2059 [self beginSelectionChange]; 2060 _page->focusNextAssistedNode(isNext, [self]( CallbackBase::Error) {2060 _page->focusNextAssistedNode(isNext, [self](WebKit::CallbackBase::Error) { 2061 2061 [self endSelectionChange]; 2062 2062 [self reloadInputViews]; … … 2545 2545 { 2546 2546 [self beginSelectionChange]; 2547 _page->executeEditCommand(commandName, [self]( CallbackBase::Error) {2547 _page->executeEditCommand(commandName, [self](WebKit::CallbackBase::Error) { 2548 2548 [self endSelectionChange]; 2549 2549 }); -
trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm
r182295 r182842 126 126 127 127 if (_repaintCallback) { 128 _repaintCallback->invalidate( CallbackBase::Error::OwnerWasInvalidated);128 _repaintCallback->invalidate(WebKit::CallbackBase::Error::OwnerWasInvalidated); 129 129 // invalidate() calls completeFinishExitFullScreenAnimationAfterRepaint, which 130 130 // clears _repaintCallback. … … 394 394 395 395 if (_repaintCallback) { 396 _repaintCallback->invalidate( CallbackBase::Error::OwnerWasInvalidated);396 _repaintCallback->invalidate(WebKit::CallbackBase::Error::OwnerWasInvalidated); 397 397 // invalidate() calls completeFinishExitFullScreenAnimationAfterRepaint, which 398 398 // clears _repaintCallback. 399 399 ASSERT(!_repaintCallback); 400 400 } 401 _repaintCallback = VoidCallback::create([self]( CallbackBase::Error) {401 _repaintCallback = VoidCallback::create([self](WebKit::CallbackBase::Error) { 402 402 [self completeFinishExitFullScreenAnimationAfterRepaint]; 403 403 }); -
trunk/Source/WebKit2/UIProcess/mac/WKPrintingView.mm
r182753 r182842 266 266 267 267 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) { 269 269 ASSERT(RunLoop::isMain()); 270 270 … … 341 341 342 342 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) { 344 344 std::unique_ptr<IPCCallbackContext> contextDeleter(context); 345 345 pageDidComputePageRects(pageRects, totalScaleFactorForPrinting, context); … … 493 493 494 494 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) { 496 496 std::unique_ptr<IPCCallbackContext> contextDeleter(context); 497 497 pageDidDrawToImage(imageHandle, context); -
trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
r182748 r182842 1457 1457 1458 1458 m_pluginIsPlayingAudio = pluginIsPlayingAudio; 1459 m_pluginElement->document().updateIsPlaying Audio();1459 m_pluginElement->document().updateIsPlayingMedia(); 1460 1460 } 1461 1461 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
r182242 r182842 1051 1051 } 1052 1052 1053 void WebChromeClient::isPlaying AudioDidChange(bool newIsPlayingAudio)1054 { 1055 m_page->send(Messages::WebPageProxy::IsPlaying AudioDidChange(newIsPlayingAudio));1053 void WebChromeClient::isPlayingMediaDidChange(MediaStateFlags state) 1054 { 1055 m_page->send(Messages::WebPageProxy::IsPlayingMediaDidChange(state)); 1056 1056 } 1057 1057 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
r182242 r182842 293 293 virtual bool shouldUseTiledBackingForFrameView(const WebCore::FrameView*) const override; 294 294 295 virtual void isPlaying AudioDidChange(bool) override;295 virtual void isPlayingMediaDidChange(MediaStateFlags) override; 296 296 virtual void setPageActivityState(WebCore::PageActivityState::Flags) override; 297 297
Note:
See TracChangeset
for help on using the changeset viewer.