RESOLVED FIXED 141578
Make WebCore::IOSurface have single ownership instead of refcounting
https://bugs.webkit.org/show_bug.cgi?id=141578
Summary Make WebCore::IOSurface have single ownership instead of refcounting
Tim Horton
Reported 2015-02-13 14:44:22 PST
Make WebCore::IOSurface have single ownership instead of refcounting
Attachments
Patch (21.22 KB, patch)
2015-02-13 14:44 PST, Tim Horton
andersca: review+
Tim Horton
Comment 1 2015-02-13 14:44:45 PST
Anders Carlsson
Comment 2 2015-02-13 15:17:08 PST
Comment on attachment 246551 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=246551&action=review Looks like most of the member variables of IOSurface can be const. > Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp:138 > + return WTF::move(surface); No need to use WTF::move here. > Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp:155 > + return WTF::move(surface); No need to use WTF::move here. > Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp:174 > + willAddSurface(surface.get(), surfaceIsInUse); Maybe this should take a reference. > Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp:210 > + std::unique_ptr<IOSurface> surface = m_inUseSurfaces.takeLast(); This should be auto. > Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp:224 > + std::unique_ptr<IOSurface> surface = surfaceQueueIter->value.takeLast(); auto. > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:70 > + std::unique_ptr<IOSurface> surface = IOSurface::create(IntSize(width, height), ColorSpaceDeviceRGB); auto. > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:75 > + return WTF::move(surface); No need to use WTF::move here. > Source/WebKit2/UIProcess/API/mac/WKView.mm:3229 > + std::unique_ptr<IOSurface> surface = IOSurface::createFromImage(croppedSnapshotImage.get()); auto! > Source/WebKit2/UIProcess/mac/ViewSnapshotStore.mm:137 > +PassRefPtr<ViewSnapshot> ViewSnapshot::create(std::unique_ptr<IOSurface> surface) This should return a Ref. > Source/WebKit2/UIProcess/mac/ViewSnapshotStore.mm:161 > +#if USE_IOSURFACE_VIEW_SNAPSHOTS > + m_imageSizeInBytes = m_surface->totalBytes(); > + m_size = m_surface->size(); > +#endif These can be member initializers.
Tim Horton
Comment 3 2015-02-13 16:08:41 PST
Tim Horton
Comment 4 2015-02-13 16:16:13 PST
Note You need to log in before you can comment on or make changes to this bug.