Commit 6b05831f authored by ap@apple.com's avatar ap@apple.com

[WK2] Add a NetworkingContext for NetworkProcess

        https://bugs.webkit.org/show_bug.cgi?id=100708

        Reviewed by Anders Carlsson.

        Each request will have a context, because these are so lightweight on Mac, and
        other platforms will need ResourceHandle refactored anyway to use NetworkProcess.

        * NetworkProcess/mac/RemoteNetworkingContext.h: Added.
        * NetworkProcess/mac/RemoteNetworkingContext.mm: Added.
        These go mac/ subdirectory, because NetworkingContext interface is different on
        each platform, as ResourceHandle needs dictate.

        * WebKit2.xcodeproj/project.pbxproj:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132857 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 42738924
2012-10-29 Alexey Proskuryakov <ap@apple.com>
[WK2] Add a NetworkingContext for NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=100708
Reviewed by Anders Carlsson.
Each request will have a context, because these are so lightweight on Mac, and
other platforms will need ResourceHandle refactored anyway to use NetworkProcess.
* NetworkProcess/mac/RemoteNetworkingContext.h: Added.
* NetworkProcess/mac/RemoteNetworkingContext.mm: Added.
These go mac/ subdirectory, because NetworkingContext interface is different on
each platform, as ResourceHandle needs dictate.
* WebKit2.xcodeproj/project.pbxproj:
2012-10-29 Michael Saboff <msaboff@apple.com>
buildHTTPHeaders() should use a StringBuilder.appendLiteral() for separator
......
/*
* Copyright (C) 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef RemoteNetworkingContext_h
#define RemoteNetworkingContext_h
#include <WebCore/NetworkingContext.h>
namespace WebKit {
class RemoteNetworkingContext : public WebCore::NetworkingContext {
public:
virtual ~RemoteNetworkingContext();
private:
virtual bool isValid() const OVERRIDE;
virtual bool needsSiteSpecificQuirks() const OVERRIDE;
virtual bool localFileContentSniffingEnabled() const OVERRIDE;
virtual WebCore::SchedulePairHashSet* scheduledRunLoopPairs() const OVERRIDE;
virtual WebCore::ResourceError blockedError(const WebCore::ResourceRequest&) const OVERRIDE;
bool m_needsSiteSpecificQuirks;
bool m_localFileContentSniffingEnabled;
};
}
#endif // RemoteNetworkingContext_h
/*
* Copyright (C) 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#import "config.h"
#import "RemoteNetworkingContext.h"
#import "WebCore/ResourceError.h"
#import "WebErrors.h"
using namespace WebCore;
namespace WebKit {
RemoteNetworkingContext::~RemoteNetworkingContext()
{
}
bool RemoteNetworkingContext::isValid() const
{
return true;
}
bool RemoteNetworkingContext::needsSiteSpecificQuirks() const
{
return m_needsSiteSpecificQuirks;
}
bool RemoteNetworkingContext::localFileContentSniffingEnabled() const
{
return m_localFileContentSniffingEnabled;
}
SchedulePairHashSet* RemoteNetworkingContext::scheduledRunLoopPairs() const
{
static SchedulePairHashSet* pairs;
if (!pairs) {
pairs = new SchedulePairHashSet;
pairs->add(SchedulePair::create(CFRunLoopGetMain(), kCFRunLoopCommonModes));
}
return pairs;
}
ResourceError RemoteNetworkingContext::blockedError(const ResourceRequest& request) const
{
return WebKit::blockedError(request);
}
}
......@@ -990,6 +990,8 @@
E1A31735134CEA80007C9A4F /* AttributedString.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1A31734134CEA80007C9A4F /* AttributedString.mm */; };
E1AEA22F14687BDB00804569 /* WKFullKeyboardAccessWatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = E1AEA22D14687BDB00804569 /* WKFullKeyboardAccessWatcher.h */; };
E1AEA23014687BDB00804569 /* WKFullKeyboardAccessWatcher.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1AEA22E14687BDB00804569 /* WKFullKeyboardAccessWatcher.mm */; };
E1B78471163F24690007B692 /* RemoteNetworkingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = E1B78470163F24690007B692 /* RemoteNetworkingContext.h */; };
E1B78473163F253E0007B692 /* RemoteNetworkingContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1B78472163F253E0007B692 /* RemoteNetworkingContext.mm */; };
E1CC1B9012D7EADF00625838 /* PrintInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = E1CC1B8E12D7EADF00625838 /* PrintInfo.h */; };
E1CC1B9112D7EADF00625838 /* PrintInfoMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1CC1B8F12D7EADF00625838 /* PrintInfoMac.mm */; };
E1EDFDA61628868E0039ECDA /* MainMacProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FA31011E3921E00DB1371 /* MainMacProcess.cpp */; };
......@@ -2230,6 +2232,8 @@
E1A31734134CEA80007C9A4F /* AttributedString.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AttributedString.mm; sourceTree = "<group>"; };
E1AEA22D14687BDB00804569 /* WKFullKeyboardAccessWatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKFullKeyboardAccessWatcher.h; sourceTree = "<group>"; };
E1AEA22E14687BDB00804569 /* WKFullKeyboardAccessWatcher.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKFullKeyboardAccessWatcher.mm; sourceTree = "<group>"; };
E1B78470163F24690007B692 /* RemoteNetworkingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteNetworkingContext.h; sourceTree = "<group>"; };
E1B78472163F253E0007B692 /* RemoteNetworkingContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteNetworkingContext.mm; sourceTree = "<group>"; };
E1CC1B8E12D7EADF00625838 /* PrintInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrintInfo.h; sourceTree = "<group>"; };
E1CC1B8F12D7EADF00625838 /* PrintInfoMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PrintInfoMac.mm; sourceTree = "<group>"; };
E1EDFD9816287BD10039ECDA /* SharedWorkerProcessMain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SharedWorkerProcessMain.h; sourceTree = "<group>"; };
......@@ -3012,6 +3016,8 @@
51A8A6151627F3F9000D90E9 /* NetworkProcessMac.mm */,
510CC7DD16138E2900D03ED3 /* NetworkProcessMainMac.mm */,
512C068F16390E6900ABB911 /* NetworkResourceLoadSchedulerMac.mm */,
E1B78470163F24690007B692 /* RemoteNetworkingContext.h */,
E1B78472163F253E0007B692 /* RemoteNetworkingContext.mm */,
);
name = mac;
path = NetworkProcess/mac;
......@@ -4788,6 +4794,7 @@
512C06891638F67E00ABB911 /* HostRecord.h in Headers */,
517CF0E0163A444C00C2950E /* NetworkRequest.h in Headers */,
517CF0E4163A486C00C2950E /* NetworkProcessConnectionMessages.h in Headers */,
E1B78471163F24690007B692 /* RemoteNetworkingContext.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -5746,6 +5753,7 @@
51FB08FF1639DE1A00EC324A /* WebResourceLoadScheduler.cpp in Sources */,
517CF0DF163A444C00C2950E /* NetworkRequest.cpp in Sources */,
517CF0E3163A486C00C2950E /* NetworkProcessConnectionMessageReceiver.cpp in Sources */,
E1B78473163F253E0007B692 /* RemoteNetworkingContext.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment