refactor: only create webContents after 'will-attach-webview' (#32941)
This commit is contained in:
parent
7ae3025fd5
commit
d4e97483aa
9 changed files with 21 additions and 84 deletions
|
@ -28,10 +28,6 @@ void AddGuest(int guest_instance_id,
|
|||
electron::WebContentsZoomController::FromWebContents(guest_web_contents)
|
||||
->SetDefaultZoomFactor(zoom_factor);
|
||||
}
|
||||
|
||||
WebContentsPreferences::From(guest_web_contents)->Merge(options);
|
||||
// Trigger re-calculation of webkit prefs.
|
||||
guest_web_contents->NotifyPreferencesChanged();
|
||||
}
|
||||
|
||||
void RemoveGuest(content::WebContents* embedder, int guest_instance_id) {
|
||||
|
|
|
@ -176,11 +176,7 @@ void WebContentsPreferences::Clear() {
|
|||
void WebContentsPreferences::SetFromDictionary(
|
||||
const gin_helper::Dictionary& web_preferences) {
|
||||
Clear();
|
||||
Merge(web_preferences);
|
||||
}
|
||||
|
||||
void WebContentsPreferences::Merge(
|
||||
const gin_helper::Dictionary& web_preferences) {
|
||||
web_preferences.Get(options::kPlugins, &plugins_);
|
||||
web_preferences.Get(options::kExperimentalFeatures, &experimental_features_);
|
||||
web_preferences.Get(options::kNodeIntegration, &node_integration_);
|
||||
|
|
|
@ -40,8 +40,6 @@ class WebContentsPreferences
|
|||
WebContentsPreferences(const WebContentsPreferences&) = delete;
|
||||
WebContentsPreferences& operator=(const WebContentsPreferences&) = delete;
|
||||
|
||||
void Merge(const gin_helper::Dictionary& new_web_preferences);
|
||||
|
||||
void SetFromDictionary(const gin_helper::Dictionary& new_web_preferences);
|
||||
|
||||
// Append command parameters according to preferences.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue