Remove base::StringValue

https://codereview.chromium.org/2664753002
This commit is contained in:
Aleksei Kuzmin 2017-06-16 23:50:03 +03:00
parent fb7bd8f11e
commit a20f633272
4 changed files with 15 additions and 15 deletions

View file

@ -300,7 +300,7 @@ void CommonWebContentsDelegate::DevToolsSaveToFile(
settings.title = url;
settings.default_path = base::FilePath::FromUTF8Unsafe(url);
if (!file_dialog::ShowSaveDialog(settings, &path)) {
base::StringValue url_value(url);
base::Value url_value(url);
web_contents_->CallClientFunction(
"DevToolsAPI.canceledSaveURL", &url_value, nullptr, nullptr);
return;
@ -404,7 +404,7 @@ void CommonWebContentsDelegate::DevToolsRemoveFileSystem(
DictionaryPrefUpdate update(pref_service, prefs::kDevToolsFileSystemPaths);
update.Get()->RemoveWithoutPathExpansion(path, nullptr);
base::StringValue file_system_path_value(path);
base::Value file_system_path_value(path);
web_contents_->CallClientFunction("DevToolsAPI.fileSystemRemoved",
&file_system_path_value,
nullptr, nullptr);
@ -468,7 +468,7 @@ void CommonWebContentsDelegate::DevToolsSearchInPath(
void CommonWebContentsDelegate::OnDevToolsSaveToFile(
const std::string& url) {
// Notify DevTools.
base::StringValue url_value(url);
base::Value url_value(url);
web_contents_->CallClientFunction(
"DevToolsAPI.savedURL", &url_value, nullptr, nullptr);
}
@ -476,7 +476,7 @@ void CommonWebContentsDelegate::OnDevToolsSaveToFile(
void CommonWebContentsDelegate::OnDevToolsAppendToFile(
const std::string& url) {
// Notify DevTools.
base::StringValue url_value(url);
base::Value url_value(url);
web_contents_->CallClientFunction(
"DevToolsAPI.appendedToURL", &url_value, nullptr, nullptr);
}
@ -486,7 +486,7 @@ void CommonWebContentsDelegate::OnDevToolsIndexingWorkCalculated(
const std::string& file_system_path,
int total_work) {
base::Value request_id_value(request_id);
base::StringValue file_system_path_value(file_system_path);
base::Value file_system_path_value(file_system_path);
base::Value total_work_value(total_work);
web_contents_->CallClientFunction("DevToolsAPI.indexingTotalWorkCalculated",
&request_id_value,
@ -499,7 +499,7 @@ void CommonWebContentsDelegate::OnDevToolsIndexingWorked(
const std::string& file_system_path,
int worked) {
base::Value request_id_value(request_id);
base::StringValue file_system_path_value(file_system_path);
base::Value file_system_path_value(file_system_path);
base::Value worked_value(worked);
web_contents_->CallClientFunction("DevToolsAPI.indexingWorked",
&request_id_value,
@ -512,7 +512,7 @@ void CommonWebContentsDelegate::OnDevToolsIndexingDone(
const std::string& file_system_path) {
devtools_indexing_jobs_.erase(request_id);
base::Value request_id_value(request_id);
base::StringValue file_system_path_value(file_system_path);
base::Value file_system_path_value(file_system_path);
web_contents_->CallClientFunction("DevToolsAPI.indexingDone",
&request_id_value,
&file_system_path_value,
@ -528,7 +528,7 @@ void CommonWebContentsDelegate::OnDevToolsSearchCompleted(
file_paths_value.AppendString(file_path);
}
base::Value request_id_value(request_id);
base::StringValue file_system_path_value(file_system_path);
base::Value file_system_path_value(file_system_path);
web_contents_->CallClientFunction("DevToolsAPI.searchCompleted",
&request_id_value,
&file_system_path_value,

View file

@ -209,7 +209,7 @@ void PdfViewerHandler::OnZoomLevelChanged(content::WebContents* web_contents,
double level, bool is_temporary) {
if (web_ui()->GetWebContents() == web_contents) {
CallJavascriptFunction("cr.webUIListenerCallback",
base::StringValue("onZoomLevelChanged"),
base::Value("onZoomLevelChanged"),
base::Value(content::ZoomLevelToZoomFactor(level)));
}
}

View file

@ -324,7 +324,7 @@ base::Value* V8ValueConverter::FromV8ValueImpl(
if (val->IsString()) {
v8::String::Utf8Value utf8(val->ToString());
return new base::StringValue(std::string(*utf8, utf8.length()));
return new base::Value(std::string(*utf8, utf8.length()));
}
if (val->IsUndefined())
@ -340,7 +340,7 @@ base::Value* V8ValueConverter::FromV8ValueImpl(
toISOString.As<v8::Function>()->Call(val, 0, nullptr);
if (!result.IsEmpty()) {
v8::String::Utf8Value utf8(result->ToString());
return new base::StringValue(std::string(*utf8, utf8.length()));
return new base::Value(std::string(*utf8, utf8.length()));
}
}
}
@ -349,7 +349,7 @@ base::Value* V8ValueConverter::FromV8ValueImpl(
if (!reg_exp_allowed_)
// JSON.stringify converts to an object.
return FromV8Object(val->ToObject(), state, isolate);
return new base::StringValue(*v8::String::Utf8Value(val->ToString()));
return new base::Value(*v8::String::Utf8Value(val->ToString()));
}
// v8::Value doesn't have a ToArray() method for some reason.

View file

@ -167,8 +167,8 @@ int ResponseWriter::Write(net::IOBuffer* buffer,
int num_bytes,
const net::CompletionCallback& callback) {
auto* id = new base::Value(stream_id_);
base::StringValue* chunk =
new base::StringValue(std::string(buffer->data(), num_bytes));
base::Value* chunk =
new base::Value(std::string(buffer->data(), num_bytes));
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
@ -634,7 +634,7 @@ void InspectableWebContentsImpl::DispatchProtocolMessage(
base::Value total_size(static_cast<int>(message.length()));
for (size_t pos = 0; pos < message.length(); pos += kMaxMessageChunkSize) {
base::StringValue message_value(message.substr(pos, kMaxMessageChunkSize));
base::Value message_value(message.substr(pos, kMaxMessageChunkSize));
CallClientFunction("DevToolsAPI.dispatchMessageChunk",
&message_value, pos ? nullptr : &total_size, nullptr);
}