refactor: remove ToV8(isolate, const char*) (#46108)
This commit is contained in:
parent
86cc9f626f
commit
c4800d9934
3 changed files with 7 additions and 13 deletions
|
@ -459,11 +459,14 @@ std::vector<content::RenderFrameHost*> WebFrameMain::FramesInSubtree() const {
|
||||||
return frame_hosts;
|
return frame_hosts;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* WebFrameMain::LifecycleStateForTesting() const {
|
std::string_view WebFrameMain::LifecycleStateForTesting() const {
|
||||||
if (!HasRenderFrame())
|
if (!HasRenderFrame())
|
||||||
return {};
|
return {};
|
||||||
return content::RenderFrameHostImpl::LifecycleStateImplToString(
|
if (const char* str =
|
||||||
GetLifecycleState(render_frame_host()));
|
content::RenderFrameHostImpl::LifecycleStateImplToString(
|
||||||
|
GetLifecycleState(render_frame_host())))
|
||||||
|
return str;
|
||||||
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
v8::Local<v8::Promise> WebFrameMain::CollectDocumentJSCallStack(
|
v8::Local<v8::Promise> WebFrameMain::CollectDocumentJSCallStack(
|
||||||
|
|
|
@ -136,7 +136,7 @@ class WebFrameMain final : public gin::Wrappable<WebFrameMain>,
|
||||||
std::vector<content::RenderFrameHost*> Frames() const;
|
std::vector<content::RenderFrameHost*> Frames() const;
|
||||||
std::vector<content::RenderFrameHost*> FramesInSubtree() const;
|
std::vector<content::RenderFrameHost*> FramesInSubtree() const;
|
||||||
|
|
||||||
const char* LifecycleStateForTesting() const;
|
std::string_view LifecycleStateForTesting() const;
|
||||||
|
|
||||||
v8::Local<v8::Promise> CollectDocumentJSCallStack(gin::Arguments* args);
|
v8::Local<v8::Promise> CollectDocumentJSCallStack(gin::Arguments* args);
|
||||||
void CollectedJavaScriptCallStack(
|
void CollectedJavaScriptCallStack(
|
||||||
|
|
|
@ -61,15 +61,6 @@ struct Converter<char[N]> {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
|
||||||
struct Converter<const char*> {
|
|
||||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, const char* val) {
|
|
||||||
return v8::String::NewFromUtf8(isolate, val ? val : "",
|
|
||||||
v8::NewStringType::kNormal)
|
|
||||||
.ToLocalChecked();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct Converter<v8::Local<v8::Array>> {
|
struct Converter<v8::Local<v8::Array>> {
|
||||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue