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

Unified Diff: content/test/dwrite_font_fake_sender_win.h

Issue 2153343002: Implement support for loading font files from outside system directory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add some more comments Created 4 years, 5 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: content/test/dwrite_font_fake_sender_win.h
diff --git a/content/test/dwrite_font_fake_sender_win.h b/content/test/dwrite_font_fake_sender_win.h
index 84363cb1ca863f59ba6083d0c1eeff0c4eb0196f..6dd9390cb46aea6a25b3c813a49513392aa07d9a 100644
--- a/content/test/dwrite_font_fake_sender_win.h
+++ b/content/test/dwrite_font_fake_sender_win.h
@@ -17,6 +17,7 @@
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
#include "ipc/ipc_message.h"
+#include "ipc/ipc_platform_file.h"
#include "ipc/ipc_sender.h"
struct DWriteFontStyle;
@@ -44,6 +45,11 @@ class FakeFont {
return *this;
}
+ FakeFont& AddFileHandle(IPC::PlatformFileForTransit handle) {
+ file_handles_.push_back(handle);
+ return *this;
+ }
+
FakeFont& AddFamilyName(const base::string16& locale,
const base::string16& family_name) {
family_names_.emplace_back(locale, family_name);
@@ -56,6 +62,7 @@ class FakeFont {
friend FakeFontCollection;
base::string16 font_name_;
std::vector<base::string16> file_paths_;
+ std::vector<IPC::PlatformFileForTransit> file_handles_;
std::vector<std::pair<base::string16, base::string16>> family_names_;
DISALLOW_ASSIGN(FakeFont);
@@ -117,7 +124,8 @@ class FakeFontCollection : public base::RefCounted<FakeFontCollection> {
uint32_t family_index,
std::vector<std::pair<base::string16, base::string16>>* family_names);
void OnGetFontFiles(uint32_t family_index,
- std::vector<base::string16>* file_paths_);
+ std::vector<base::string16>* file_paths,
+ std::vector<IPC::PlatformFileForTransit>* file_handles);
void OnMapCharacters(const base::string16& text,
const DWriteFontStyle& font_style,
@@ -158,7 +166,8 @@ class FakeFontCollection : public base::RefCounted<FakeFontCollection> {
std::vector<std::pair<base::string16, base::string16>>* family_names);
void OnGetFontFiles(uint32_t family_index,
- std::vector<base::string16>* file_paths);
+ std::vector<base::string16>* file_paths,
+ std::vector<IPC::PlatformFileForTransit>* file_handles);
void OnMapCharacters(const base::string16& text,
const DWriteFontStyle& font_style,

Powered by Google App Engine
This is Rietveld 408576698