summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--JavaScriptCore/profiler/Profile.cpp20
-rw-r--r--WebCore/Android.mk3
-rw-r--r--WebCore/platform/network/android/ResourceHandleAndroid.cpp8
-rw-r--r--WebCore/platform/network/android/ResourceRequestAndroid.cpp39
4 files changed, 41 insertions, 29 deletions
diff --git a/JavaScriptCore/profiler/Profile.cpp b/JavaScriptCore/profiler/Profile.cpp
index 0a290ce..de75e71 100644
--- a/JavaScriptCore/profiler/Profile.cpp
+++ b/JavaScriptCore/profiler/Profile.cpp
@@ -29,13 +29,6 @@
#include "ProfileNode.h"
#include <stdio.h>
-#if PLATFORM(ANDROID)
-typedef bool (* Comparator)(const void*, const void*);
-namespace std {
-extern void sort(const void** start, const void** end, Comparator comp);
-}
-#endif
-
namespace JSC {
PassRefPtr<Profile> Profile::create(const UString& title, unsigned uid)
@@ -115,15 +108,6 @@ void Profile::debugPrintData() const
typedef pair<UString::Rep*, unsigned> NameCountPair;
-#if PLATFORM(ANDROID)
-typedef bool (* NameCountPairComparator)(const NameCountPair&, const NameCountPair&);
-
-inline void _sort(NameCountPair* start, NameCountPair* end, NameCountPairComparator comp)
-{
- std::sort((const void**) start, (const void**) end, (Comparator) comp);
-}
-#endif
-
static inline bool functionNameCountPairComparator(const NameCountPair& a, const NameCountPair& b)
{
return a.second > b.second;
@@ -141,11 +125,7 @@ void Profile::debugPrintDataSampleStyle() const
NameCountPairVector sortedFunctions(countedFunctions.size());
copyToVector(countedFunctions, sortedFunctions);
-#if PLATFORM(ANDROID)
- _sort(sortedFunctions.begin(), sortedFunctions.end(), functionNameCountPairComparator);
-#else
std::sort(sortedFunctions.begin(), sortedFunctions.end(), functionNameCountPairComparator);
-#endif
for (NameCountPairVector::iterator it = sortedFunctions.begin(); it != sortedFunctions.end(); ++it)
printf(" %-12d%s\n", (*it).second, UString((*it).first).UTF8String().c_str());
diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index 3bf593c..6d3c4b0 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -527,8 +527,9 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
platform/network/SocketStreamHandleBase.cpp \
\
platform/network/android/Cookie.cpp \
- platform/network/android/ResourceHandleAndroid.cpp \
platform/network/android/NetworkStateNotifierAndroid.cpp \
+ platform/network/android/ResourceHandleAndroid.cpp \
+ platform/network/android/ResourceRequestAndroid.cpp \
\
platform/posix/FileSystemPOSIX.cpp \
\
diff --git a/WebCore/platform/network/android/ResourceHandleAndroid.cpp b/WebCore/platform/network/android/ResourceHandleAndroid.cpp
index 27df7bf..15b369a 100644
--- a/WebCore/platform/network/android/ResourceHandleAndroid.cpp
+++ b/WebCore/platform/network/android/ResourceHandleAndroid.cpp
@@ -150,12 +150,4 @@ void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request,
client->webFrame()->startLoadingResource(&h, request, true);
}
-unsigned initializeMaximumHTTPConnectionCountPerHost()
-{
- // This is used by the loader to control the number of parallel load
- // requests. Our java framework has 4 threads that can each pipeline up to
- // 5 requests. Use 20 as a maximum number.
- return 20;
-}
-
} // namespace WebCore
diff --git a/WebCore/platform/network/android/ResourceRequestAndroid.cpp b/WebCore/platform/network/android/ResourceRequestAndroid.cpp
new file mode 100644
index 0000000..7f4bccb
--- /dev/null
+++ b/WebCore/platform/network/android/ResourceRequestAndroid.cpp
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2009, The Android Open Source Project
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT OWNER OR
+ * 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.
+ */
+
+#include "config.h"
+#include "ResourceRequest.h"
+
+namespace WebCore {
+
+unsigned initializeMaximumHTTPConnectionCountPerHost()
+{
+ // This is used by the loader to control the number of parallel load
+ // requests. Our java framework has 4 threads that can each pipeline up to
+ // 5 requests. Use 20 as a maximum number.
+ return 20;
+}
+
+} // namespace WebCore