1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2  * vim:set ts=2 sts=2 sw=2 et cin:
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 
8 #include "nsIndexedDBProtocolHandler.h"
9 
10 #include "nsStandardURL.h"
11 
12 using namespace mozilla::net;
13 
14 nsIndexedDBProtocolHandler::nsIndexedDBProtocolHandler() = default;
15 
16 nsIndexedDBProtocolHandler::~nsIndexedDBProtocolHandler() = default;
17 
NS_IMPL_ISUPPORTS(nsIndexedDBProtocolHandler,nsIProtocolHandler,nsISupportsWeakReference)18 NS_IMPL_ISUPPORTS(nsIndexedDBProtocolHandler, nsIProtocolHandler,
19                   nsISupportsWeakReference)
20 
21 NS_IMETHODIMP nsIndexedDBProtocolHandler::GetScheme(nsACString& aScheme) {
22   aScheme.AssignLiteral("indexeddb");
23   return NS_OK;
24 }
25 
GetDefaultPort(int32_t * aDefaultPort)26 NS_IMETHODIMP nsIndexedDBProtocolHandler::GetDefaultPort(
27     int32_t* aDefaultPort) {
28   *aDefaultPort = -1;
29   return NS_OK;
30 }
31 
GetProtocolFlags(uint32_t * aProtocolFlags)32 NS_IMETHODIMP nsIndexedDBProtocolHandler::GetProtocolFlags(
33     uint32_t* aProtocolFlags) {
34   *aProtocolFlags = URI_STD | URI_DANGEROUS_TO_LOAD | URI_DOES_NOT_RETURN_DATA |
35                     URI_NON_PERSISTABLE;
36   return NS_OK;
37 }
38 
39 NS_IMETHODIMP
NewChannel(nsIURI * aURI,nsILoadInfo * aLoadInfo,nsIChannel ** _retval)40 nsIndexedDBProtocolHandler::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo,
41                                        nsIChannel** _retval) {
42   return NS_ERROR_NOT_IMPLEMENTED;
43 }
44 
45 NS_IMETHODIMP
AllowPort(int32_t aPort,const char * aScheme,bool * _retval)46 nsIndexedDBProtocolHandler::AllowPort(int32_t aPort, const char* aScheme,
47                                       bool* _retval) {
48   *_retval = false;
49   return NS_OK;
50 }
51