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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/ImageSource.h

Issue 2918443003: Remove redundant reading and writing of data about SharedBuffer.
Patch Set: benchmark Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // earlier frame may require more work to be done, e.g. redecoding the image 65 // earlier frame may require more work to be done, e.g. redecoding the image
66 // from the beginning. 66 // from the beginning.
67 // 67 //
68 // Implementations may elect to preserve more frames than the one requested 68 // Implementations may elect to preserve more frames than the one requested
69 // here if doing so is likely to save CPU time in the future, but will pay 69 // here if doing so is likely to save CPU time in the future, but will pay
70 // an increased memory cost to do so. 70 // an increased memory cost to do so.
71 // 71 //
72 // Returns the number of bytes of frame data actually cleared. 72 // Returns the number of bytes of frame data actually cleared.
73 size_t ClearCacheExceptFrame(size_t); 73 size_t ClearCacheExceptFrame(size_t);
74 74
75 PassRefPtr<SharedBuffer> Data();
76 // Returns false when the decoder layer rejects the data. 75 // Returns false when the decoder layer rejects the data.
77 bool SetData(RefPtr<SharedBuffer> data, bool all_data_received); 76 bool SetData(RefPtr<SharedBuffer> data, bool all_data_received);
78 String FilenameExtension() const; 77 String FilenameExtension() const;
79 78
80 bool IsSizeAvailable(); 79 bool IsSizeAvailable();
81 bool HasColorProfile() const; 80 bool HasColorProfile() const;
82 IntSize size( 81 IntSize size(
83 RespectImageOrientationEnum = kDoNotRespectImageOrientation) const; 82 RespectImageOrientationEnum = kDoNotRespectImageOrientation) const;
84 IntSize FrameSizeAtIndex( 83 IntSize FrameSizeAtIndex(
85 size_t, 84 size_t,
(...skipping 19 matching lines...) Expand all
105 size_t FrameBytesAtIndex(size_t) const; 104 size_t FrameBytesAtIndex(size_t) const;
106 105
107 private: 106 private:
108 std::unique_ptr<DeferredImageDecoder> decoder_; 107 std::unique_ptr<DeferredImageDecoder> decoder_;
109 bool all_data_received_ = false; 108 bool all_data_received_ = false;
110 }; 109 };
111 110
112 } // namespace blink 111 } // namespace blink
113 112
114 #endif 113 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698