2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-04-16 20:00:20 +00:00
|
|
|
|
|
|
|
#ifndef nsViewSourceHandler_h___
|
|
|
|
#define nsViewSourceHandler_h___
|
|
|
|
|
|
|
|
#include "nsIProtocolHandler.h"
|
2016-01-09 01:20:50 +00:00
|
|
|
#include "nsNetUtil.h"
|
2012-06-06 03:18:25 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2001-04-16 20:00:20 +00:00
|
|
|
|
2016-03-04 16:54:07 +00:00
|
|
|
class nsILoadInfo;
|
2016-01-09 01:20:50 +00:00
|
|
|
|
2016-05-19 02:02:57 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
class nsViewSourceHandler final : public nsIProtocolHandler
|
2001-04-16 20:00:20 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIPROTOCOLHANDLER
|
2013-06-29 03:04:42 +00:00
|
|
|
|
|
|
|
nsViewSourceHandler();
|
|
|
|
|
|
|
|
// Creates a new nsViewSourceChannel to view the source of an about:srcdoc
|
|
|
|
// URI with contents specified by srcdoc.
|
2016-11-23 09:21:17 +00:00
|
|
|
MOZ_MUST_USE nsresult NewSrcdocChannel(nsIURI *aURI,
|
|
|
|
nsIURI *aBaseURI,
|
|
|
|
const nsAString &aSrcdoc,
|
|
|
|
nsILoadInfo *aLoadInfo,
|
|
|
|
nsIChannel** outChannel);
|
2013-06-29 03:04:42 +00:00
|
|
|
|
|
|
|
static nsViewSourceHandler* GetInstance();
|
|
|
|
|
|
|
|
private:
|
2014-06-24 16:36:44 +00:00
|
|
|
~nsViewSourceHandler();
|
2013-06-29 03:04:42 +00:00
|
|
|
|
2014-06-24 16:36:44 +00:00
|
|
|
static nsViewSourceHandler* gInstance;
|
2001-04-16 20:00:20 +00:00
|
|
|
};
|
|
|
|
|
2016-05-19 02:02:57 +00:00
|
|
|
} // namespace net
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2004-07-01 23:45:34 +00:00
|
|
|
#endif /* !defined( nsViewSourceHandler_h___ ) */
|