Fix mapping of weak DH key and remove unused error codes.

None of these error codes are actually reported back by BoringSSL.

SSL_R_WRONG_NUMBER_OF_KEY_BITS is changed to the proper
error code SSL_R_BAD_DH_P_LENGTH.

Test DH issue by loading https://demo.cmrg.net/

BUG=353579

Review URL: https://codereview.chromium.org/495553002

git-svn-id: http://src.chromium.org/svn/trunk/src/net@291051 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Allow URLRequests from one context to have different NetworkDelegates.

This is a prerequisite to allowing a URLRequestJob to transparently wrap
a URLRequest, so AppCache can override the response for failing and
redirected requests without the NetworkDelegate or URLRequest::Delegate
being aware of the underlying request.

Also consolidate the URLRequest constructors, and make most code create
URLRequests through the URLRequestContext's CreateRequest function,
rather than through its constructor.

TBR=battre@chromium.org
BUG=161547

Review URL: https://codereview.chromium.org/407093011

git-svn-id: http://src.chromium.org/svn/trunk/src/net@291090 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Refactor HttpStreamFactoryImpl::Job::DoCreateStream() for handling WebSocket correctly

This function is long and sophisticated. Factor out the code creating
and setting |stream_| and reorganize if-clauses.

Then, this CL adds for_websockets_ checks where it's missing.

R=jgraettinger,rch
BUG=394434

Review URL: https://codereview.chromium.org/443383002

git-svn-id: http://src.chromium.org/svn/trunk/src/net@291131 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
HTTP2 draft 14 support

This master CL lands recent SPDY changes through 73573949, extending them
with Chromium-specific updates to constants and enums, protocol negotiation
tokens, and tests.  This CL is intended to be commited but not reviewed, and is
the union of the following changes, which in turn are intended to be reviewed
but not commited.  (Most recent on top, oldest on bottom.)

Fix bug in HTTP/2 frame size limits.  This lands server change 73573949.
https://crrev.com/478903004

Update npn/alpn tokens to HTTP2-draft14.
https://crrev.com/486493003

Add kSpdyMaxControlFrameSize and kControlFrameSizeLimit constants.  This lands
server change 73427537.
https://crrev.com/486873002

Add TODO.  This lands server change 73426819.
https://crrev.com/479313002

Add an extra byte to the length field for HTTP/2 frame headers.  This lands
server change 73424406.
https://crrev.com/479303002

Change order of tests.
https://crrev.com/483863002

Remove reference set and exchange header and static table in HPACK.  This lands
server change 73299534.
https://crrev.com/480573003

Add new settings to SPDY4 for h2-14.  This lands server change 72726557.
https://crrev.com/480183002

Add kHttp2VersionString.  This lands server change 72173526.
https://crrev.com/485813002

HTTP2 draft 13: support unknown frame types and settings types as extensions.
This lands server change 70895882.
https://crrev.com/483843004

Allow unrecognized error codes as part of HTTP/2 extensions.  This lands server
change 70873693.
https://crrev.com/475043002

BUG=400336

Review URL: https://codereview.chromium.org/485833002

git-svn-id: http://src.chromium.org/svn/trunk/src/net@291161 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Change the lifespan of SSlConnectJobMessengers so that they are created
only when needed, and deleted as soon as they are no longer necessary.

Add methods to SSLClientSocketPool that are passed to the SSLConnectJob
and SSLConnectJobMessenger as callbacks. These allow the SSLConnectJob
to tell the SSLClientSocketPool to create a messenger for the job when
appropriate, and the SSLConnectJobMessenger to tell the
SSLCLientSocketPool to remove a messenger when appropriate. An
SSLConnectJob will now only create an SSLConnectJobMessenger if its
socket's session is not already in the session cache. The messenger
will then ask to be removed when there are no remaining pending or
connecting sockets in the messenger.

Written by Mackenzie Shelley <mshelley@chromium.org>
Original review URL: https://codereview.chromium.org/384873002/

R=rsleevi@chromium.org
TBR=mek@chromium.org
BUG=398967

Review URL: https://codereview.chromium.org/476313004

git-svn-id: http://src.chromium.org/svn/trunk/src/net@291192 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Rework UMAHistogramHelper and StatisticsDeltaReader into [Chrome]HistogramTester.

Design Doc (Googlers Only):
https://docs.google.com/a/google.com/document/d/1RUY0BcxBppdkwFP3T8qbQmQStBRFGsLmuR4WuIXhiCA/edit

BUG=384011
TBR=timsteele@chromium.org

Review URL: https://codereview.chromium.org/379283002

git-svn-id: http://src.chromium.org/svn/trunk/src/net@291207 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Allow chunked SPDY POSTs to be terminated by an empty FIN data frame.

This allows embedders to send a chunk when they do not yet know if it is
the final chunk or not.

BUG=405678

Review URL: https://codereview.chromium.org/492063002

git-svn-id: http://src.chromium.org/svn/trunk/src/net@291222 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Roll BoringSSL.

This picks up the following changes:

5213df4 Prefer AES-GCM when hardware support is available.
92909a6 Remove MS SGC support on the the server.
b52e3dd Move common code between two branches.
422d3a4 Remove some unused state and code.
fd00303 Don't scan libfoo_error.c for error codes.
a7d1363 Prune removed key types from SSL_PKEY_*.
ef2116d Remove DSA-based cipher suites and client auth.
cff6472 Mark some more globals as const.
0da0e18 Remove ECDH_RSA, ECDH_ECDSA, DH_RSA, and DH_DSS.
bd30f8e Remove support on both sides for *_fixed_(ec)dh client auth.
d0639af Remove single-DES cipher suites.
ebf42b5 Remove remnants of now-removed cipher suites.
f6faa4b Export some extra functions and values.
e7bf281 Fix (harmless) memory leak in the test harness.
389e3f0 Fix minor comment typos.
66c249c Remove some dead code.
ede973a Tidy up cipher ordering.
6bc658d Split off private_transform function in RSA.
214cd44 Export BN_num_bits_word.
e712778 Remove rsa_md5, md5, and sha1 fields from SSL_CTX.
b7725cf Include Windows.h in some source files.
8bc38f5 DTLS version negotiation doesn't happen at HelloVerifyRequest.
f2fedef Simplify HelloVerifyRequest processing.
cc23df5 Remove SSL_OP_CISCO_ANYCONNECT.
6f26001 Mark all SSL_CIPHERs as const.
fb4ea28 Tidy DTLS cookie callback types.
f450134 Remove default_timeout hook.
5216a93 Increase minimum required cmake version

BUG=405091,396787

Review URL: https://codereview.chromium.org/490763002

git-svn-id: http://src.chromium.org/svn/trunk/src/net@291278 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Add QUIC tests for chunked uploads where the FIN frame has no body data.

This is part of work to allow embedders to send a chunk when they do
not yet know whether it is the final chunk.

BUG=405678

Review URL: https://codereview.chromium.org/497553002

git-svn-id: http://src.chromium.org/svn/trunk/src/net@291282 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Refactoring: Create per-connection packet writers in QuicDispatcher.

To make porting the QUIC EndToEndTest to Chromium possible with fewer
Chromium-specific parts in shared code, I've made QuicDispatcher expose
and accept a QuicDispatcher::PacketWriterFactory which it uses to create
a new packet writer wrapper for every QuicConnection. I also changed
QuicConnection to accept a QuicConnection::PacketWriterFactory (a second
new type of factory) rather than the writer itself in its constructor,
since the per-connection packet writers need to be created with the
connection already existing.

Merge internal CL: 73064412

Written by Daniel Ziegler <dmziegler@chromium.org>
Original review URL: https://codereview.chromium.org/467963002/

R=rch@chromium.org,wtc@chromium.org
BUG=

Review URL: https://codereview.chromium.org/475113005

git-svn-id: http://src.chromium.org/svn/trunk/src/net@291314 4ff67af0-8c30-449e-8e8b-ad334ec8d88c