// Remember the protocol module object.
v8::Persistent<v8::Object> g_protocol_object;
+// Registered protocol handlers.
typedef std::map<std::string, v8::Persistent<v8::Function>> HandlersMap;
static HandlersMap g_handlers;
*v8::String::Utf8Value(args[0])));
}
+// static
+v8::Handle<v8::Value> Protocol::InterceptProtocol(const v8::Arguments& args) {
+ return v8::Undefined();
+}
+
+// static
+v8::Handle<v8::Value> Protocol::UninterceptProtocol(const v8::Arguments& args) {
+ return v8::Undefined();
+}
+
// static
void Protocol::RegisterProtocolInIO(const std::string& scheme) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
scheme));
}
+// static
+void Protocol::InterceptProtocolInIO(const std::string& scheme) {
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
+ net::URLRequestJobFactoryImpl* job_factory(GetRequestJobFactory());
+ job_factory->SetProtocolHandler(scheme, new AdapterProtocolHandler);
+}
+
+// static
+void Protocol::UninterceptProtocolInIO(const std::string& scheme) {
+}
+
// static
void Protocol::Initialize(v8::Handle<v8::Object> target) {
g_protocol_object = v8::Persistent<v8::Object>::New(
static v8::Handle<v8::Value> UnregisterProtocol(const v8::Arguments& args);
static v8::Handle<v8::Value> IsHandledProtocol(const v8::Arguments& args);
+ static v8::Handle<v8::Value> InterceptProtocol(const v8::Arguments& args);
+ static v8::Handle<v8::Value> UninterceptProtocol(const v8::Arguments& args);
+
static void RegisterProtocolInIO(const std::string& scheme);
static void UnregisterProtocolInIO(const std::string& scheme);
+ static void InterceptProtocolInIO(const std::string& scheme);
+ static void UninterceptProtocolInIO(const std::string& scheme);
+
DISALLOW_IMPLICIT_CONSTRUCTORS(Protocol);
};