return v8::Undefined();
}
+// static
+v8::Handle<v8::Value> Protocol::IsHandledProtocol(const v8::Arguments& args) {
+ return v8::Boolean::New(net::URLRequest::IsHandledProtocol(
+ *v8::String::Utf8Value(args[0])));
+}
+
// static
void Protocol::RegisterProtocolInIO(const std::string& scheme) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
void Protocol::Initialize(v8::Handle<v8::Object> target) {
node::SetMethod(target, "registerProtocol", RegisterProtocol);
node::SetMethod(target, "unregisterProtocol", UnregisterProtocol);
+ node::SetMethod(target, "isHandledProtocol", IsHandledProtocol);
}
} // namespace api
private:
static v8::Handle<v8::Value> RegisterProtocol(const v8::Arguments& args);
static v8::Handle<v8::Value> UnregisterProtocol(const v8::Arguments& args);
+ static v8::Handle<v8::Value> IsHandledProtocol(const v8::Arguments& args);
static void RegisterProtocolInIO(const std::string& scheme);
static void UnregisterProtocolInIO(const std::string& scheme);