Changeset 156063 in webkit
- Timestamp:
- Sep 18, 2013 2:45:58 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/win/ChangeLog
r156051 r156063 1 2013-09-18 Sam Weinig <sam@webkit.org> 2 3 Replace use of OwnArrayPtr<Foo> with std::unique_ptr<Foo[]> in WebKit and WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=121568 5 6 Reviewed by Andreas Kling. 7 8 * WebHistory.cpp: 9 (WebHistory::removeAllItems): 10 (WebHistory::orderedLastVisitedDays): 11 (WebHistory::addItemToDateCaches): 12 (WebHistory::removeItemFromDateCaches): 13 * WebHistory.h: 14 * WebPreferences.cpp: 15 (WebPreferences::copyWebKitPreferencesToCFPreferences): 16 1 17 2013-09-18 Patrick Gansterer <paroga@webkit.org> 2 18 -
trunk/Source/WebKit/win/WebHistory.cpp
r156051 r156063 241 241 { 242 242 m_entriesByDate.clear(); 243 m_orderedLastVisitedDays .clear();243 m_orderedLastVisitedDays = nullptr; 244 244 245 245 Vector<IWebHistoryItem*> itemsVector(m_entriesByURL.size()); … … 273 273 *count = dateCount; 274 274 if (!m_orderedLastVisitedDays) { 275 m_orderedLastVisitedDays = adoptArrayPtr(new DATE[dateCount]);275 m_orderedLastVisitedDays = std::make_unique<DATE[]>(dateCount); 276 276 DateToEntriesMap::const_iterator::Keys end = m_entriesByDate.end().keys(); 277 277 int i = 0; … … 584 584 m_entriesByDate.set(dateKey, entryArray); 585 585 // Clear m_orderedLastVisitedDays so it will be regenerated when next requested. 586 m_orderedLastVisitedDays .clear();586 m_orderedLastVisitedDays = nullptr; 587 587 } 588 588 … … 615 615 m_entriesByDate.remove(found); 616 616 // Clear m_orderedLastVisitedDays so it will be regenerated when next requested. 617 m_orderedLastVisitedDays .clear();617 m_orderedLastVisitedDays = nullptr; 618 618 } 619 619 -
trunk/Source/WebKit/win/WebHistory.h
r156051 r156063 30 30 #include <CoreFoundation/CoreFoundation.h> 31 31 #include <WebCore/COMPtr.h> 32 #include <memory> 32 33 #include <wtf/Forward.h> 33 #include <wtf/OwnArrayPtr.h>34 34 #include <wtf/RetainPtr.h> 35 35 … … 148 148 URLToEntriesMap m_entriesByURL; 149 149 DateToEntriesMap m_entriesByDate; 150 OwnArrayPtr<DATE> m_orderedLastVisitedDays;150 std::unique<DATE[]> m_orderedLastVisitedDays; 151 151 COMPtr<WebPreferences> m_preferences; 152 152 }; -
trunk/Source/WebKit/win/WebPreferences.cpp
r153628 r156063 42 42 #include <wchar.h> 43 43 #include <wtf/HashMap.h> 44 #include <wtf/ OwnArrayPtr.h>44 #include <wtf/StdLibExtras.h> 45 45 #include <wtf/text/CString.h> 46 46 #include <wtf/text/StringHash.h> … … 478 478 bool omitDefaults = !booleanValueForPreferencesValue(CFDictionaryGetValue(dict, didRemoveDefaultsKey)); 479 479 480 OwnArrayPtr<CFTypeRef> keys = adoptArrayPtr(new CFTypeRef[count]);481 OwnArrayPtr<CFTypeRef> values = adoptArrayPtr(new CFTypeRef[count]);480 auto keys = std::make_unique<CFTypeRef[]>(count); 481 auto values = std::make_unique<CFTypeRef[]>(count); 482 482 CFDictionaryGetKeysAndValues(dict, keys.get(), values.get()); 483 483 -
trunk/Source/WebKit2/ChangeLog
r156056 r156063 1 2013-09-18 Sam Weinig <sam@webkit.org> 2 3 Replace use of OwnArrayPtr<Foo> with std::unique_ptr<Foo[]> in WebKit and WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=121568 5 6 Reviewed by Andreas Kling. 7 8 * Platform/CoreIPC/unix/ConnectionUnix.cpp: 9 (CoreIPC::Connection::processMessage): 10 (CoreIPC::readBytesFromSocket): 11 (CoreIPC::Connection::sendOutgoingMessage): 12 * UIProcess/API/efl/EwkView.cpp: 13 (EwkView::feedTouchEvent): 14 (EwkView::feedTouchEvents): 15 * UIProcess/API/efl/SnapshotImageGL.h: 16 * UIProcess/API/efl/ewk_file_chooser_request.cpp: 17 (ewk_file_chooser_request_files_choose): 18 * UIProcess/Launcher/efl/ProcessLauncherEfl.cpp: 19 (WebKit::createArgsArray): 20 (WebKit::ProcessLauncher::launchProcess): 21 * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: 22 (WKBundlePageCopyContextMenuItems): 23 * WebProcess/InjectedBundle/InjectedBundle.cpp: 24 1 25 2013-09-18 Anders Carlsson <andersca@apple.com> 2 26 -
trunk/Source/WebKit2/Platform/CoreIPC/unix/ConnectionUnix.cpp
r155913 r156063 37 37 #include <wtf/Assertions.h> 38 38 #include <wtf/Functional.h> 39 #include <wtf/ OwnArrayPtr.h>39 #include <wtf/StdLibExtras.h> 40 40 #include <wtf/UniStdExtras.h> 41 41 … … 214 214 size_t attachmentFileDescriptorCount = 0; 215 215 size_t attachmentCount = messageInfo.attachmentCount(); 216 OwnArrayPtr<AttachmentInfo> attachmentInfo;216 std::unique_ptr<AttachmentInfo[]> attachmentInfo; 217 217 218 218 if (attachmentCount) { 219 attachmentInfo = adoptArrayPtr(new AttachmentInfo[attachmentCount]);219 attachmentInfo = std::make_unique<AttachmentInfo[]>(attachmentCount); 220 220 memcpy(attachmentInfo.get(), messageData, sizeof(AttachmentInfo) * attachmentCount); 221 221 messageData += sizeof(AttachmentInfo) * attachmentCount; … … 324 324 325 325 message.msg_controllen = CMSG_SPACE(sizeof(int) * attachmentMaxAmount); 326 OwnArrayPtr<char> attachmentDescriptorBuffer = adoptArrayPtr(new char[message.msg_controllen]);326 auto attachmentDescriptorBuffer = std::make_unique<char[]>(message.msg_controllen); 327 327 memset(attachmentDescriptorBuffer.get(), 0, message.msg_controllen); 328 328 message.msg_control = attachmentDescriptorBuffer.get(); … … 492 492 iov[0].iov_len = sizeof(messageInfo); 493 493 494 OwnArrayPtr<AttachmentInfo> attachmentInfo = adoptArrayPtr(new AttachmentInfo[attachments.size()]);494 auto attachmentInfo = std::make_unique<AttachmentInfo[]>(attachments.size()); 495 495 496 496 size_t attachmentFDBufferLength = 0; … … 501 501 } 502 502 } 503 OwnArrayPtr<char> attachmentFDBuffer = adoptArrayPtr(new char[CMSG_SPACE(sizeof(int) * attachmentFDBufferLength)]);503 auto attachmentFDBuffer = std::make_unique<char[]>(CMSG_SPACE(sizeof(int) * attachmentFDBufferLength)); 504 504 505 505 if (!attachments.isEmpty()) { -
trunk/Source/WebKit2/UIProcess/API/efl/EwkView.cpp
r155852 r156063 79 79 #include <WebKit2/WKImageCairo.h> 80 80 #include <wtf/MathExtras.h> 81 #include <wtf/StdLibExtras.h> 81 82 82 83 #if ENABLE(VIBRATION) … … 753 754 { 754 755 unsigned length = eina_list_count(points); 755 OwnArrayPtr<WKTypeRef> touchPoints = adoptArrayPtr(new WKTypeRef[length]);756 auto touchPoints = std::make_unique<WKTypeRef[]>(length); 756 757 for (unsigned i = 0; i < length; ++i) { 757 758 Ewk_Touch_Point* point = static_cast<Ewk_Touch_Point*>(eina_list_nth(points, i)); … … 1322 1323 return; 1323 1324 1324 OwnArrayPtr<WKTypeRef> touchPoints = adoptArrayPtr(new WKTypeRef[length]);1325 auto touchPoints = std::make_unique<WKTypeRef[]>(length); 1325 1326 for (unsigned i = 0; i < length; ++i) { 1326 1327 int x, y; -
trunk/Source/WebKit2/UIProcess/API/efl/SnapshotImageGL.h
r147792 r156063 30 30 31 31 #include <RefPtrCairo.h> 32 #include <wtf/OwnArrayPtr.h>33 32 34 33 PassRefPtr<cairo_surface_t> getImageSurfaceFromFrameBuffer(int x, int y, int width, int height); -
trunk/Source/WebKit2/UIProcess/API/efl/ewk_file_chooser_request.cpp
r141709 r156063 34 34 #include "WKURL.h" 35 35 #include "ewk_file_chooser_request_private.h" 36 #include <wtf/ OwnArrayPtr.h>36 #include <wtf/StdLibExtras.h> 37 37 #include <wtf/text/CString.h> 38 38 … … 121 121 EINA_SAFETY_ON_FALSE_RETURN_VAL(urlCount == 1 || (urlCount > 1 && impl->allowMultipleFiles()), false); 122 122 123 OwnArrayPtr<WKTypeRef> filesURLs = adoptArrayPtr(new WKTypeRef[urlCount]);123 auto filesURLs = std::make_unique<WKTypeRef[]>(urlCount); 124 124 125 125 for (unsigned i = 0; i < urlCount; ++i) { -
trunk/Source/WebKit2/UIProcess/Launcher/efl/ProcessLauncherEfl.cpp
r155934 r156063 29 29 #include <WebCore/ResourceHandle.h> 30 30 #include <WebCore/RunLoop.h> 31 #include <wtf/ OwnArrayPtr.h>31 #include <wtf/StdLibExtras.h> 32 32 #include <wtf/text/CString.h> 33 33 #include <wtf/text/WTFString.h> … … 37 37 namespace WebKit { 38 38 39 static Vector< OwnArrayPtr<char>> createArgsArray(const String& prefix, const String& executablePath, const String& socket, const String& pluginPath)39 static Vector<std::unique_ptr<char[]>> createArgsArray(const String& prefix, const String& executablePath, const String& socket, const String& pluginPath) 40 40 { 41 41 ASSERT(!executablePath.isEmpty()); … … 50 50 splitArgs.append(pluginPath); 51 51 52 Vector< OwnArrayPtr<char>> args;52 Vector<std::unique_ptr<char[]>> args; 53 53 args.resize(splitArgs.size() + 1); // Extra room for null. 54 54 … … 56 56 for (size_t i = 0; i < numArgs; ++i) { 57 57 CString param = splitArgs[i].utf8(); 58 args[i] = adoptArrayPtr(new char[param.length() + 1]); // Room for the terminating null coming from the CString.58 args[i] = std::make_unique<char[]>(param.length() + 1); // Room for the terminating null coming from the CString. 59 59 strncpy(args[i].get(), param.data(), param.length() + 1); // +1 here so that strncpy copies the ending null. 60 60 } … … 98 98 processCmdPrefix = m_launchOptions.processCmdPrefix; 99 99 #endif 100 Vector<OwnArrayPtr<char>>args = createArgsArray(processCmdPrefix, executablePath, String::number(sockets[0]), pluginPath);100 auto args = createArgsArray(processCmdPrefix, executablePath, String::number(sockets[0]), pluginPath); 101 101 102 102 // Do not perform memory allocation in the middle of the fork() -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
r155847 r156063 53 53 #include <WebCore/KURL.h> 54 54 #include <WebCore/Page.h> 55 #include <wtf/ OwnArrayPtr.h>55 #include <wtf/StdLibExtras.h> 56 56 57 57 using namespace WebKit; … … 160 160 #if ENABLE(CONTEXT_MENUS) 161 161 WebContextMenu* contextMenu = toImpl(pageRef)->contextMenu(); 162 const Vector<WebContextMenuItemData> &items = contextMenu->items();162 const Vector<WebContextMenuItemData>& items = contextMenu->items(); 163 163 size_t arrayLength = items.size(); 164 164 165 OwnArrayPtr<WKTypeRef> wkItems = adoptArrayPtr(new WKTypeRef[arrayLength]);165 auto wkItems = std::make_unique<WKTypeRef[]>(arrayLength); 166 166 for (size_t i = 0; i < arrayLength; ++i) 167 167 wkItems[i] = toAPI(WebContextMenuItem::create(items[i]).leakRef()); -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
r155262 r156063 70 70 #include <WebCore/Settings.h> 71 71 #include <WebCore/UserGestureIndicator.h> 72 #include <wtf/OwnArrayPtr.h>73 72 74 73 #if ENABLE(SHADOW_DOM) || ENABLE(CSS_REGIONS) || ENABLE(IFRAME_SEAMLESS) || ENABLE(CSS_COMPOSITING)
Note: See TracChangeset
for help on using the changeset viewer.