remove webFrame.registerURLSchemeAsSecure() deprecation

This commit is contained in:
Shelley Vohr 2018-05-23 09:33:57 -07:00
parent 4a90056462
commit 94e825378c
No known key found for this signature in database
GPG key ID: F13993A75599653C
4 changed files with 3 additions and 31 deletions

View file

@ -206,12 +206,6 @@ void WebFrame::SetSpellCheckProvider(mate::Arguments* args,
web_frame_->SetSpellCheckPanelHostClient(spell_check_client_.get()); web_frame_->SetSpellCheckPanelHostClient(spell_check_client_.get());
} }
void WebFrame::RegisterURLSchemeAsSecure(const std::string& scheme) {
// TODO(pfrazee): Remove 2.0
blink::SchemeRegistry::RegisterURLSchemeAsSecure(
WTF::String::FromUTF8(scheme.data(), scheme.length()));
}
void WebFrame::RegisterURLSchemeAsBypassingCSP(const std::string& scheme) { void WebFrame::RegisterURLSchemeAsBypassingCSP(const std::string& scheme) {
// Register scheme to bypass pages's Content Security Policy. // Register scheme to bypass pages's Content Security Policy.
blink::SchemeRegistry::RegisterURLSchemeAsBypassingContentSecurityPolicy( blink::SchemeRegistry::RegisterURLSchemeAsBypassingContentSecurityPolicy(
@ -243,10 +237,6 @@ void WebFrame::RegisterURLSchemeAsPrivileged(const std::string& scheme,
// Register scheme to privileged list (https, wss, data, chrome-extension) // Register scheme to privileged list (https, wss, data, chrome-extension)
WTF::String privileged_scheme( WTF::String privileged_scheme(
WTF::String::FromUTF8(scheme.data(), scheme.length())); WTF::String::FromUTF8(scheme.data(), scheme.length()));
if (secure) {
// TODO(pfrazee): Remove 2.0
blink::SchemeRegistry::RegisterURLSchemeAsSecure(privileged_scheme);
}
if (bypassCSP) { if (bypassCSP) {
blink::SchemeRegistry::RegisterURLSchemeAsBypassingContentSecurityPolicy( blink::SchemeRegistry::RegisterURLSchemeAsBypassingContentSecurityPolicy(
privileged_scheme); privileged_scheme);
@ -442,13 +432,13 @@ v8::Local<v8::Value> WebFrame::FindFrameByName(const std::string& name) const {
v8::Local<v8::Value> WebFrame::FindFrameByRoutingId(int routing_id) const { v8::Local<v8::Value> WebFrame::FindFrameByRoutingId(int routing_id) const {
content::RenderFrame* render_frame = content::RenderFrame* render_frame =
content::RenderFrame::FromRoutingID(routing_id); content::RenderFrame::FromRoutingID(routing_id);
blink::WebLocalFrame* local_frame = nullptr; blink::WebLocalFrame* local_frame = nullptr;
if (render_frame) if (render_frame)
local_frame = render_frame->GetWebFrame(); local_frame = render_frame->GetWebFrame();
if (local_frame) if (local_frame)
return mate::CreateHandle(isolate(), return mate::CreateHandle(isolate(), new WebFrame(isolate(), local_frame))
new WebFrame(isolate(), local_frame)).ToV8(); .ToV8();
else else
return v8::Null(isolate()); return v8::Null(isolate());
} }
@ -479,8 +469,6 @@ void WebFrame::BuildPrototype(v8::Isolate* isolate,
.SetMethod("attachGuest", &WebFrame::AttachGuest) .SetMethod("attachGuest", &WebFrame::AttachGuest)
.SetMethod("detachGuest", &WebFrame::DetachGuest) .SetMethod("detachGuest", &WebFrame::DetachGuest)
.SetMethod("setSpellCheckProvider", &WebFrame::SetSpellCheckProvider) .SetMethod("setSpellCheckProvider", &WebFrame::SetSpellCheckProvider)
.SetMethod("registerURLSchemeAsSecure",
&WebFrame::RegisterURLSchemeAsSecure)
.SetMethod("registerURLSchemeAsBypassingCSP", .SetMethod("registerURLSchemeAsBypassingCSP",
&WebFrame::RegisterURLSchemeAsBypassingCSP) &WebFrame::RegisterURLSchemeAsBypassingCSP)
.SetMethod("registerURLSchemeAsPrivileged", .SetMethod("registerURLSchemeAsPrivileged",

View file

@ -66,7 +66,6 @@ class WebFrame : public mate::Wrappable<WebFrame> {
bool auto_spell_correct_turned_on, bool auto_spell_correct_turned_on,
v8::Local<v8::Object> provider); v8::Local<v8::Object> provider);
void RegisterURLSchemeAsSecure(const std::string& scheme);
void RegisterURLSchemeAsBypassingCSP(const std::string& scheme); void RegisterURLSchemeAsBypassingCSP(const std::string& scheme);
void RegisterURLSchemeAsPrivileged(const std::string& scheme, void RegisterURLSchemeAsPrivileged(const std::string& scheme,
mate::Arguments* args); mate::Arguments* args);

View file

@ -81,16 +81,6 @@ webFrame.setSpellCheckProvider('en-US', true, {
}) })
``` ```
### `webFrame.registerURLSchemeAsSecure(scheme)`
* `scheme` String
Registers the `scheme` as secure scheme.
Secure schemes do not trigger mixed content warnings. For example, `https` and
`data` are secure schemes because they cannot be corrupted by active network
attackers.
### `webFrame.registerURLSchemeAsBypassingCSP(scheme)` ### `webFrame.registerURLSchemeAsBypassingCSP(scheme)`
* `scheme` String * `scheme` String

View file

@ -43,11 +43,6 @@ ses.setCertificateVerifyProc(function (request, callback) {
## `webFrame` ## `webFrame`
```js ```js
// Deprecated
webFrame.registerURLSchemeAsSecure('app')
// Replace with
protocol.registerStandardSchemes(['app'], {secure: true})
// Deprecated // Deprecated
webFrame.registerURLSchemeAsPrivileged('app', {secure: true}) webFrame.registerURLSchemeAsPrivileged('app', {secure: true})
// Replace with // Replace with