Changeset 69611 in webkit
- Timestamp:
- Oct 12, 2010 3:16:16 PM (13 years ago)
- Location:
- trunk/WebKit/chromium
- Files:
-
- 1 deleted
- 5 edited
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/chromium/ChangeLog
r69609 r69611 1 2010-10-12 Jian Li <jianli@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 [chromium] Update WebBlobData to adapt to BlobData change in terms of 6 handling string data item. 7 https://bugs.webkit.org/show_bug.cgi?id=47423 8 9 Also remove unneeded methods in WebBlobData. WebBlobStorageData.* are 10 also removed since they're not longer needed. 11 12 * WebKit.gyp: 13 * public/WebBlobData.h: 14 * public/WebBlobRegistry.h: 15 * public/WebBlobStorageData.h: Removed. 16 * public/WebThreadSafeData.h: Added. 17 * src/WebBlobData.cpp: 18 * src/WebBlobStorageData.cpp: Removed. 19 * src/WebThreadSafeData.cpp: Added. 20 1 21 2010-10-12 Kavita Kanetkar <kkanetkar@chromium.org> 2 22 -
trunk/WebKit/chromium/WebKit.gyp
r69541 r69611 113 113 'public/WebBlobData.h', 114 114 'public/WebBlobRegistry.h', 115 'public/WebBlobStorageData.h',116 115 'public/WebCache.h', 117 116 'public/WebCanvas.h', … … 266 265 'public/WebTextInputType.h', 267 266 'public/WebTextRun.h', 267 'public/WebThreadSafeData.h', 268 268 'public/WebURL.h', 269 269 'public/WebURLError.h', … … 391 391 'src/WebBindings.cpp', 392 392 'src/WebBlobData.cpp', 393 'src/WebBlobStorageData.cpp',394 393 'src/WebCache.cpp', 395 394 'src/WebColor.cpp', … … 524 523 'src/WebString.cpp', 525 524 'src/WebTextRun.cpp', 525 'src/WebThreadSafeData.cpp', 526 526 'src/WebURL.cpp', 527 527 'src/WebURLLoadTiming.cpp', -
trunk/WebKit/chromium/public/WebBlobData.h
r65946 r69611 32 32 #define WebBlobData_h 33 33 34 #include "Web CString.h"34 #include "WebThreadSafeData.h" 35 35 #include "WebString.h" 36 36 #include "WebURL.h" … … 49 49 struct Item { 50 50 enum { TypeData, TypeFile, TypeBlob } type; 51 Web CStringdata;51 WebThreadSafeData data; 52 52 WebString filePath; 53 53 WebURL blobURL; … … 73 73 WEBKIT_API bool itemAt(size_t index, Item& result) const; 74 74 75 // Appends to the list of items.76 WEBKIT_API void appendData(const WebCString&);77 WEBKIT_API void appendFile(const WebString& filePath);78 WEBKIT_API void appendFile(const WebString& filePath, long long offset, long long length, double expectedModificationTime);79 WEBKIT_API void appendBlob(const WebURL& blobURL, long long offset, long long length);80 81 75 WEBKIT_API WebString contentType() const; 82 WEBKIT_API void setContentType(const WebString&);83 76 84 77 WEBKIT_API WebString contentDisposition() const; 85 WEBKIT_API void setContentDisposition(const WebString&);86 78 87 79 #if WEBKIT_IMPLEMENTATION -
trunk/WebKit/chromium/public/WebBlobRegistry.h
r65972 r69611 32 32 #define WebBlobRegistry_h 33 33 34 #include "WebBlobStorageData.h"35 36 34 namespace WebKit { 37 35 -
trunk/WebKit/chromium/public/WebThreadSafeData.h
-
Property
svn:executable
set to
*
r69610 r69611 29 29 */ 30 30 31 #ifndef Web BlobStorageData_h32 #define Web BlobStorageData_h31 #ifndef WebThreadSafeData_h 32 #define WebThreadSafeData_h 33 33 34 #include "WebBlobData.h" 35 #include "WebData.h" 36 #include "WebFileInfo.h" 37 #include "WebString.h" 34 #include "WebCommon.h" 35 #include "WebPrivatePtr.h" 38 36 39 #if WEBKIT_IMPLEMENTATION 40 namespace WebCore { class BlobStorageData; } 41 namespace WTF { template <typename T> class PassRefPtr; } 37 #if !WEBKIT_IMPLEMENTATION 38 #include <string> 42 39 #endif 40 41 namespace WebCore { class RawData; } 43 42 44 43 namespace WebKit { 45 44 46 class WebBlobStorageDataPrivate; 45 // A container for raw bytes. It is inexpensive to copy a WebThreadSafeData object. 46 // It is safe to pass a WebThreadSafeData across threads!!! 47 class WebThreadSafeData { 48 public: 49 WebThreadSafeData() { } 50 ~WebThreadSafeData() { reset(); } 47 51 48 class WebBlobStorageData { 49 public: 50 ~WebBlobStorageData() { reset(); } 51 52 WebBlobStorageData() : m_private(0) { } 53 52 WEBKIT_API void assign(const WebThreadSafeData&); 54 53 WEBKIT_API void reset(); 55 54 56 bool isNull() const { return !m_private; } 55 WEBKIT_API size_t size() const; 56 WEBKIT_API const char* data() const; 57 57 58 // Returns the number of items. 59 WEBKIT_API size_t itemCount() const; 60 61 // Retrieves the values of the item at the given index. Returns false if 62 // index is out of bounds. 63 WEBKIT_API bool itemAt(size_t index, WebBlobData::Item& result) const; 64 65 WEBKIT_API WebString contentType() const; 66 WEBKIT_API WebString contentDisposition() const; 58 bool isEmpty() const { return !size(); } 67 59 68 60 #if WEBKIT_IMPLEMENTATION 69 WebBlobStorageData(const WTF::PassRefPtr<WebCore::BlobStorageData>&); 70 WebBlobStorageData& operator=(const WTF::PassRefPtr<WebCore::BlobStorageData>&); 71 operator WTF::PassRefPtr<WebCore::BlobStorageData>() const; 61 WebThreadSafeData(const WTF::PassRefPtr<WebCore::RawData>&); 62 WebThreadSafeData& operator=(const WTF::PassRefPtr<WebCore::RawData>&); 63 #else 64 operator std::string() const 65 { 66 size_t len = size(); 67 return len ? std::string(data(), len) : std::string(); 68 } 72 69 #endif 73 70 74 71 private: 75 #if WEBKIT_IMPLEMENTATION 76 void assign(const WTF::PassRefPtr<WebCore::BlobStorageData>&); 77 #endif 78 WebBlobStorageDataPrivate* m_private; 72 WebPrivatePtr<WebCore::RawData> m_private; 79 73 }; 80 74 81 75 } // namespace WebKit 82 76 83 #endif // WebBlobStorageData_h77 #endif -
Property
svn:executable
set to
-
trunk/WebKit/chromium/src/WebBlobData.cpp
r65946 r69611 33 33 34 34 #include "BlobData.h" 35 #include <wtf/PassOwnPtr.h> 35 36 36 37 using namespace WebCore; … … 90 91 } 91 92 92 void WebBlobData::appendData(const WebCString& data)93 {94 ASSERT(!isNull());95 m_private->appendData(data);96 }97 98 void WebBlobData::appendFile(const WebString& filePath)99 {100 ASSERT(!isNull());101 m_private->appendFile(filePath);102 }103 104 void WebBlobData::appendFile(const WebString& filePath, long long offset, long long length, double expectedModificationTime)105 {106 ASSERT(!isNull());107 m_private->appendFile(filePath, offset, length, expectedModificationTime);108 }109 110 void WebBlobData::appendBlob(const WebURL& blobURL, long long offset, long long length)111 {112 ASSERT(!isNull());113 m_private->appendBlob(blobURL, offset, length);114 }115 116 93 WebString WebBlobData::contentType() const 117 94 { … … 120 97 } 121 98 122 void WebBlobData::setContentType(const WebString& contentType)123 {124 ASSERT(!isNull());125 m_private->setContentType(contentType);126 }127 128 99 WebString WebBlobData::contentDisposition() const 129 100 { 130 101 ASSERT(!isNull()); 131 102 return m_private->contentDisposition(); 132 }133 134 void WebBlobData::setContentDisposition(const WebString& contentDisposition)135 {136 ASSERT(!isNull());137 m_private->setContentDisposition(contentDisposition);138 103 } 139 104 -
trunk/WebKit/chromium/src/WebThreadSafeData.cpp
-
Property
svn:executable
set to
*
r69610 r69611 1 1 /* 2 2 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * 3 * 4 4 * Redistribution and use in source and binary forms, with or without 5 5 * modification, are permitted provided that the following conditions are 6 6 * met: 7 * 7 * 8 8 * * Redistributions of source code must retain the above copyright 9 9 * notice, this list of conditions and the following disclaimer. … … 15 15 * contributors may be used to endorse or promote products derived from 16 16 * this software without specific prior written permission. 17 * 17 * 18 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT … … 29 29 */ 30 30 31 #i fndef WebBlobRegistry_h32 # define WebBlobRegistry_h31 #include "config.h" 32 #include "WebThreadSafeData.h" 33 33 34 #include "WebBlobStorageData.h" 34 #include "BlobData.h" 35 36 using namespace WebCore; 35 37 36 38 namespace WebKit { 37 39 38 class WebBlobData; 39 class WebURL; 40 void WebThreadSafeData::reset() 41 { 42 m_private.reset(); 43 } 40 44 41 class WebBlobRegistry { 42 public: 43 WEBKIT_API static WebBlobRegistry* create(); 45 void WebThreadSafeData::assign(const WebThreadSafeData& other) 46 { 47 m_private = other.m_private; 48 } 44 49 45 virtual ~WebBlobRegistry() { } 50 size_t WebThreadSafeData::size() const 51 { 52 if (m_private.isNull()) 53 return 0; 54 return m_private->length(); 55 } 46 56 47 // Registers a blob URL referring to the specified blob data. 48 virtual void registerBlobURL(const WebURL&, WebBlobData&) = 0; 49 50 // Registers a blob URL referring to the blob data identified by the specified srcURL. 51 virtual void registerBlobURL(const WebURL&, const WebURL& srcURL) = 0; 57 const char* WebThreadSafeData::data() const 58 { 59 if (m_private.isNull()) 60 return 0; 61 return m_private->data(); 62 } 52 63 53 virtual void unregisterBlobURL(const WebURL&) = 0; 54 }; 64 WebThreadSafeData::WebThreadSafeData(const PassRefPtr<RawData>& data) 65 : m_private(data.releaseRef()) 66 { 67 } 68 69 WebThreadSafeData& WebThreadSafeData::operator=(const PassRefPtr<RawData>& data) 70 { 71 m_private = data; 72 return *this; 73 } 55 74 56 75 } // namespace WebKit 57 58 #endif // WebBlobRegistry_h -
Property
svn:executable
set to
Note: See TracChangeset
for help on using the changeset viewer.