1/* 2 Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 4 This library is free software; you can redistribute it and/or 5 modify it under the terms of the GNU Library General Public 6 License as published by the Free Software Foundation; either 7 version 2 of the License, or (at your option) any later version. 8 9 This library is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 Library General Public License for more details. 13 14 You should have received a copy of the GNU Library General Public License 15 along with this library; see the file COPYING.LIB. If not, write to 16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 Boston, MA 02110-1301, USA. 18*/ 19 20#ifndef NetworkingContext_h 21#define NetworkingContext_h 22 23#include <wtf/RefCounted.h> 24 25#if PLATFORM(MAC) 26#include "SchedulePair.h" 27#endif 28 29#if PLATFORM(QT) 30QT_BEGIN_NAMESPACE 31class QObject; 32class QNetworkAccessManager; 33QT_END_NAMESPACE 34#endif 35 36namespace WebCore { 37 38#if PLATFORM(ANDROID) 39class FrameLoaderClient; 40class MainResourceLoader; 41#endif 42class ResourceError; 43class ResourceRequest; 44 45class NetworkingContext : public RefCounted<NetworkingContext> { 46public: 47 virtual ~NetworkingContext() { } 48 49 virtual bool isValid() const { return true; } 50 51#if PLATFORM(MAC) 52 virtual bool needsSiteSpecificQuirks() const = 0; 53 virtual bool localFileContentSniffingEnabled() const = 0; 54 virtual SchedulePairHashSet* scheduledRunLoopPairs() const = 0; 55 virtual ResourceError blockedError(const ResourceRequest&) const = 0; 56#endif 57 58#if PLATFORM(QT) 59 virtual QObject* originatingObject() const = 0; 60 virtual QNetworkAccessManager* networkAccessManager() const = 0; 61 virtual bool mimeSniffingEnabled() const = 0; 62#endif 63 64#if PLATFORM(WIN) 65 virtual String userAgent() const = 0; 66 virtual String referrer() const = 0; 67 virtual ResourceError blockedError(const ResourceRequest&) const = 0; 68#endif 69 70#if PLATFORM(ANDROID) 71 virtual MainResourceLoader* mainResourceLoader() const = 0; 72 virtual FrameLoaderClient* frameLoaderClient() const = 0; 73#endif 74 75protected: 76 NetworkingContext() { } 77}; 78 79} 80 81#endif // NetworkingContext_h 82