Changeset 163797 in webkit
- Timestamp:
- Feb 10, 2014 10:22:20 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 deleted
- 65 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r163792 r163797 1 2014-02-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GLIB] Add GUniqueOutPtr and use it instead of GOwnPtr 4 https://bugs.webkit.org/show_bug.cgi?id=127554 5 6 Reviewed by Gustavo Noronha Silva. 7 8 GUniqueOutPtr is a simplified version of GOwnPtr for the cases 9 where we need the address of the contained pointer. GUniqueOutPtr 10 uses GUniquePtr to free the contained object and to release the 11 container pointer. The API is very simple to make sure this is 12 only used when outPtr() is needed. It can't be constructed with a 13 pointer, and there's not method to set a new pointer. Another 14 difference with the old GOwnPtr is that outPtr() can be used 15 multiple times, because it frees any pointer previously set. 16 17 * GNUmakefile.list.am: 18 * wtf/PlatformEfl.cmake: 19 * wtf/PlatformGTK.cmake: 20 * wtf/gobject/GOwnPtr.cpp: Removed. 21 * wtf/gobject/GOwnPtr.h: Removed. 22 * wtf/gobject/GUniquePtr.h: 23 (WTF::GUniqueOutPtr::GUniqueOutPtr): 24 (WTF::GUniqueOutPtr::~GUniqueOutPtr): 25 (WTF::GUniqueOutPtr::outPtr): 26 (WTF::GUniqueOutPtr::reset): 27 (WTF::GUniqueOutPtr::release): 28 (WTF::GUniqueOutPtr::operator*): 29 (WTF::GUniqueOutPtr::operator->): 30 (WTF::GUniqueOutPtr::get): 31 (WTF::GUniqueOutPtr::operator!): 32 (WTF::GUniqueOutPtr::operator UnspecifiedBoolType): 33 1 34 2014-02-10 Darin Adler <darin@apple.com> 2 35 -
trunk/Source/WTF/GNUmakefile.list.am
r163407 r163797 212 212 Source/WTF/wtf/dtoa/utils.h \ 213 213 Source/WTF/wtf/gobject/GMutexLocker.h \ 214 Source/WTF/wtf/gobject/GOwnPtr.cpp \215 Source/WTF/wtf/gobject/GOwnPtr.h \216 214 Source/WTF/wtf/gobject/GRefPtr.cpp \ 217 215 Source/WTF/wtf/gobject/GRefPtr.h \ -
trunk/Source/WTF/wtf/PlatformEfl.cmake
r159001 r163797 5 5 efl/RunLoopEfl.cpp 6 6 7 gobject/GOwnPtr.cpp8 7 gobject/GRefPtr.cpp 9 8 ) -
trunk/Source/WTF/wtf/PlatformGTK.cmake
r160361 r163797 1 1 list(APPEND WTF_SOURCES 2 gobject/GOwnPtr.cpp3 2 gobject/GRefPtr.cpp 4 3 gobject/GlibUtilities.cpp -
trunk/Source/WTF/wtf/gobject/GUniquePtr.h
r162516 r163797 25 25 26 26 #include <gio/gio.h> 27 #include <wtf/Noncopyable.h> 27 28 28 29 namespace WTF { … … 58 59 #undef FOR_EACH_GLIB_DELETER 59 60 61 template <typename T> class GUniqueOutPtr { 62 WTF_MAKE_NONCOPYABLE(GUniqueOutPtr); 63 public: 64 GUniqueOutPtr() 65 : m_ptr(nullptr) 66 { 67 } 68 69 ~GUniqueOutPtr() 70 { 71 reset(); 72 } 73 74 T*& outPtr() 75 { 76 reset(); 77 return m_ptr; 78 } 79 80 GUniquePtr<T> release() 81 { 82 GUniquePtr<T> ptr(m_ptr); 83 m_ptr = nullptr; 84 return ptr; 85 } 86 87 T& operator*() const 88 { 89 ASSERT(m_ptr); 90 return *m_ptr; 91 } 92 93 T* operator->() const 94 { 95 ASSERT(m_ptr); 96 return m_ptr; 97 } 98 99 T* get() const { return m_ptr; } 100 101 bool operator!() const { return !m_ptr; } 102 103 // This conversion operator allows implicit conversion to bool but not to other integer types. 104 typedef T* GUniqueOutPtr::*UnspecifiedBoolType; 105 operator UnspecifiedBoolType() const { return m_ptr ? &GUniqueOutPtr::m_ptr : 0; } 106 107 private: 108 void reset() 109 { 110 if (m_ptr) { 111 GUniquePtr<T> deletePtr(m_ptr); 112 m_ptr = nullptr; 113 } 114 } 115 116 T* m_ptr; 117 }; 118 60 119 } // namespace WTF 61 120 62 121 using WTF::GUniquePtr; 122 using WTF::GUniqueOutPtr; 63 123 64 124 #endif // USE(GLIB) -
trunk/Source/WebCore/ChangeLog
r163793 r163797 1 2014-02-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GLIB] Add GUniqueOutPtr and use it instead of GOwnPtr 4 https://bugs.webkit.org/show_bug.cgi?id=127554 5 6 Reviewed by Gustavo Noronha Silva. 7 8 Use GUniqueOutPtr instead of GOwnPtr. 9 10 * GNUmakefile.list.am: 11 * PlatformEfl.cmake: 12 * PlatformGTK.cmake: 13 * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: 14 (WebCore::AudioDestinationGStreamer::handleMessage): 15 * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp: 16 (WebCore::AudioFileReader::handleMessage): 17 * platform/glib/BatteryProviderUPower.cpp: 18 (BatteryProviderUPower::startUpdating): 19 * platform/graphics/gstreamer/GStreamerUtilities.cpp: 20 (WebCore::initializeGStreamer): 21 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: 22 (WebCore::MediaPlayerPrivateGStreamer::handleMessage): 23 * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp: 24 (WebCore::TrackPrivateBaseGStreamer::getTag): 25 * platform/graphics/gtk/ImageBufferGtk.cpp: 26 (WebCore::encodeImage): 27 (WebCore::ImageBuffer::toDataURL): 28 * platform/graphics/gtk/ImageGtk.cpp: 29 (WebCore::loadResourceSharedBuffer): 30 * platform/gtk/DataObjectGtk.cpp: 31 (WebCore::DataObjectGtk::setURIList): 32 * platform/gtk/FileSystemGtk.cpp: 33 (WebCore::readFromFile): 34 * platform/gtk/GamepadsGtk.cpp: 35 (WebCore::GamepadDeviceGtk::readCallback): 36 * platform/gtk/GtkInputMethodFilter.cpp: 37 (WebCore::GtkInputMethodFilter::handlePreeditChanged): 38 * platform/gtk/PasteboardHelper.cpp: 39 (WebCore::PasteboardHelper::fillDataObjectFromDropData): 40 * platform/gtk/RenderThemeGtk.cpp: 41 (WebCore::RenderThemeGtk::systemFont): 42 * platform/gtk/SharedBufferGtk.cpp: 43 (WebCore::SharedBuffer::createWithContentsOfFile): 44 * platform/network/gtk/CredentialBackingStore.cpp: 45 (WebCore::credentialForChallengeAsyncReadyCallback): 46 * platform/network/soup/GOwnPtrSoup.cpp: Removed. 47 * platform/network/soup/GOwnPtrSoup.h: Removed. 48 * platform/network/soup/ResourceHandleSoup.cpp: 49 (WebCore::redirectSkipCallback): 50 (WebCore::nextMultipartResponsePartCallback): 51 (WebCore::sendRequestCallback): 52 (WebCore::addFileToSoupMessageBody): 53 (WebCore::createSoupRequestAndMessageForHandle): 54 (WebCore::readCallback): 55 * platform/network/soup/SocketStreamHandleSoup.cpp: 56 (WebCore::SocketStreamHandle::platformSend): 57 (WebCore::SocketStreamHandle::platformClose): 58 (WebCore::connectedCallback): 59 (WebCore::readReadyCallback): 60 * platform/network/soup/SoupNetworkSession.cpp: 61 (WebCore::SoupNetworkSession::httpProxy): 62 1 63 2014-02-10 Darin Adler <darin@apple.com> 2 64 -
trunk/Source/WebCore/GNUmakefile.list.am
r163749 r163797 5855 5855 Source/WebCore/platform/leveldb/LevelDBWriteBatch.h \ 5856 5856 Source/WebCore/platform/leveldb/LevelDBWriteBatch.cpp \ 5857 Source/WebCore/platform/network/soup/GOwnPtrSoup.cpp \5858 Source/WebCore/platform/network/soup/GOwnPtrSoup.h \5859 5857 Source/WebCore/platform/network/soup/ProxyServerSoup.cpp \ 5860 5858 Source/WebCore/platform/network/soup/ResourceError.h \ -
trunk/Source/WebCore/PlatformEfl.cmake
r163505 r163797 158 158 platform/network/soup/CredentialStorageSoup.cpp 159 159 platform/network/soup/DNSSoup.cpp 160 platform/network/soup/GOwnPtrSoup.cpp161 160 platform/network/soup/NetworkStorageSessionSoup.cpp 162 161 platform/network/soup/ProxyResolverSoup.cpp -
trunk/Source/WebCore/PlatformGTK.cmake
r163749 r163797 116 116 platform/network/soup/CredentialStorageSoup.cpp 117 117 platform/network/soup/DNSSoup.cpp 118 platform/network/soup/GOwnPtrSoup.cpp119 118 platform/network/soup/NetworkStorageSessionSoup.cpp 120 119 platform/network/soup/ProxyResolverSoup.cpp … … 246 245 platform/network/soup/CredentialStorageSoup.cpp 247 246 platform/network/soup/DNSSoup.cpp 248 platform/network/soup/GOwnPtrSoup.cpp249 247 platform/network/soup/NetworkStorageSessionSoup.cpp 250 248 platform/network/soup/ProxyResolverSoup.cpp -
trunk/Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp
r162368 r163797 25 25 #include "AudioChannel.h" 26 26 #include "AudioSourceProvider.h" 27 #include <wtf/gobject/GOwnPtr.h>28 27 #include "GRefPtrGStreamer.h" 29 28 #include "Logging.h" … … 31 30 #include <gst/gst.h> 32 31 #include <gst/pbutils/pbutils.h> 32 #include <wtf/gobject/GUniquePtr.h> 33 33 34 34 namespace WebCore { … … 151 151 gboolean AudioDestinationGStreamer::handleMessage(GstMessage* message) 152 152 { 153 G OwnPtr<GError> error;154 G OwnPtr<gchar> debug;153 GUniqueOutPtr<GError> error; 154 GUniqueOutPtr<gchar> debug; 155 155 156 156 switch (GST_MESSAGE_TYPE(message)) { -
trunk/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp
r162368 r163797 31 31 #include <gst/pbutils/pbutils.h> 32 32 #include <wtf/Noncopyable.h> 33 #include <wtf/gobject/GOwnPtr.h>34 33 #include <wtf/gobject/GRefPtr.h> 34 #include <wtf/gobject/GUniquePtr.h> 35 35 36 36 #include <gst/audio/audio.h> … … 204 204 gboolean AudioFileReader::handleMessage(GstMessage* message) 205 205 { 206 G OwnPtr<GError> error;207 G OwnPtr<gchar> debug;206 GUniqueOutPtr<GError> error; 207 GUniqueOutPtr<gchar> debug; 208 208 209 209 switch (GST_MESSAGE_TYPE(message)) { -
trunk/Source/WebCore/platform/glib/BatteryProviderUPower.cpp
r160444 r163797 26 26 #include <cmath> 27 27 #include <limits> 28 #include <wtf/gobject/G OwnPtr.h>28 #include <wtf/gobject/GUniquePtr.h> 29 29 30 30 using namespace WebCore; … … 52 52 m_upowerClient = adoptGRef(up_client_new()); 53 53 54 G OwnPtr<GError> error;54 GUniqueOutPtr<GError> error; 55 55 if (!up_client_enumerate_devices_sync(m_upowerClient.get(), 0, &error.outPtr())) { 56 56 m_client->updateBatteryStatus(NotAvailable); -
trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp
r159766 r163797 27 27 #include <gst/audio/audio.h> 28 28 #include <gst/gst.h> 29 #include <wtf/gobject/G OwnPtr.h>29 #include <wtf/gobject/GUniquePtr.h> 30 30 31 31 namespace WebCore { … … 127 127 #endif 128 128 129 G OwnPtr<GError> error;129 GUniqueOutPtr<GError> error; 130 130 // FIXME: We should probably pass the arguments from the command line. 131 131 bool gstInitialized = gst_init_check(0, 0, &error.outPtr()); -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r162907 r163797 38 38 #include <gst/pbutils/missing-plugins.h> 39 39 #include <limits> 40 #include <wtf/gobject/GOwnPtr.h>41 40 #include <wtf/gobject/GUniquePtr.h> 42 41 #include <wtf/text/CString.h> … … 946 945 gboolean MediaPlayerPrivateGStreamer::handleMessage(GstMessage* message) 947 946 { 948 G OwnPtr<GError> err;949 G OwnPtr<gchar> debug;947 GUniqueOutPtr<GError> err; 948 GUniqueOutPtr<gchar> debug; 950 949 MediaPlayer::NetworkState error; 951 950 bool issueError = true; -
trunk/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp
r160375 r163797 35 35 #include <glib-object.h> 36 36 #include <gst/gst.h> 37 #include <wtf/gobject/G OwnPtr.h>37 #include <wtf/gobject/GUniquePtr.h> 38 38 39 39 GST_DEBUG_CATEGORY_EXTERN(webkit_media_player_debug); … … 144 144 bool TrackPrivateBaseGStreamer::getTag(GstTagList* tags, const gchar* tagName, String& value) 145 145 { 146 G OwnPtr<gchar> tagValue;146 GUniqueOutPtr<gchar> tagValue; 147 147 if (gst_tag_list_get_string(tags, tagName, &tagValue.outPtr())) { 148 148 INFO_MEDIA_MESSAGE("Track %d got %s %s.", m_index, tagName, tagValue.get()); -
trunk/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp
r162599 r163797 26 26 #include <cairo.h> 27 27 #include <gtk/gtk.h> 28 #include <wtf/gobject/G OwnPtr.h>28 #include <wtf/gobject/GUniquePtr.h> 29 29 #include <wtf/text/Base64.h> 30 30 #include <wtf/text/CString.h> … … 33 33 namespace WebCore { 34 34 35 static bool encodeImage(cairo_surface_t* surface, const String& mimeType, const double* quality, G OwnPtr<gchar>& buffer, gsize& bufferSize)35 static bool encodeImage(cairo_surface_t* surface, const String& mimeType, const double* quality, GUniqueOutPtr<gchar>& buffer, gsize& bufferSize) 36 36 { 37 37 // List of supported image encoding types comes from the GdkPixbuf documentation. … … 66 66 return false; 67 67 68 G OwnPtr<GError> error;68 GUniqueOutPtr<GError> error; 69 69 if (type == "jpeg" && quality && *quality >= 0.0 && *quality <= 1.0) { 70 70 String qualityString = String::format("%d", static_cast<int>(*quality * 100.0 + 0.5)); … … 80 80 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); 81 81 82 G OwnPtr<gchar> buffer;82 GUniqueOutPtr<gchar> buffer; 83 83 gsize bufferSize; 84 84 if (!encodeImage(m_data.m_surface.get(), mimeType, quality, buffer, bufferSize)) -
trunk/Source/WebCore/platform/graphics/gtk/ImageGtk.cpp
r162599 r163797 31 31 #include "GdkCairoUtilities.h" 32 32 #include "SharedBuffer.h" 33 #include <wtf/gobject/GOwnPtr.h>34 33 #include <wtf/gobject/GUniquePtr.h> 35 34 #include <wtf/text/CString.h> … … 68 67 static PassRefPtr<SharedBuffer> loadResourceSharedBuffer(CString name) 69 68 { 70 G OwnPtr<gchar> content;69 GUniqueOutPtr<gchar> content; 71 70 gsize length; 72 71 if (!g_file_get_contents(name.data(), &content.outPtr(), &length, 0)) -
trunk/Source/WebCore/platform/gtk/DataObjectGtk.cpp
r162599 r163797 22 22 #include "markup.h" 23 23 #include <gtk/gtk.h> 24 #include <wtf/gobject/GOwnPtr.h>25 24 #include <wtf/gobject/GUniquePtr.h> 26 25 #include <wtf/text/StringBuilder.h> … … 103 102 } 104 103 105 G OwnPtr<GError> error;104 GUniqueOutPtr<GError> error; 106 105 GUniquePtr<gchar> filename(g_filename_from_uri(line.utf8().data(), 0, &error.outPtr())); 107 106 if (!error && filename) -
trunk/Source/WebCore/platform/gtk/FileSystemGtk.cpp
r162943 r163797 29 29 #include <glib.h> 30 30 #include <glib/gstdio.h> 31 #include <wtf/gobject/GOwnPtr.h>32 31 #include <wtf/gobject/GRefPtr.h> 33 32 #include <wtf/gobject/GUniquePtr.h> … … 341 340 int readFromFile(PlatformFileHandle handle, char* data, int length) 342 341 { 343 G OwnPtr<GError> error;342 GUniqueOutPtr<GError> error; 344 343 do { 345 344 gssize bytesRead = g_input_stream_read(g_io_stream_get_input_stream(G_IO_STREAM(handle)), -
trunk/Source/WebCore/platform/gtk/GamepadsGtk.cpp
r162599 r163797 36 36 #include <wtf/HashMap.h> 37 37 #include <wtf/PassOwnPtr.h> 38 #include <wtf/gobject/GOwnPtr.h>39 38 #include <wtf/gobject/GRefPtr.h> 40 39 #include <wtf/gobject/GUniquePtr.h> … … 81 80 { 82 81 GamepadDeviceGtk* gamepadDevice = reinterpret_cast<GamepadDeviceGtk*>(data); 83 G OwnPtr<GError> error;82 GUniqueOutPtr<GError> error; 84 83 struct js_event event; 85 84 -
trunk/Source/WebCore/platform/gtk/GtkInputMethodFilter.cpp
r162599 r163797 25 25 #include <gtk/gtk.h> 26 26 #include <wtf/MathExtras.h> 27 #include <wtf/gobject/G OwnPtr.h>27 #include <wtf/gobject/GUniquePtr.h> 28 28 29 29 // The Windows composition key event code is 299 or VK_PROCESSKEY. We need to … … 318 318 return; 319 319 320 G OwnPtr<gchar> newPreedit;320 GUniqueOutPtr<gchar> newPreedit; 321 321 gtk_im_context_get_preedit_string(m_context.get(), &newPreedit.outPtr(), 0, &m_cursorOffset); 322 322 -
trunk/Source/WebCore/platform/gtk/PasteboardHelper.cpp
r162599 r163797 33 33 #include "TextResourceDecoder.h" 34 34 #include <gtk/gtk.h> 35 #include <wtf/gobject/GOwnPtr.h>36 35 #include <wtf/gobject/GUniquePtr.h> 37 36 … … 260 259 GRefPtr<GVariant> variant = g_variant_new_parsed(reinterpret_cast<const char*>(gtk_selection_data_get_data(data))); 261 260 262 G OwnPtr<gchar> key;263 G OwnPtr<gchar> value;261 GUniqueOutPtr<gchar> key; 262 GUniqueOutPtr<gchar> value; 264 263 GVariantIter iter; 265 264 266 265 g_variant_iter_init(&iter, variant.get()); 267 while (g_variant_iter_next(&iter, "{ss}", &key.outPtr(), &value.outPtr())) {266 while (g_variant_iter_next(&iter, "{ss}", &key.outPtr(), &value.outPtr())) 268 267 dataObject->setUnknownTypeData(key.get(), value.get()); 269 270 // FIXME: should GOwnPtr be smarter about this and replace the existing ptr when outPtr() is used?271 key.clear();272 value.clear();273 }274 268 } 275 269 } -
trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp
r160226 r163797 31 31 #include "FileSystem.h" 32 32 #include "FontDescription.h" 33 #include <wtf/gobject/GOwnPtr.h>34 33 #include "Gradient.h" 35 34 #include "GraphicsContext.h" … … 49 48 #include <glib.h> 50 49 #include <gtk/gtk.h> 50 #include <wtf/gobject/GUniquePtr.h> 51 51 #include <wtf/text/CString.h> 52 52 … … 445 445 446 446 // This will be a font selection string like "Sans 10" so we cannot use it as the family name. 447 G OwnPtr<gchar> fontName;447 GUniqueOutPtr<gchar> fontName; 448 448 g_object_get(settings, "gtk-font-name", &fontName.outPtr(), NULL); 449 449 -
trunk/Source/WebCore/platform/gtk/SharedBufferGtk.cpp
r152446 r163797 21 21 22 22 #include "FileSystem.h" 23 #include <wtf/gobject/G OwnPtr.h>23 #include <wtf/gobject/GUniquePtr.h> 24 24 #include <wtf/text/CString.h> 25 25 … … 35 35 36 36 CString filename = fileSystemRepresentation(filePath); 37 G OwnPtr<gchar> contents;37 GUniqueOutPtr<gchar> contents; 38 38 gsize size; 39 G OwnPtr<GError> error;39 GUniqueOutPtr<GError> error; 40 40 if (!g_file_get_contents(filename.data(), &contents.outPtr(), &size, &error.outPtr())) { 41 41 LOG_ERROR("Failed to fully read contents of file %s - %s", filenameForDisplay(filePath).utf8().data(), error->message); -
trunk/Source/WebCore/platform/network/gtk/CredentialBackingStore.cpp
r162599 r163797 35 35 #include <libsecret/secret.h> 36 36 #include <libsoup/soup.h> 37 #include <wtf/gobject/GOwnPtr.h>38 37 #include <wtf/gobject/GUniquePtr.h> 39 38 #include <wtf/text/CString.h> … … 78 77 delete callbackData; 79 78 80 G OwnPtr<GError> error;79 GUniqueOutPtr<GError> error; 81 80 GUniquePtr<GList> elements(secret_service_search_finish(service, asyncResult, &error.outPtr())); 82 81 if (error || !elements || !elements->data) { -
trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
r162922 r163797 33 33 #include "CredentialStorage.h" 34 34 #include "FileSystem.h" 35 #include "G OwnPtrSoup.h"35 #include "GUniquePtrSoup.h" 36 36 #include "HTTPParsers.h" 37 37 #include "LocalizedStrings.h" … … 56 56 #include <wtf/CurrentTime.h> 57 57 #include <wtf/SHA1.h> 58 #include <wtf/gobject/GOwnPtr.h>59 58 #include <wtf/gobject/GRefPtr.h> 60 59 #include <wtf/text/Base64.h> … … 505 504 } 506 505 507 G OwnPtr<GError> error;506 GUniqueOutPtr<GError> error; 508 507 ResourceHandleInternal* d = handle->getInternal(); 509 508 gssize bytesSkipped = g_input_stream_skip_finish(d->m_inputStream.get(), asyncResult, &error.outPtr()); … … 611 610 ASSERT(!d->m_inputStream); 612 611 613 G OwnPtr<GError> error;612 GUniqueOutPtr<GError> error; 614 613 d->m_inputStream = adoptGRef(soup_multipart_input_stream_next_part_finish(d->m_multipartInputStream.get(), result, &error.outPtr())); 615 614 … … 658 657 } 659 658 660 G OwnPtr<GError> error;659 GUniqueOutPtr<GError> error; 661 660 GRefPtr<GInputStream> inputStream = adoptGRef(soup_request_send_finish(d->m_soupRequest.get(), result, &error.outPtr())); 662 661 if (error) { … … 728 727 static bool addFileToSoupMessageBody(SoupMessage* message, const String& fileNameString, size_t offset, size_t lengthToSend, unsigned long& totalBodySize) 729 728 { 730 G OwnPtr<GError> error;729 GUniqueOutPtr<GError> error; 731 730 CString fileName = fileSystemRepresentation(fileNameString); 732 731 GMappedFile* fileMapping = g_mapped_file_new(fileName.data(), false, &error.outPtr()); … … 979 978 ResourceHandleInternal* d = handle->getInternal(); 980 979 981 GOwnPtr<GError> error;982 983 980 GUniquePtr<SoupURI> soupURI = request.createSoupURI(); 984 981 if (!soupURI) 985 982 return false; 986 983 984 GUniqueOutPtr<GError> error; 987 985 d->m_soupRequest = adoptGRef(soup_session_request_uri(d->soupSession(), soupURI.get(), &error.outPtr())); 988 986 if (error) { … … 1302 1300 } 1303 1301 1304 G OwnPtr<GError> error;1302 GUniqueOutPtr<GError> error; 1305 1303 gssize bytesRead = g_input_stream_read_finish(d->m_inputStream.get(), asyncResult, &error.outPtr()); 1306 1304 -
trunk/Source/WebCore/platform/network/soup/SocketStreamHandleSoup.cpp
r156550 r163797 43 43 44 44 #include <wtf/Vector.h> 45 #include <wtf/gobject/G OwnPtr.h>45 #include <wtf/gobject/GUniquePtr.h> 46 46 #include <wtf/text/CString.h> 47 47 … … 169 169 return 0; 170 170 171 G OwnPtr<GError> error;171 GUniqueOutPtr<GError> error; 172 172 gssize written = g_pollable_output_stream_write_nonblocking(m_outputStream.get(), data, length, 0, &error.outPtr()); 173 173 if (error) { … … 195 195 196 196 if (m_socketConnection) { 197 G OwnPtr<GError> error;197 GUniqueOutPtr<GError> error; 198 198 g_io_stream_close(G_IO_STREAM(m_socketConnection.get()), 0, &error.outPtr()); 199 199 if (error) … … 252 252 { 253 253 // Always finish the connection, even if this SocketStreamHandle was deactivated earlier. 254 G OwnPtr<GError> error;254 GUniqueOutPtr<GError> error; 255 255 GSocketConnection* socketConnection = g_socket_client_connect_to_host_finish(client, result, &error.outPtr()); 256 256 … … 269 269 { 270 270 // Always finish the read, even if this SocketStreamHandle was deactivated earlier. 271 G OwnPtr<GError> error;271 GUniqueOutPtr<GError> error; 272 272 gssize bytesRead = g_input_stream_read_finish(stream, result, &error.outPtr()); 273 273 -
trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp
r163081 r163797 29 29 #include "AuthenticationChallenge.h" 30 30 #include "CookieJarSoup.h" 31 #include "G OwnPtrSoup.h"31 #include "GUniquePtrSoup.h" 32 32 #include "Logging.h" 33 33 #include "ResourceHandle.h" … … 211 211 return nullptr; 212 212 213 G OwnPtr<SoupURI> uri;213 GUniqueOutPtr<SoupURI> uri; 214 214 g_object_get(soupResolver, SOUP_PROXY_RESOLVER_WK_PROXY_URI, &uri.outPtr(), nullptr); 215 215 -
trunk/Source/WebKit/gtk/ChangeLog
r163749 r163797 1 2014-02-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GLIB] Add GUniqueOutPtr and use it instead of GOwnPtr 4 https://bugs.webkit.org/show_bug.cgi?id=127554 5 6 Reviewed by Gustavo Noronha Silva. 7 8 Use GUniqueOutPtr instead of GOwnPtr. 9 10 * WebCoreSupport/FrameLoaderClientGtk.cpp: 11 (WebKit::FrameLoaderClient::dispatchDidFailLoad): 12 * WebCoreSupport/TextCheckerClientGtk.cpp: 13 * webkit/webkitdownload.cpp: 14 (webkit_download_open_stream_for_uri): 15 (webkit_download_set_destination_uri): 16 (webkit_download_received_data): 17 * webkit/webkitwebplugin.cpp: 18 (webkit_web_plugin_get_path): 19 * webkit/webkitwebview.cpp: 20 (webkit_web_view_expose_event): 21 1 22 2014-02-09 Carlos Garnacho <carlosg@gnome.org> 2 23 -
trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
r162786 r163797 96 96 #include <glib/gi18n-lib.h> 97 97 #include <stdio.h> 98 #include <wtf/gobject/GOwnPtr.h>99 98 #include <wtf/gobject/GRefPtr.h> 100 99 #include <wtf/gobject/GUniquePtr.h> … … 1041 1040 content = makeString("<html><body>", webError->message, "</body></html>"); 1042 1041 else { 1043 G OwnPtr<gchar> fileContent;1042 GUniqueOutPtr<gchar> fileContent; 1044 1043 if (!g_file_load_contents(errorFile.get(), 0, &fileContent.outPtr(), 0, 0, 0)) 1045 1044 content = makeString("<html><body>", webError->message, "</body></html>"); -
trunk/Source/WebKit/gtk/WebCoreSupport/TextCheckerClientGtk.cpp
r163712 r163797 29 29 #include "webkitwebsettingsprivate.h" 30 30 #include <glib.h> 31 #include <wtf/gobject/GOwnPtr.h>32 31 #include <wtf/text/CString.h> 33 32 #include <wtf/text/StringView.h> -
trunk/Source/WebKit/gtk/webkit/webkitdownload.cpp
r161536 r163797 40 40 #include <glib/gstdio.h> 41 41 #include <wtf/Noncopyable.h> 42 #include <wtf/gobject/GOwnPtr.h>43 42 #include <wtf/gobject/GRefPtr.h> 43 #include <wtf/gobject/GUniquePtr.h> 44 44 #include <wtf/text/CString.h> 45 45 … … 465 465 WebKitDownloadPrivate* priv = download->priv; 466 466 GRefPtr<GFile> file = adoptGRef(g_file_new_for_uri(uri)); 467 G OwnPtr<GError> error;467 GUniqueOutPtr<GError> error; 468 468 469 469 if (append) … … 706 706 GRefPtr<GFile> src = adoptGRef(g_file_new_for_uri(priv->destinationURI)); 707 707 GRefPtr<GFile> dest = adoptGRef(g_file_new_for_uri(destination_uri)); 708 G OwnPtr<GError> error;708 GUniqueOutPtr<GError> error; 709 709 710 710 g_file_move(src.get(), dest.get(), G_FILE_COPY_BACKUP, 0, 0, 0, &error.outPtr()); … … 866 866 867 867 gsize bytes_written; 868 G OwnPtr<GError> error;868 GUniqueOutPtr<GError> error; 869 869 870 870 g_output_stream_write_all(G_OUTPUT_STREAM(priv->outputStream), -
trunk/Source/WebKit/gtk/webkit/webkitwebplugin.cpp
r162599 r163797 25 25 #include "webkitwebpluginprivate.h" 26 26 #include <glib/gi18n-lib.h> 27 #include <wtf/gobject/G OwnPtr.h>27 #include <wtf/gobject/GUniquePtr.h> 28 28 29 29 /** … … 193 193 return priv->path.get(); 194 194 195 G OwnPtr<GError> error;195 GUniqueOutPtr<GError> error; 196 196 priv->path.reset(g_filename_from_utf8(priv->corePlugin->path().utf8().data(), -1, 0, 0, &error.outPtr())); 197 197 -
trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp
r163079 r163797 120 120 #include <gdk/gdkkeysyms.h> 121 121 #include <glib/gi18n-lib.h> 122 #include <wtf/gobject/GOwnPtr.h>123 122 #include <wtf/text/CString.h> 124 123 … … 671 670 { 672 671 int rectCount; 673 G OwnPtr<GdkRectangle> rects;672 GUniqueOutPtr<GdkRectangle> rects; 674 673 gdk_region_get_rectangles(event->region, &rects.outPtr(), &rectCount); 675 674 -
trunk/Source/WebKit2/ChangeLog
r163795 r163797 1 2014-02-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GLIB] Add GUniqueOutPtr and use it instead of GOwnPtr 4 https://bugs.webkit.org/show_bug.cgi?id=127554 5 6 Reviewed by Gustavo Noronha Silva. 7 8 Use GUniqueOutPtr instead of GOwnPtr. 9 10 * NetworkProcess/soup/NetworkProcessSoup.cpp: 11 (WebKit::getCacheDiskFreeSize): 12 * Shared/Downloads/soup/DownloadSoup.cpp: 13 (WebKit::DownloadClient::didReceiveResponse): 14 (WebKit::DownloadClient::didReceiveData): 15 (WebKit::DownloadClient::didFinishLoading): 16 * UIProcess/API/gtk/WebKitFaviconDatabase.cpp: 17 (processPendingIconsForPageURL): 18 (webkit_favicon_database_get_favicon): 19 * UIProcess/API/gtk/WebKitURISchemeRequest.cpp: 20 (webkitURISchemeRequestReadCallback): 21 * UIProcess/API/gtk/WebKitWebView.cpp: 22 (gotFaviconCallback): 23 * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp: 24 (WebKit::WebInspectorServer::platformResourceForPath): 25 * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp: 26 (WebKit::ProcessLauncher::launchProcess): 27 * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: 28 (WebKit::PluginProcessProxy::scanPlugin): 29 * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: 30 * WebProcess/soup/WebProcessSoup.cpp: 31 (WebKit::getCacheDiskFreeSize): 32 1 33 2014-02-10 Tim Horton <timothy_horton@apple.com> 2 34 -
trunk/Source/WebKit2/NetworkProcess/soup/NetworkProcessSoup.cpp
r161976 r163797 38 38 #include <WebCore/SoupNetworkSession.h> 39 39 #include <libsoup/soup.h> 40 #include <wtf/gobject/GOwnPtr.h>41 40 #include <wtf/gobject/GRefPtr.h> 41 #include <wtf/gobject/GUniquePtr.h> 42 42 43 43 using namespace WebCore; … … 49 49 ASSERT(cache); 50 50 51 G OwnPtr<char> cacheDir;51 GUniqueOutPtr<char> cacheDir; 52 52 g_object_get(G_OBJECT(cache), "cache-dir", &cacheDir.outPtr(), NULL); 53 53 if (!cacheDir) -
trunk/Source/WebKit2/Shared/Downloads/soup/DownloadSoup.cpp
r162830 r163797 33 33 #include <WebCore/ResourceHandleInternal.h> 34 34 #include <gio/gio.h> 35 #include <wtf/gobject/GOwnPtr.h>36 35 #include <wtf/gobject/GRefPtr.h> 37 36 #include <wtf/gobject/GUniquePtr.h> … … 107 106 String intermediateURI = m_destinationURI + ".wkdownload"; 108 107 m_intermediateFile = adoptGRef(g_file_new_for_uri(intermediateURI.utf8().data())); 109 G OwnPtr<GError> error;108 GUniqueOutPtr<GError> error; 110 109 m_outputStream = adoptGRef(g_file_replace(m_intermediateFile.get(), 0, TRUE, G_FILE_CREATE_NONE, 0, &error.outPtr())); 111 110 if (!m_outputStream) { … … 125 124 126 125 gsize bytesWritten; 127 G OwnPtr<GError> error;126 GUniqueOutPtr<GError> error; 128 127 g_output_stream_write_all(G_OUTPUT_STREAM(m_outputStream.get()), data, length, &bytesWritten, 0, &error.outPtr()); 129 128 if (error) { … … 140 139 ASSERT(m_intermediateFile); 141 140 GRefPtr<GFile> destinationFile = adoptGRef(g_file_new_for_uri(m_destinationURI.utf8().data())); 142 G OwnPtr<GError> error;141 GUniqueOutPtr<GError> error; 143 142 if (!g_file_move(m_intermediateFile.get(), destinationFile.get(), G_FILE_COPY_NONE, nullptr, nullptr, nullptr, &error.outPtr())) { 144 143 downloadFailed(platformDownloadDestinationError(m_response, error->message)); -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabase.cpp
r160125 r163797 30 30 #include <glib/gi18n-lib.h> 31 31 #include <wtf/RunLoop.h> 32 #include <wtf/gobject/GOwnPtr.h>33 32 #include <wtf/gobject/GRefPtr.h> 33 #include <wtf/gobject/GUniquePtr.h> 34 34 #include <wtf/text/CString.h> 35 35 … … 165 165 return; 166 166 167 G OwnPtr<GError> error;167 GUniqueOutPtr<GError> error; 168 168 RefPtr<cairo_surface_t> icon = getIconSurfaceSynchronously(database, pageURL, &error.outPtr()); 169 169 … … 171 171 GTask* task = pendingIconRequests->at(i).get(); 172 172 if (error) 173 g_task_return_error(task, error.release() );173 g_task_return_error(task, error.release().release()); 174 174 else { 175 175 GetFaviconSurfaceAsyncData* data = static_cast<GetFaviconSurfaceAsyncData*>(g_task_get_task_data(task)); … … 291 291 // We ask for the icon directly. If we don't get the icon data now, 292 292 // we'll be notified later (even if the database is still importing icons). 293 G OwnPtr<GError> error;293 GUniqueOutPtr<GError> error; 294 294 data->icon = getIconSurfaceSynchronously(database, data->pageURL, &error.outPtr()); 295 295 if (data->icon) { … … 302 302 303 303 if (g_error_matches(error.get(), WEBKIT_FAVICON_DATABASE_ERROR, WEBKIT_FAVICON_DATABASE_ERROR_FAVICON_NOT_FOUND)) { 304 g_task_return_error(task.get(), error.release() );304 g_task_return_error(task.get(), error.release().release()); 305 305 return; 306 306 } -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp
r162920 r163797 29 29 #include <WebCore/ResourceError.h> 30 30 #include <libsoup/soup.h> 31 #include <wtf/gobject/GOwnPtr.h>32 31 #include <wtf/gobject/GRefPtr.h> 33 32 #include <wtf/text/CString.h> … … 160 159 { 161 160 GRefPtr<WebKitURISchemeRequest> request = adoptGRef(schemeRequest); 162 G OwnPtr<GError> error;161 GUniqueOutPtr<GError> error; 163 162 gssize bytesRead = g_input_stream_read_finish(inputStream, result, &error.outPtr()); 164 163 if (bytesRead == -1) { -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
r163781 r163797 67 67 #include <WebCore/RefPtrCairo.h> 68 68 #include <glib/gi18n-lib.h> 69 #include <wtf/gobject/GOwnPtr.h>70 69 #include <wtf/gobject/GRefPtr.h> 71 70 #include <wtf/text/CString.h> … … 339 338 static void gotFaviconCallback(GObject* object, GAsyncResult* result, gpointer userData) 340 339 { 341 G OwnPtr<GError> error;340 GUniqueOutPtr<GError> error; 342 341 RefPtr<cairo_surface_t> favicon = adoptRef(webkit_favicon_database_get_favicon_finish(WEBKIT_FAVICON_DATABASE(object), result, &error.outPtr())); 343 342 if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) -
trunk/Source/WebKit2/UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp
r162599 r163797 34 34 #include <gio/gio.h> 35 35 #include <glib.h> 36 #include <wtf/gobject/GOwnPtr.h>37 36 #include <wtf/gobject/GUniquePtr.h> 38 37 #include <wtf/text/CString.h> … … 56 55 57 56 GRefPtr<GFile> file = adoptGRef(g_file_new_for_uri(resourceURI.data())); 58 G OwnPtr<GError> error;57 GUniqueOutPtr<GError> error; 59 58 GRefPtr<GFileInfo> fileInfo = adoptGRef(g_file_query_info(file.get(), G_FILE_ATTRIBUTE_STANDARD_SIZE "," G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, G_FILE_QUERY_INFO_NONE, 0, &error.outPtr())); 60 59 if (!fileInfo) { -
trunk/Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
r162599 r163797 40 40 #include <wtf/text/CString.h> 41 41 #include <wtf/text/WTFString.h> 42 #include <wtf/gobject/GOwnPtr.h>43 42 #include <wtf/gobject/GUniquePtr.h> 44 43 #include <wtf/gobject/GlibUtilities.h> … … 124 123 argv[i++] = 0; 125 124 126 G OwnPtr<GError> error;125 GUniqueOutPtr<GError> error; 127 126 if (!g_spawn_async(0, argv, 0, G_SPAWN_LEAVE_DESCRIPTORS_OPEN, childSetupFunction, GINT_TO_POINTER(sockets[1]), &pid, &error.outPtr())) { 128 127 g_printerr("Unable to fork a new WebProcess: %s.\n", error->message); -
trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
r162513 r163797 38 38 #if PLATFORM(GTK) || PLATFORM(EFL) 39 39 #include <glib.h> 40 #include <wtf/gobject/G OwnPtr.h>40 #include <wtf/gobject/GUniquePtr.h> 41 41 #endif 42 42 … … 75 75 76 76 int status; 77 G OwnPtr<char> stdOut;77 GUniqueOutPtr<char> stdOut; 78 78 79 79 // If the disposition of SIGCLD signal is set to SIG_IGN (default) -
trunk/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp
r162599 r163797 41 41 #include <gtk/gtk.h> 42 42 #include <wtf/Vector.h> 43 #include <wtf/gobject/GOwnPtr.h>44 43 #include <wtf/gobject/GUniquePtr.h> 45 44 … … 80 79 m_printJob = adoptGRef(gtk_print_job_new(jobName.get(), printer, m_printSettings.get(), m_pageSetup.get())); 81 80 82 G OwnPtr<GError> error;81 GUniqueOutPtr<GError> error; 83 82 cairo_surface_t* surface = gtk_print_job_get_surface(m_printJob.get(), &error.outPtr()); 84 83 if (!surface) { -
trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp
r162449 r163797 42 42 #include <WebCore/SoupNetworkSession.h> 43 43 #include <libsoup/soup.h> 44 #include <wtf/gobject/GOwnPtr.h>45 44 #include <wtf/gobject/GRefPtr.h> 45 #include <wtf/gobject/GUniquePtr.h> 46 46 47 47 #if !ENABLE(CUSTOM_PROTOCOLS) … … 55 55 ASSERT(cache); 56 56 57 G OwnPtr<char> cacheDir;57 GUniqueOutPtr<char> cacheDir; 58 58 g_object_get(G_OBJECT(cache), "cache-dir", &cacheDir.outPtr(), NULL); 59 59 if (!cacheDir) -
trunk/Tools/ChangeLog
r163781 r163797 1 2014-02-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GLIB] Add GUniqueOutPtr and use it instead of GOwnPtr 4 https://bugs.webkit.org/show_bug.cgi?id=127554 5 6 Reviewed by Gustavo Noronha Silva. 7 8 Use GUniqueOutPtr instead of GOwnPtr. 9 10 * DumpRenderTree/gtk/DumpRenderTree.cpp: 11 * DumpRenderTree/gtk/EventSender.cpp: 12 (createKeyPressEvent): 13 * TestWebKitAPI/Tests/WTF/gobject/GUniquePtr.cpp: 14 (TestWebKitAPI::returnOutChar): 15 (TestWebKitAPI::TEST): 16 * TestWebKitAPI/Tests/WebKit2Gtk/TestCookieManager.cpp: 17 * TestWebKitAPI/Tests/WebKit2Gtk/TestInspectorServer.cpp: 18 (testInspectorServerPageList): 19 (openRemoteDebuggingSession): 20 (sendIncompleteRequest): 21 * TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp: 22 * TestWebKitAPI/Tests/WebKit2Gtk/TestWebExtensions.cpp: 23 (testWebExtensionWindowObjectCleared): 24 (testWebExtensionIsolatedWorld): 25 * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp: 26 * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp: 27 (testWebViewRunJavaScript): 28 (testWebViewSave): 29 (testWebViewPageVisibility): 30 * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebViewGroup.cpp: 31 (isStyleSheetInjectedForURLAtPath): 32 * TestWebKitAPI/Tests/WebKit2Gtk/TestWebViewEditor.cpp: 33 * TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp: 34 * TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.cpp: 35 * TestWebKitAPI/Tests/gtk/InputMethodFilter.cpp: 36 (TestWebKitAPI::TestInputMethodFilter::sendKeyEventToFilter): 37 * TestWebKitAPI/gtk/PlatformWebViewGtk.cpp: 38 (TestWebKitAPI::doKeyStroke): 39 * TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h: 40 * TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestBus.cpp: 41 (WebKitTestBus::run): 42 * TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp: 43 (resourceGetDataCallback): 44 (WebViewTest::keyStroke): 45 (onSnapshotReady): 46 * WebKitTestRunner/gtk/EventSenderProxyGtk.cpp: 47 (WTR::EventSenderProxy::keyDown): 48 1 49 2014-02-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 50 -
trunk/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
r163427 r163797 55 55 #include <webkit/webkit.h> 56 56 #include <wtf/Assertions.h> 57 #include <wtf/gobject/GOwnPtr.h>58 57 #include <wtf/gobject/GlibUtilities.h> 59 58 #include <wtf/text/WTFString.h> -
trunk/Tools/DumpRenderTree/gtk/EventSender.cpp
r163749 r163797 48 48 #include <wtf/ASCIICType.h> 49 49 #include <wtf/Platform.h> 50 #include <wtf/gobject/GOwnPtr.h>51 50 #include <wtf/gobject/GUniquePtr.h> 52 51 #include <wtf/text/CString.h> … … 806 805 // When synthesizing an event, an invalid hardware_keycode value 807 806 // can cause it to be badly processed by Gtk+. 808 G OwnPtr<GdkKeymapKey> keys;807 GUniqueOutPtr<GdkKeymapKey> keys; 809 808 gint nKeys; 810 809 if (gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(), gdkKeySym, &keys.outPtr(), &nKeys)) -
trunk/Tools/TestWebKitAPI/Tests/WTF/gobject/GUniquePtr.cpp
r162516 r163797 146 146 } 147 147 148 static void returnOutChar(char** outChar) 149 { 150 *outChar = g_strdup("a"); 151 } 152 153 TEST(WTF_GUniquePtr, OutPtr) 154 { 155 std::ostringstream actual; 156 157 { 158 GUniqueOutPtr<char> a; 159 ASSERT_EQ(nullptr, a.get()); 160 } 161 ASSERT_STREQ(actual.str().c_str(), takeLogStr().c_str()); 162 actual.str(""); 163 164 { 165 GUniqueOutPtr<char> a; 166 returnOutChar(&a.outPtr()); 167 actual << "g_free(" << a.get() << ");"; 168 } 169 ASSERT_STREQ(actual.str().c_str(), takeLogStr().c_str()); 170 actual.str(""); 171 172 { 173 GUniqueOutPtr<char> a; 174 returnOutChar(&a.outPtr()); 175 actual << "g_free(" << a.get() << ");"; 176 returnOutChar(&a.outPtr()); 177 ASSERT_STREQ(actual.str().c_str(), takeLogStr().c_str()); 178 actual.str(""); 179 actual << "g_free(" << a.get() << ");"; 180 } 181 ASSERT_STREQ(actual.str().c_str(), takeLogStr().c_str()); 182 actual.str(""); 183 184 { 185 GUniqueOutPtr<char> a; 186 returnOutChar(&a.outPtr()); 187 GUniquePtr<char> b = a.release(); 188 ASSERT_STREQ(actual.str().c_str(), takeLogStr().c_str()); 189 actual << "g_free(" << b.get() << ");"; 190 } 191 ASSERT_STREQ(actual.str().c_str(), takeLogStr().c_str()); 192 actual.str(""); 193 } 194 148 195 } // namespace TestWebKitAPI -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestCookieManager.cpp
r162599 r163797 89 89 static void getAcceptPolicyReadyCallback(GObject* object, GAsyncResult* result, gpointer userData) 90 90 { 91 G OwnPtr<GError> error;91 GUniqueOutPtr<GError> error; 92 92 WebKitCookieAcceptPolicy policy = webkit_cookie_manager_get_accept_policy_finish(WEBKIT_COOKIE_MANAGER(object), result, &error.outPtr()); 93 93 g_assert(!error.get()); … … 114 114 static void getDomainsReadyCallback(GObject* object, GAsyncResult* result, gpointer userData) 115 115 { 116 G OwnPtr<GError> error;116 GUniqueOutPtr<GError> error; 117 117 char** domains = webkit_cookie_manager_get_domains_with_cookies_finish(WEBKIT_COOKIE_MANAGER(object), result, &error.outPtr()); 118 118 g_assert(!error.get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestInspectorServer.cpp
r162599 r163797 159 159 static void testInspectorServerPageList(InspectorServerTest* test, gconstpointer) 160 160 { 161 G OwnPtr<GError> error;161 GUniqueOutPtr<GError> error; 162 162 163 163 test->showInWindowAndWaitUntilMapped(GTK_WINDOW_TOPLEVEL); … … 229 229 g_assert(test->getPageList()); 230 230 231 G OwnPtr<GError> error;231 GUniqueOutPtr<GError> error; 232 232 WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished("pages[0].inspectorUrl;", &error.outPtr()); 233 233 g_assert(javascriptResult); … … 248 248 static void sendIncompleteRequest(InspectorServerTest* test, gconstpointer) 249 249 { 250 G OwnPtr<GError> error;250 GUniqueOutPtr<GError> error; 251 251 252 252 // Connect to the inspector server. -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp
r162599 r163797 162 162 { 163 163 size_t dataSize; 164 G OwnPtr<GError> error;164 GUniqueOutPtr<GError> error; 165 165 unsigned char* data = webkit_web_resource_get_data_finish(WEBKIT_WEB_RESOURCE(object), result, &dataSize, &error.outPtr()); 166 166 g_assert(!error.get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebExtensions.cpp
r162599 r163797 107 107 test->waitUntilLoadFinished(); 108 108 109 G OwnPtr<GError> error;109 GUniqueOutPtr<GError> error; 110 110 WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished("window.echo('Foo');", &error.outPtr()); 111 111 g_assert(javascriptResult); … … 134 134 test->waitUntilLoadFinished(); 135 135 136 G OwnPtr<char> result;136 GUniqueOutPtr<char> result; 137 137 gulong scriptDialogID = g_signal_connect(test->m_webView, "script-dialog", G_CALLBACK(scriptDialogCallback), &result.outPtr()); 138 138 … … 144 144 test->runJavaScriptAndWaitUntilFinished(mainWorldScript, 0); 145 145 g_assert_cmpstr(result.get(), ==, "Main World"); 146 result.clear();147 146 148 147 WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.getElementById('console').innerHTML", 0); … … 166 165 g_main_loop_run(test->m_mainLoop); 167 166 g_assert_cmpstr(result.get(), ==, "Isolated World"); 168 result.clear();169 167 170 168 // Check that 'top.foo' defined in main world is not visible in isolated world. -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp
r162599 r163797 24 24 #include <glib/gstdio.h> 25 25 #include <libsoup/soup.h> 26 #include <wtf/gobject/GOwnPtr.h>27 26 #include <wtf/gobject/GUniquePtr.h> 28 27 … … 37 36 : m_webContext(webkit_web_context_get_default()) 38 37 , m_favicon(0) 39 , m_error(0)40 38 , m_faviconNotificationReceived(false) 41 39 { … … 85 83 void getFaviconForPageURIAndWaitUntilReady(const char* pageURI) 86 84 { 87 m_error.clear();88 85 if (m_favicon) { 89 86 cairo_surface_destroy(m_favicon); … … 99 96 cairo_surface_t* m_favicon; 100 97 CString m_faviconURI; 101 G OwnPtr<GError> m_error;98 GUniqueOutPtr<GError> m_error; 102 99 bool m_faviconNotificationReceived; 103 100 }; -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp
r162599 r163797 87 87 test->waitUntilLoadFinished(); 88 88 89 G OwnPtr<GError> error;89 GUniqueOutPtr<GError> error; 90 90 WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished("window.document.getElementById('WebKitLink').title;", &error.outPtr()); 91 91 g_assert(javascriptResult); … … 145 145 g_assert(!javascriptResult); 146 146 g_assert_error(error.get(), G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND); 147 error.clear();148 147 149 148 javascriptResult = test->runJavaScriptAndWaitUntilFinished("foo();", &error.outPtr()); … … 347 346 static void webViewSavedToStreamCallback(GObject* object, GAsyncResult* result, SaveWebViewTest* test) 348 347 { 349 G OwnPtr<GError> error;348 GUniqueOutPtr<GError> error; 350 349 test->m_inputStream = adoptGRef(webkit_web_view_save_finish(test->m_webView, result, &error.outPtr())); 351 350 g_assert(G_IS_INPUT_STREAM(test->m_inputStream.get())); … … 357 356 static void webViewSavedToFileCallback(GObject* object, GAsyncResult* result, SaveWebViewTest* test) 358 357 { 359 G OwnPtr<GError> error;358 GUniqueOutPtr<GError> error; 360 359 g_assert(webkit_web_view_save_to_file_finish(test->m_webView, result, &error.outPtr())); 361 360 g_assert(!error); … … 406 405 // different on each case. MHTML functionality will be tested by 407 406 // Layout tests, so checking the amount of bytes is enough. 408 G OwnPtr<GError> error;407 GUniqueOutPtr<GError> error; 409 408 gchar buffer[512] = { 0 }; 410 409 gssize readBytes = 0; … … 459 458 test->waitUntilLoadFinished(); 460 459 461 G OwnPtr<GError> error;460 GUniqueOutPtr<GError> error; 462 461 WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.visibilityState;", &error.outPtr()); 463 462 g_assert(javascriptResult); … … 508 507 static void onSnapshotCancelledReady(WebKitWebView* web_view, GAsyncResult* res, SnapshotWebViewTest* test) 509 508 { 510 G OwnPtr<GError> error;509 GUniqueOutPtr<GError> error; 511 510 test->m_surface = webkit_web_view_get_snapshot_finish(web_view, res, &error.outPtr()); 512 511 g_assert(!test->m_surface); -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebViewGroup.cpp
r162599 r163797 104 104 test->waitUntilLoadFinished(); 105 105 106 G OwnPtr<GError> error;106 GUniqueOutPtr<GError> error; 107 107 WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished(kStyleSheetTestScript, &error.outPtr()); 108 108 g_assert(javascriptResult); -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebViewEditor.cpp
r162599 r163797 39 39 static void canExecuteEditingCommandReadyCallback(GObject*, GAsyncResult* result, EditorTest* test) 40 40 { 41 G OwnPtr<GError> error;41 GUniqueOutPtr<GError> error; 42 42 test->m_canExecuteEditingCommand = webkit_web_view_can_execute_editing_command_finish(test->m_webView, result, &error.outPtr()); 43 43 g_assert(!error.get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp
r162928 r163797 30 30 #include <wtf/PassOwnPtr.h> 31 31 #include <wtf/ProcessID.h> 32 #include <wtf/gobject/GOwnPtr.h>33 32 #include <wtf/gobject/GRefPtr.h> 34 33 #include <wtf/gobject/GUniquePtr.h> … … 245 244 introspectionData = g_dbus_node_info_new_for_xml(introspectionXML, 0); 246 245 247 G OwnPtr<GError> error;246 GUniqueOutPtr<GError> error; 248 247 unsigned registrationID = g_dbus_connection_register_object( 249 248 connection, -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.cpp
r161366 r163797 22 22 23 23 #include <gio/gio.h> 24 #include <wtf/gobject/G OwnPtr.h>24 #include <wtf/gobject/GUniquePtr.h> 25 25 26 26 typedef HashMap<String, std::function<PassOwnPtr<WebProcessTest> ()>> TestsMap; … … 81 81 introspectionData = g_dbus_node_info_new_for_xml(introspectionXML, 0); 82 82 83 G OwnPtr<GError> error;83 GUniqueOutPtr<GError> error; 84 84 unsigned registrationID = g_dbus_connection_register_object( 85 85 connection, -
trunk/Tools/TestWebKitAPI/Tests/gtk/InputMethodFilter.cpp
r138806 r163797 30 30 #include <gdk/gdkkeysyms.h> 31 31 #include <gtk/gtk.h> 32 #include <wtf/gobject/G OwnPtr.h>32 #include <wtf/gobject/GUniquePtr.h> 33 33 #include <wtf/gobject/GRefPtr.h> 34 34 #include <wtf/text/CString.h> … … 65 65 #endif 66 66 67 G OwnPtr<GdkKeymapKey> keys;67 GUniqueOutPtr<GdkKeymapKey> keys; 68 68 gint nKeys; 69 69 if (gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(), gdkKeyValue, &keys.outPtr(), &nKeys)) -
trunk/Tools/TestWebKitAPI/gtk/PlatformWebViewGtk.cpp
r162599 r163797 29 29 #include <WebCore/GUniquePtrGtk.h> 30 30 #include <gtk/gtk.h> 31 #include <wtf/gobject/G OwnPtr.h>31 #include <wtf/gobject/GUniquePtr.h> 32 32 33 33 namespace TestWebKitAPI { … … 68 68 69 69 // When synthesizing an event, an invalid hardware_keycode value can cause it to be badly processed by GTK+. 70 G OwnPtr<GdkKeymapKey> keys;70 GUniqueOutPtr<GdkKeymapKey> keys; 71 71 int keysCount; 72 72 if (gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(), keyVal, &keys.outPtr(), &keysCount)) -
trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h
r162599 r163797 24 24 #include <glib-object.h> 25 25 #include <wtf/HashSet.h> 26 #include <wtf/gobject/GOwnPtr.h>27 26 #include <wtf/gobject/GUniquePtr.h> 28 27 #include <wtf/text/CString.h> -
trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestBus.cpp
r162599 r163797 21 21 #include "WebKitTestBus.h" 22 22 23 #include <wtf/gobject/GOwnPtr.h>24 23 #include <wtf/gobject/GUniquePtr.h> 25 24 #include <wtf/text/WTFString.h> … … 39 38 } 40 39 41 G OwnPtr<char> output;42 G OwnPtr<GError> error;40 GUniqueOutPtr<char> output; 41 GUniqueOutPtr<GError> error; 43 42 if (!g_spawn_command_line_sync(dbusLaunch.get(), &output.outPtr(), 0, 0, &error.outPtr())) { 44 43 g_warning("Error starting DBUS daemon: %s", error->message); -
trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp
r162599 r163797 219 219 { 220 220 size_t dataSize; 221 G OwnPtr<GError> error;221 GUniqueOutPtr<GError> error; 222 222 unsigned char* data = webkit_web_resource_get_data_finish(WEBKIT_WEB_RESOURCE(object), result, &dataSize, &error.outPtr()); 223 223 g_assert(data); … … 289 289 290 290 // When synthesizing an event, an invalid hardware_keycode value can cause it to be badly processed by GTK+. 291 G OwnPtr<GdkKeymapKey> keys;291 GUniqueOutPtr<GdkKeymapKey> keys; 292 292 int keysCount; 293 293 if (gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(), keyVal, &keys.outPtr(), &keysCount)) … … 426 426 static void onSnapshotReady(WebKitWebView* web_view, GAsyncResult* res, WebViewTest* test) 427 427 { 428 G OwnPtr<GError> error;428 GUniqueOutPtr<GError> error; 429 429 test->m_surface = webkit_web_view_get_snapshot_finish(web_view, res, &error.outPtr()); 430 430 g_assert(!test->m_surface || !error.get()); -
trunk/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp
r163774 r163797 40 40 #include <gtk/gtk.h> 41 41 #include <wtf/StdLibExtras.h> 42 #include <wtf/gobject/G OwnPtr.h>42 #include <wtf/gobject/GUniquePtr.h> 43 43 #include <wtf/text/WTFString.h> 44 44 … … 297 297 gdk_event_set_device(pressEvent, gdk_device_manager_get_client_pointer(gdk_display_get_device_manager(gdk_window_get_display(pressEvent->key.window)))); 298 298 299 G OwnPtr<GdkKeymapKey> keys;299 GUniqueOutPtr<GdkKeymapKey> keys; 300 300 gint nKeys; 301 301 if (gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(), gdkKeySym, &keys.outPtr(), &nKeys))
Note: See TracChangeset
for help on using the changeset viewer.