Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Unified Diff: third_party/WebKit/Source/platform/fonts/WebFontDecoder.h

Issue 2032943002: Avoid one temporary copy on web fonts decoding (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/fonts/WebFontDecoder.h
diff --git a/third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.h b/third_party/WebKit/Source/platform/fonts/WebFontDecoder.h
similarity index 73%
copy from third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.h
copy to third_party/WebKit/Source/platform/fonts/WebFontDecoder.h
index fbb8d7b8582b8370265e71150fd5646e558191df..ff2d6a8f0d744bf2cde9961bb72e6d3502991426 100644
--- a/third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.h
+++ b/third_party/WebKit/Source/platform/fonts/WebFontDecoder.h
@@ -28,26 +28,36 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SQLTransactionClient_h
-#define SQLTransactionClient_h
+#ifndef WebFontDecoder_h
+#define WebFontDecoder_h
+#include "third_party/skia/include/core/SkTypeface.h"
#include "wtf/Allocator.h"
-#include "wtf/Noncopyable.h"
+#include "wtf/RefPtr.h"
+#include "wtf/text/WTFString.h"
namespace blink {
-class Database;
+class SharedBuffer;
-// A client to the SQLTransaction class. Allows SQLTransaction to notify interested
-// parties that certain things have happened in a transaction.
-class SQLTransactionClient {
- WTF_MAKE_NONCOPYABLE(SQLTransactionClient); USING_FAST_MALLOC(SQLTransactionClient);
+class WebFontDecoder final {
+ STACK_ALLOCATED();
public:
- SQLTransactionClient() { }
- void didCommitWriteTransaction(Database*);
- bool didExceedQuota(Database*);
+ WebFontDecoder()
+ {
+ }
+
+ PassRefPtr<SkTypeface> decode(SharedBuffer*);
+
+ static bool supportsFormat(const String&);
+ String getErrorString() const { return m_otsErrorString; }
+
+private:
+ void setErrorString(const String& errorString) { m_otsErrorString = errorString; }
+
+ String m_otsErrorString;
};
} // namespace blink
-#endif // SQLTransactionClient_h
+#endif // WebFontDecoder_h

Powered by Google App Engine
This is Rietveld 408576698