chore: remove unused getWebPreferences method (#30160)

This commit is contained in:
Jeremy Rose 2021-07-19 09:29:23 -07:00 committed by GitHub
parent a3298424b3
commit 612361c4da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 20 deletions

View file

@ -3052,14 +3052,6 @@ std::vector<base::FilePath> WebContents::GetPreloadPaths() const {
return result;
}
v8::Local<v8::Value> WebContents::GetWebPreferences(
v8::Isolate* isolate) const {
auto* web_preferences = WebContentsPreferences::From(web_contents());
if (!web_preferences)
return v8::Null(isolate);
return gin::ConvertToV8(isolate, *web_preferences->preference());
}
v8::Local<v8::Value> WebContents::GetLastWebPreferences(
v8::Isolate* isolate) const {
auto* web_preferences = WebContentsPreferences::From(web_contents());
@ -3719,7 +3711,6 @@ v8::Local<v8::ObjectTemplate> WebContents::FillObjectTemplate(
.SetMethod("getZoomFactor", &WebContents::GetZoomFactor)
.SetMethod("getType", &WebContents::GetType)
.SetMethod("_getPreloadPaths", &WebContents::GetPreloadPaths)
.SetMethod("getWebPreferences", &WebContents::GetWebPreferences)
.SetMethod("getLastWebPreferences", &WebContents::GetLastWebPreferences)
.SetMethod("getOwnerBrowserWindow", &WebContents::GetOwnerBrowserWindow)
.SetMethod("inspectServiceWorker", &WebContents::InspectServiceWorker)

View file

@ -503,16 +503,6 @@ describe('webContents module', () => {
});
});
describe('getWebPreferences() API', () => {
afterEach(closeAllWindows);
it('should not crash when called for devTools webContents', async () => {
const w = new BrowserWindow({ show: false });
w.webContents.openDevTools();
await emittedOnce(w.webContents, 'devtools-opened');
expect(w.webContents.devToolsWebContents!.getWebPreferences()).to.be.null();
});
});
describe('openDevTools() API', () => {
afterEach(closeAllWindows);
it('can show window with activation', async () => {

View file

@ -57,7 +57,6 @@ declare namespace Electron {
interface WebContents {
_loadURL(url: string, options: ElectronInternal.LoadURLOptions): void;
getOwnerBrowserWindow(): Electron.BrowserWindow;
getWebPreferences(): Electron.WebPreferences;
getLastWebPreferences(): Electron.WebPreferences;
_getPreloadPaths(): string[];
equal(other: WebContents): boolean;