summaryrefslogtreecommitdiffstats
path: root/components/network_hints/common
diff options
context:
space:
mode:
authorpmeenan <pmeenan@chromium.org>2015-02-11 09:08:08 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-11 17:08:46 +0000
commitec1939d34edef32fbda9e2a6d3722749e343f5a8 (patch)
treebd181d1f5ad825f6b3c00e22ac069696b29857ea /components/network_hints/common
parent996f5613ebcc285c4d9504d8df0a5170c61229bd (diff)
downloadchromium_src-ec1939d34edef32fbda9e2a6d3722749e343f5a8.zip
chromium_src-ec1939d34edef32fbda9e2a6d3722749e343f5a8.tar.gz
chromium_src-ec1939d34edef32fbda9e2a6d3722749e343f5a8.tar.bz2
Added chrome-side support for link rel=preconnect
This plumbs the blink preconnect support through to the existing preconnect implementation exposed by the predictor. There was an existing IPC for most of the plumbing that wasn't being used. There was a bit of structural movement: - Moved the IPC definition to the new network_hints component - Renamed the IPC message to fall into a namespace used by network_hints - Renamed the DNS prefetch IPC into the same namespace - Added a connection count to the preconnect IPC And the actual plumbing itself which mirrors the behavior of the DNS prefetch plumbing where it queues the requests and posts a task back to itself for submitting the actual requests at a later point. It also counts preconnect requests for the same URL and uses that as an indicator that more connections are needed (as many connections as requests up to a limit of 6). This will only work if the URLs are discovered after each other and before the scheduled task gets run which will easily be the case for link tags that are grouped together but may not be the case if they are scattered through the head (an acceptable tradeoff). The net stack will de-dupe preconnect requests and just leverage existing or pending connections which is why we need to accumulate and count before requesting. BUG=450682 Review URL: https://codereview.chromium.org/899883004 Cr-Commit-Position: refs/heads/master@{#315782}
Diffstat (limited to 'components/network_hints/common')
-rw-r--r--components/network_hints/common/network_hints_messages.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/components/network_hints/common/network_hints_messages.h b/components/network_hints/common/network_hints_messages.h
index 9c52c3a..12b1c65 100644
--- a/components/network_hints/common/network_hints_messages.h
+++ b/components/network_hints/common/network_hints_messages.h
@@ -7,6 +7,7 @@
#include <vector>
#include "components/network_hints/common/network_hints_common.h"
+#include "content/public/common/common_param_traits.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_message_utils.h"
@@ -28,7 +29,7 @@ struct ParamTraits<network_hints::LookupRequest> {
#endif // COMPONENTS_NETWORK_HINTS_COMMON_NETWORK_HINTS_MESSAGES_H_
-#define IPC_MESSAGE_START DnsPrefetchMsgStart
+#define IPC_MESSAGE_START NetworkHintsMsgStart
//-----------------------------------------------------------------------------
// Host messages
@@ -36,5 +37,12 @@ struct ParamTraits<network_hints::LookupRequest> {
// Request for a DNS prefetch of the names in the array.
// NameList is typedef'ed std::vector<std::string>
-IPC_MESSAGE_CONTROL1(DnsPrefetchMsg_RequestPrefetch,
+IPC_MESSAGE_CONTROL1(NetworkHintsMsg_DNSPrefetch,
network_hints::LookupRequest)
+
+
+// Request for preconnect to host providing resource specified by URL
+IPC_MESSAGE_CONTROL2(NetworkHintsMsg_Preconnect,
+ GURL /* preconnect target url */,
+ int /* number of connections */)
+