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

Unified Diff: components/font_service/font_service_app.cc

Issue 1711483004: Replace use of SkTDArray with std::vector in font code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « components/font_service/font_service_app.h ('k') | content/browser/renderer_host/sandbox_ipc_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/font_service/font_service_app.cc
diff --git a/components/font_service/font_service_app.cc b/components/font_service/font_service_app.cc
index 637410e404373405a6d71021bba34e4bfbb77175..1be90543ce48dd27536e0e9a7ee22c8322e8003d 100644
--- a/components/font_service/font_service_app.cc
+++ b/components/font_service/font_service_app.cc
@@ -106,20 +106,20 @@ void FontServiceApp::MatchFamilyName(const mojo::String& family_name,
void FontServiceApp::OpenStream(uint32_t id_number,
const OpenStreamCallback& callback) {
mojo::ScopedHandle handle;
- if (id_number < static_cast<uint32_t>(paths_.count())) {
- handle = GetHandleForPath(base::FilePath(paths_[id_number]->c_str()));
+ if (id_number < static_cast<uint32_t>(paths_.size())) {
+ handle = GetHandleForPath(base::FilePath(paths_[id_number].c_str()));
}
callback.Run(std::move(handle));
}
int FontServiceApp::FindOrAddPath(const SkString& path) {
- int count = paths_.count();
+ int count = paths_.size();
for (int i = 0; i < count; ++i) {
- if (path == *paths_[i])
+ if (path == paths_[i])
return i;
}
- *paths_.append() = new SkString(path);
+ paths_.emplace_back(path);
return count;
}
« no previous file with comments | « components/font_service/font_service_app.h ('k') | content/browser/renderer_host/sandbox_ipc_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698