2757472: Reland "Reland "[LSC] Remove base::string16 alias""

2757472
This commit is contained in:
John Kleinschmidt 2021-03-16 12:18:45 -04:00
parent 86d23cee40
commit 22d8f22cfb
100 changed files with 417 additions and 417 deletions

View file

@ -114,7 +114,7 @@ content::RenderFrame* GetRenderFrame(v8::Local<v8::Value> value) {
bool SpellCheckWord(v8::Isolate* isolate,
v8::Local<v8::Value> window,
const std::string& word,
std::vector<base::string16>* optional_suggestions) {
std::vector<std::u16string>* optional_suggestions) {
size_t start;
size_t length;
@ -123,7 +123,7 @@ bool SpellCheckWord(v8::Isolate* isolate,
if (!render_frame)
return true;
base::string16 w = base::UTF8ToUTF16(word);
std::u16string w = base::UTF8ToUTF16(word);
int id = render_frame->GetRoutingID();
return client->GetSpellCheck()->SpellCheckWord(
w.c_str(), 0, word.size(), id, &start, &length, optional_suggestions);
@ -576,7 +576,7 @@ void InsertText(gin_helper::ErrorThrower thrower,
}
}
base::string16 InsertCSS(v8::Local<v8::Value> window,
std::u16string InsertCSS(v8::Local<v8::Value> window,
const std::string& css,
gin_helper::Arguments* args) {
blink::WebDocument::CSSOrigin css_origin =
@ -591,7 +591,7 @@ base::string16 InsertCSS(v8::Local<v8::Value> window,
args->ThrowError(
"Render frame was torn down before webFrame.insertCSS could be "
"executed");
return base::string16();
return std::u16string();
}
blink::WebFrame* web_frame = render_frame->GetWebFrame();
@ -601,12 +601,12 @@ base::string16 InsertCSS(v8::Local<v8::Value> window,
.InsertStyleSheet(blink::WebString::FromUTF8(css), nullptr, css_origin)
.Utf16();
}
return base::string16();
return std::u16string();
}
void RemoveInsertedCSS(gin_helper::ErrorThrower thrower,
v8::Local<v8::Value> window,
const base::string16& key) {
const std::u16string& key) {
auto* render_frame = GetRenderFrame(window);
if (!render_frame) {
thrower.ThrowError(
@ -624,7 +624,7 @@ void RemoveInsertedCSS(gin_helper::ErrorThrower thrower,
v8::Local<v8::Promise> ExecuteJavaScript(gin_helper::Arguments* args,
v8::Local<v8::Value> window,
const base::string16& code) {
const std::u16string& code) {
v8::Isolate* isolate = args->isolate();
gin_helper::Promise<v8::Local<v8::Value>> promise(isolate);
v8::Local<v8::Promise> handle = promise.GetHandle();
@ -685,8 +685,8 @@ v8::Local<v8::Promise> ExecuteJavaScriptInIsolatedWorld(
std::vector<blink::WebScriptSource> sources;
for (const auto& script : scripts) {
base::string16 code;
base::string16 url;
std::u16string code;
std::u16string url;
int start_line = 1;
script.Get("url", &url);
script.Get("startLine", &start_line);
@ -766,10 +766,10 @@ bool IsWordMisspelled(v8::Isolate* isolate,
return !SpellCheckWord(isolate, window, word, nullptr);
}
std::vector<base::string16> GetWordSuggestions(v8::Isolate* isolate,
std::vector<std::u16string> GetWordSuggestions(v8::Isolate* isolate,
v8::Local<v8::Value> window,
const std::string& word) {
std::vector<base::string16> suggestions;
std::vector<std::u16string> suggestions;
SpellCheckWord(isolate, window, word, &suggestions);
return suggestions;
}