refactor: WebContents::From returns pointer (#24605)

This commit is contained in:
Jeremy Rose 2020-07-16 16:16:05 -07:00 committed by GitHub
parent 14bbc07f1e
commit 45551f6bf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 48 additions and 63 deletions

View file

@ -154,9 +154,10 @@ class WebContents : public gin_helper::TrackableObject<WebContents>,
std::unique_ptr<content::WebContents> web_contents,
Type type);
// Get the V8 wrapper of |web_content|, return empty handle if not wrapped.
static gin::Handle<WebContents> From(v8::Isolate* isolate,
content::WebContents* web_content);
// Get the api::WebContents associated with |web_contents|. Returns nullptr
// if there is no associated wrapper.
static WebContents* From(content::WebContents* web_contents);
static WebContents* FromID(int32_t id);
// Get the V8 wrapper of the |web_contents|, or create one if not existed.
//