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

Unified Diff: include/core/SkStream.h

Issue 2339273002: SkFontData to use smart pointers. (Closed)
Patch Set: Also Mac. Created 4 years, 3 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
« no previous file with comments | « no previous file | include/core/SkTypeface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkStream.h
diff --git a/include/core/SkStream.h b/include/core/SkStream.h
index 48ac577070b289a7ef31016b68c302fd32a5f6e8..d77685e5d1378b88f94c1c81842dc9bc8830e401 100644
--- a/include/core/SkStream.h
+++ b/include/core/SkStream.h
@@ -40,11 +40,19 @@ public:
virtual ~SkStream() {}
/**
+ * Attempts to open the specified file as a stream, returns nullptr on failure.
+ */
+
+ static std::unique_ptr<SkStreamAsset> MakeFromFile(const char path[]);
+
+ /**
* Attempts to open the specified file, and return a stream to it (using
* mmap if available). On success, the caller is responsible for deleting.
* On failure, returns NULL.
*/
- static SkStreamAsset* NewFromFile(const char path[]);
+ static SkStreamAsset* NewFromFile(const char path[]) {
reed1 2016/09/15 13:38:49 can we add a guard to deprecate/remove this versio
bungeman-skia 2016/09/15 16:35:47 I don't see anyone else using it, so I think it ca
+ return SkStream::MakeFromFile(path).release();
+ }
/** Reads or skips size number of bytes.
* If buffer == NULL, skip size bytes, return how many were skipped.
« no previous file with comments | « no previous file | include/core/SkTypeface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698