build: fix build with enable_builtin_spellchecker=false (#26466)

This commit is contained in:
Milan Burda 2020-11-14 01:18:16 +01:00 committed by GitHub
parent e017d8714e
commit 434f7749db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,6 +106,8 @@ content::RenderFrame* GetRenderFrame(v8::Local<v8::Value> value) {
return content::RenderFrame::FromWebFrame(frame); return content::RenderFrame::FromWebFrame(frame);
} }
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
bool SpellCheckWord(v8::Isolate* isolate, bool SpellCheckWord(v8::Isolate* isolate,
v8::Local<v8::Value> window, v8::Local<v8::Value> window,
const std::string& word, const std::string& word,
@ -124,6 +126,8 @@ bool SpellCheckWord(v8::Isolate* isolate,
w.c_str(), 0, word.size(), id, &start, &length, optional_suggestions); w.c_str(), 0, word.size(), id, &start, &length, optional_suggestions);
} }
#endif
class RenderFrameStatus final : public content::RenderFrameObserver { class RenderFrameStatus final : public content::RenderFrameObserver {
public: public:
explicit RenderFrameStatus(content::RenderFrame* render_frame) explicit RenderFrameStatus(content::RenderFrame* render_frame)
@ -753,6 +757,8 @@ blink::WebCacheResourceTypeStats GetResourceUsage(v8::Isolate* isolate) {
return stats; return stats;
} }
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
bool IsWordMisspelled(v8::Isolate* isolate, bool IsWordMisspelled(v8::Isolate* isolate,
v8::Local<v8::Value> window, v8::Local<v8::Value> window,
const std::string& word) { const std::string& word) {
@ -767,6 +773,8 @@ std::vector<base::string16> GetWordSuggestions(v8::Isolate* isolate,
return suggestions; return suggestions;
} }
#endif
void ClearCache(v8::Isolate* isolate) { void ClearCache(v8::Isolate* isolate) {
isolate->IdleNotificationDeadline(0.5); isolate->IdleNotificationDeadline(0.5);
blink::WebCache::Clear(); blink::WebCache::Clear();