18e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*
2cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * Copyright (C) 2009 Google, Inc.
38e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
48e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Redistribution and use in source and binary forms, with or without
58e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * modification, are permitted provided that the following conditions
68e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * are met:
78e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * 1. Redistributions of source code must retain the above copyright
88e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *    notice, this list of conditions and the following disclaimer.
98e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * 2. Redistributions in binary form must reproduce the above copyright
108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *    notice, this list of conditions and the following disclaimer in the
118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *    documentation and/or other materials provided with the distribution.
128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
13cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
26643ca7872b450ea4efacab6188849e5aac2ba161Steve Block#include "config.h"
27643ca7872b450ea4efacab6188849e5aac2ba161Steve Block#include "ResourceRequest.h"
28643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectnamespace WebCore {
308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
31cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block// This is used by the loader to control the number of issued parallel load requests.
32cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Blockunsigned initializeMaximumHTTPConnectionCountPerHost()
33cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block{
34692e5dbf12901edacf14812a6fae25462920af42Steve Block    // The chromium network stack already handles limiting the number of
35692e5dbf12901edacf14812a6fae25462920af42Steve Block    // parallel requests per host, so there's no need to do it here.  Therefore,
36692e5dbf12901edacf14812a6fae25462920af42Steve Block    // this is set to a high value that should never be hit in practice.
37692e5dbf12901edacf14812a6fae25462920af42Steve Block    return 10000;
38cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block}
398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
40a94275402997c11dd2e778633dacf4b7e630a35dBen MurdochPassOwnPtr<CrossThreadResourceRequestData> ResourceRequest::doPlatformCopyData(PassOwnPtr<CrossThreadResourceRequestData> data) const
41a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch{
42a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch    data->m_requestorID = m_requestorID;
43a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch    data->m_requestorProcessID = m_requestorProcessID;
44a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch    data->m_appCacheHostID = m_appCacheHostID;
456b70adc33054f8aee8c54d0f460458a9df11b8a5Russell Brenner    data->m_hasUserGesture = m_hasUserGesture;
462fc2651226baac27029e38c9d6ef883fa32084dbSteve Block    data->m_downloadToFile = m_downloadToFile;
47a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch    return data;
48a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch}
49a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch
50a94275402997c11dd2e778633dacf4b7e630a35dBen Murdochvoid ResourceRequest::doPlatformAdopt(PassOwnPtr<CrossThreadResourceRequestData> data)
51a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch{
52a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch    m_requestorID = data->m_requestorID;
53a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch    m_requestorProcessID = data->m_requestorProcessID;
54a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch    m_appCacheHostID = data->m_appCacheHostID;
556b70adc33054f8aee8c54d0f460458a9df11b8a5Russell Brenner    m_hasUserGesture = data->m_hasUserGesture;
562fc2651226baac27029e38c9d6ef883fa32084dbSteve Block    m_downloadToFile = data->m_downloadToFile;
57a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch}
58a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch
598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project} // namespace WebCore
60