Home | History | Annotate | Download | only in network
      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)
     30 QT_BEGIN_NAMESPACE
     31 class QObject;
     32 class QNetworkAccessManager;
     33 QT_END_NAMESPACE
     34 #endif
     35 
     36 namespace WebCore {
     37 
     38 #if PLATFORM(ANDROID)
     39 class FrameLoaderClient;
     40 class MainResourceLoader;
     41 #endif
     42 class ResourceError;
     43 class ResourceRequest;
     44 
     45 class NetworkingContext : public RefCounted<NetworkingContext> {
     46 public:
     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 
     75 protected:
     76     NetworkingContext() { }
     77 };
     78 
     79 }
     80 
     81 #endif // NetworkingContext_h
     82