diff --git a/build/config/nacl/BUILD.gn b/build/config/nacl/BUILD.gn index dcd736f..51ebabd7 100644 --- a/build/config/nacl/BUILD.gn +++ b/build/config/nacl/BUILD.gn
@@ -39,7 +39,7 @@ configs = [] cflags = [] - if (is_clang) { + if (is_clang && current_cpu != "pnacl") { # -no-integrated-as is the default in nacl-clang for historical # compatibility with inline assembly code and so forth. But there # are no such cases in Chromium code, and -integrated-as is nicer in
diff --git a/build/module_args/dart.gni b/build/module_args/dart.gni deleted file mode 100644 index be5e83b0..0000000 --- a/build/module_args/dart.gni +++ /dev/null
@@ -1,6 +0,0 @@ -# Copyright 2015 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# Mojo needs this file to exist. We don't currently need it to define anything. -
diff --git a/chrome/installer/util/BUILD.gn b/chrome/installer/util/BUILD.gn index e1578f1b..164e1b9 100644 --- a/chrome/installer/util/BUILD.gn +++ b/chrome/installer/util/BUILD.gn
@@ -221,7 +221,6 @@ test("installer_util_unittests") { sources = [ "../setup/compat_checks_unittest.cc", - "../setup/setup_constants.cc", "advanced_firewall_manager_win_unittest.cc", "beacons_unittest.cc", "callback_work_item_unittest.cc",
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc index 4c0009c..777d721 100644 --- a/net/http/http_network_session.cc +++ b/net/http/http_network_session.cc
@@ -108,6 +108,7 @@ quic_packet_loss_threshold(0.5f), quic_socket_receive_buffer_size(kQuicSocketReceiveBufferSize), quic_delay_tcp_race(false), + quic_store_server_configs_in_properties(false), quic_clock(NULL), quic_random(NULL), quic_max_packet_length(kDefaultMaxPacketSize), @@ -167,6 +168,7 @@ params.quic_threshold_timeouts_streams_open, params.quic_socket_receive_buffer_size, params.quic_delay_tcp_race, + params.quic_store_server_configs_in_properties, params.quic_connection_options), spdy_session_pool_(params.host_resolver, params.ssl_config_service,
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h index c0503c9..a587acf 100644 --- a/net/http/http_network_session.h +++ b/net/http/http_network_session.h
@@ -119,6 +119,7 @@ float quic_packet_loss_threshold; int quic_socket_receive_buffer_size; bool quic_delay_tcp_race; + bool quic_store_server_configs_in_properties; HostPortPair origin_to_force_quic_on; QuicClock* quic_clock; // Will be owned by QuicStreamFactory. QuicRandom* quic_random;
diff --git a/net/http/http_server_properties.h b/net/http/http_server_properties.h index 8e400cf0..95f48559 100644 --- a/net/http/http_server_properties.h +++ b/net/http/http_server_properties.h
@@ -224,9 +224,13 @@ // The interface for setting/retrieving the HTTP server properties. // Currently, this class manages servers': -// * SPDY support (based on NPN results) -// * alternative service support -// * Spdy Settings (like CWND ID field) +// * SPDY support (based on NPN results). +// * alternative service support. +// * SPDY Settings (like CWND ID field). +// * QUIC data (like ServerNetworkStats and QuicServerInfo). +// +// Embedders must ensure that HttpServerProperites is completely initialized +// before the first request is issued. class NET_EXPORT HttpServerProperties { public: HttpServerProperties() {}
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc index cf79525e..60fef90 100644 --- a/net/quic/quic_stream_factory.cc +++ b/net/quic/quic_stream_factory.cc
@@ -27,6 +27,7 @@ #include "net/http/http_server_properties.h" #include "net/quic/crypto/channel_id_chromium.h" #include "net/quic/crypto/proof_verifier_chromium.h" +#include "net/quic/crypto/properties_based_quic_server_info.h" #include "net/quic/crypto/quic_random.h" #include "net/quic/crypto/quic_server_info.h" #include "net/quic/port_suggester.h" @@ -595,6 +596,7 @@ int threshold_timeouts_with_open_streams, int socket_receive_buffer_size, bool delay_tcp_race, + bool store_server_configs_in_properties, const QuicTagVector& connection_options) : require_confirmation_(true), host_resolver_(host_resolver), @@ -635,9 +637,10 @@ yield_after_packets_(kQuicYieldAfterPacketsRead), yield_after_duration_(QuicTime::Delta::FromMilliseconds( kQuicYieldAfterDurationMilliseconds)), + store_server_configs_in_properties_(store_server_configs_in_properties), port_seed_(random_generator_->RandUint64()), check_persisted_supports_quic_(true), - quic_supported_servers_at_startup_initialzied_(false), + has_initialized_data_(false), task_runner_(nullptr), weak_factory_(this) { DCHECK(transport_security_state_); @@ -667,6 +670,15 @@ crypto_config_.PreferAesGcm(); if (!IsEcdsaSupported()) crypto_config_.DisableEcdsa(); + // When disk cache is used to store the server configs, HttpCache code calls + // |set_quic_server_info_factory| if |quic_server_info_factory_| wasn't + // created. + // TODO(rtenneti): make |quic_server_info_factory_| a scoped_ptr and take + // ownership of this object from HttpCache. + if (store_server_configs_in_properties_) { + quic_server_info_factory_ = + new PropertiesBasedQuicServerInfoFactory(http_server_properties_); + } } QuicStreamFactory::~QuicStreamFactory() { @@ -680,6 +692,8 @@ STLDeleteElements(&(active_jobs_[server_id])); active_jobs_.erase(server_id); } + if (store_server_configs_in_properties_ && quic_server_info_factory_) + delete quic_server_info_factory_; } void QuicStreamFactory::set_require_confirmation(bool require_confirmation) { @@ -735,8 +749,7 @@ QuicServerInfo* quic_server_info = nullptr; if (quic_server_info_factory_) { bool load_from_disk_cache = !disable_disk_cache_; - if (!quic_supported_servers_at_startup_initialzied_) - InitializeQuicSupportedServersAtStartup(); + MaybeInitialize(); if (!ContainsKey(quic_supported_servers_at_startup_, server_id.host_port_pair())) { // If there is no entry for QUIC, consider that as a new server and @@ -1361,7 +1374,6 @@ if (!cached->IsEmpty()) return; - DCHECK(quic_supported_servers_at_startup_initialzied_); // TODO(rtenneti): Delete the following histogram after collecting stats. // If the AlternativeServiceMap contained an entry for this host, check if // the disk cache contained an entry for it. @@ -1384,9 +1396,15 @@ } } -void QuicStreamFactory::InitializeQuicSupportedServersAtStartup() { - DCHECK(!quic_supported_servers_at_startup_initialzied_); - quic_supported_servers_at_startup_initialzied_ = true; +void QuicStreamFactory::MaybeInitialize() { + // We don't initialize data from HttpServerProperties in the constructor + // because HttpServerProperties has not yet initialized. We're guaranteed + // HttpServerProperties has been initialized by the first time a request is + // made. + if (has_initialized_data_) + return; + + has_initialized_data_ = true; for (const std::pair<const HostPortPair, AlternativeServiceInfoVector>& key_value : http_server_properties_->alternative_service_map()) { for (const AlternativeServiceInfo& alternative_service_info : @@ -1397,6 +1415,22 @@ } } } + + if (!store_server_configs_in_properties_) + return; + // Create a temporary QuicServerInfo object to deserialize and to populate the + // in-memory crypto server config cache. + scoped_ptr<QuicServerInfo> server_info; + CompletionCallback callback; + for (const auto& key_value : + http_server_properties_->quic_server_info_map()) { + const QuicServerId& server_id = key_value.first; + server_info.reset(quic_server_info_factory_->GetForServer(server_id)); + if (server_info->WaitForDataReady(callback) == OK) { + DVLOG(1) << "Initialized server config for: " << server_id.ToString(); + InitializeCachedStateInCryptoConfig(server_id, server_info); + } + } } void QuicStreamFactory::ProcessGoingAwaySession(
diff --git a/net/quic/quic_stream_factory.h b/net/quic/quic_stream_factory.h index 162607b..0c4fb3c 100644 --- a/net/quic/quic_stream_factory.h +++ b/net/quic/quic_stream_factory.h
@@ -138,6 +138,7 @@ int threshold_public_resets_post_handshake, int socket_receive_buffer_size, bool delay_tcp_race, + bool store_server_configs_in_properties, const QuicTagVector& connection_options); ~QuicStreamFactory() override; @@ -249,6 +250,10 @@ bool delay_tcp_race() const { return delay_tcp_race_; } + bool store_server_configs_in_properties() const { + return store_server_configs_in_properties_; + } + private: class Job; friend class test::QuicStreamFactoryPeer; @@ -329,8 +334,9 @@ const scoped_ptr<QuicServerInfo>& server_info); // Initialize |quic_supported_servers_at_startup_| with the list of servers - // that supported QUIC at start up. - void InitializeQuicSupportedServersAtStartup(); + // that supported QUIC at start up and also initialize in-memory cache of + // QuicServerInfo objects from HttpServerProperties. + void MaybeInitialize(); void ProcessGoingAwaySession(QuicChromiumClientSession* session, const QuicServerId& server_id, @@ -449,6 +455,9 @@ int yield_after_packets_; QuicTime::Delta yield_after_duration_; + // Set if server configs are to be stored in HttpServerProperties. + bool store_server_configs_in_properties_; + // Each profile will (probably) have a unique port_seed_ value. This value // is used to help seed a pseudo-random number generator (PortSuggester) so // that we consistently (within this profile) suggest the same ephemeral @@ -460,7 +469,7 @@ // Local address of socket that was created in CreateSession. IPEndPoint local_address_; bool check_persisted_supports_quic_; - bool quic_supported_servers_at_startup_initialzied_; + bool has_initialized_data_; std::set<HostPortPair> quic_supported_servers_at_startup_; NetworkConnection network_connection_;
diff --git a/net/quic/quic_stream_factory_test.cc b/net/quic/quic_stream_factory_test.cc index c787d79..c08ee0c 100644 --- a/net/quic/quic_stream_factory_test.cc +++ b/net/quic/quic_stream_factory_test.cc
@@ -17,6 +17,8 @@ #include "net/http/transport_security_state.h" #include "net/quic/crypto/crypto_handshake.h" #include "net/quic/crypto/proof_verifier_chromium.h" +#include "net/quic/crypto/properties_based_quic_server_info.h" +#include "net/quic/crypto/quic_crypto_client_config.h" #include "net/quic/crypto/quic_decrypter.h" #include "net/quic/crypto/quic_encrypter.h" #include "net/quic/crypto/quic_server_info.h" @@ -195,14 +197,12 @@ return factory->num_public_resets_post_handshake_; } - static void InitializeQuicSupportedServersAtStartup( - QuicStreamFactory* factory) { - factory->InitializeQuicSupportedServersAtStartup(); + static void MaybeInitialize(QuicStreamFactory* factory) { + factory->MaybeInitialize(); } - static bool GetQuicSupportedServersAtStartupInitialzied( - QuicStreamFactory* factory) { - return factory->quic_supported_servers_at_startup_initialzied_; + static bool HasInitializedData(QuicStreamFactory* factory) { + return factory->has_initialized_data_; } static bool SupportsQuicAtStartUp(QuicStreamFactory* factory, @@ -210,6 +210,22 @@ return ContainsKey(factory->quic_supported_servers_at_startup_, host_port_pair); } + + static bool CryptoConfigCacheIsEmpty(QuicStreamFactory* factory, + QuicServerId& quic_server_id) { + return factory->CryptoConfigCacheIsEmpty(quic_server_id); + } + + static void EnableStoreServerConfigsInProperties(QuicStreamFactory* factory) { + factory->store_server_configs_in_properties_ = true; + } + + static void SetQuicServerInfoFactory( + QuicStreamFactory* factory, + QuicServerInfoFactory* quic_server_info_factory) { + DCHECK(!factory->quic_server_info_factory_); + factory->quic_server_info_factory_ = quic_server_info_factory; + } }; class MockQuicServerInfo : public QuicServerInfo { @@ -287,6 +303,7 @@ /*threshold_pulic_resets_post_handshake=*/2, /*receive_buffer_size=*/0, /*delay_tcp_race=*/false, + /*store_server_configs_in_properties=*/false, QuicTagVector()), host_port_pair_(kDefaultServerHostName, kDefaultServerPort), is_https_(false), @@ -2655,9 +2672,9 @@ QuicStreamFactoryPeer::SetDelayTcpRace(&factory_, delay_tcp_race); } -TEST_P(QuicStreamFactoryTest, QuicSupportedServersAtStartup) { - factory_.set_quic_server_info_factory(&quic_server_info_factory_); +TEST_P(QuicStreamFactoryTest, MaybeInitialize) { QuicStreamFactoryPeer::SetTaskRunner(&factory_, runner_.get()); + QuicStreamFactoryPeer::EnableStoreServerConfigsInProperties(&factory_); const AlternativeService alternative_service1(QUIC, host_port_pair_.host(), host_port_pair_.port()); @@ -2669,12 +2686,64 @@ http_server_properties_.SetAlternativeServices( host_port_pair_, alternative_service_info_vector); - QuicStreamFactoryPeer::InitializeQuicSupportedServersAtStartup(&factory_); - EXPECT_TRUE( - QuicStreamFactoryPeer::GetQuicSupportedServersAtStartupInitialzied( - &factory_)); + QuicServerId quic_server_id("www.google.com", 80, false, + PRIVACY_MODE_DISABLED); + QuicServerInfoFactory* quic_server_info_factory = + new PropertiesBasedQuicServerInfoFactory( + http_server_properties_.GetWeakPtr()); + QuicStreamFactoryPeer::SetQuicServerInfoFactory(&factory_, + quic_server_info_factory); + + scoped_ptr<QuicServerInfo> quic_server_info( + quic_server_info_factory->GetForServer(quic_server_id)); + + // Update quic_server_info's server_config and persist it. + QuicServerInfo::State* state = quic_server_info->mutable_state(); + // Minimum SCFG that passes config validation checks. + const char scfg[] = {// SCFG + 0x53, 0x43, 0x46, 0x47, + // num entries + 0x01, 0x00, + // padding + 0x00, 0x00, + // EXPY + 0x45, 0x58, 0x50, 0x59, + // EXPY end offset + 0x08, 0x00, 0x00, 0x00, + // Value + '1', '2', '3', '4', '5', '6', '7', '8'}; + + // Create temporary strings becasue Persist() clears string data in |state|. + string server_config(reinterpret_cast<const char*>(&scfg), sizeof(scfg)); + string source_address_token("test_source_address_token"); + string signature("test_signature"); + string test_cert("test_cert"); + vector<string> certs; + certs.push_back(test_cert); + state->server_config = server_config; + state->source_address_token = source_address_token; + state->server_config_sig = signature; + state->certs = certs; + + quic_server_info->Persist(); + + QuicStreamFactoryPeer::MaybeInitialize(&factory_); + EXPECT_TRUE(QuicStreamFactoryPeer::HasInitializedData(&factory_)); EXPECT_TRUE( QuicStreamFactoryPeer::SupportsQuicAtStartUp(&factory_, host_port_pair_)); + EXPECT_FALSE(QuicStreamFactoryPeer::CryptoConfigCacheIsEmpty(&factory_, + quic_server_id)); + QuicCryptoClientConfig* crypto_config = + QuicStreamFactoryPeer::GetCryptoConfig(&factory_); + QuicCryptoClientConfig::CachedState* cached = + crypto_config->LookupOrCreate(quic_server_id); + EXPECT_FALSE(cached->server_config().empty()); + EXPECT_TRUE(cached->GetServerConfig()); + EXPECT_EQ(server_config, cached->server_config()); + EXPECT_EQ(source_address_token, cached->source_address_token()); + EXPECT_EQ(signature, cached->signature()); + ASSERT_EQ(1U, cached->certs().size()); + EXPECT_EQ(test_cert, cached->certs()[0]); } TEST_P(QuicStreamFactoryTest, YieldAfterPackets) { @@ -2682,7 +2751,7 @@ scoped_ptr<QuicEncryptedPacket> close_packet( ConstructConnectionClosePacket(0)); - std::vector<MockRead> reads; + vector<MockRead> reads; reads.push_back( MockRead(SYNCHRONOUS, close_packet->data(), close_packet->length(), 0)); reads.push_back(MockRead(ASYNC, OK, 1)); @@ -2727,7 +2796,7 @@ scoped_ptr<QuicEncryptedPacket> close_packet( ConstructConnectionClosePacket(0)); - std::vector<MockRead> reads; + vector<MockRead> reads; reads.push_back( MockRead(SYNCHRONOUS, close_packet->data(), close_packet->length(), 0)); reads.push_back(MockRead(ASYNC, OK, 1));
diff --git a/third_party/WebKit/Source/modules/mediastream/OWNERS b/third_party/WebKit/Source/modules/mediastream/OWNERS index 4e4fd11..42057931 100644 --- a/third_party/WebKit/Source/modules/mediastream/OWNERS +++ b/third_party/WebKit/Source/modules/mediastream/OWNERS
@@ -1,2 +1,3 @@ tommi@chromium.org tommyw@chromium.org +peter@chromium.org
diff --git a/third_party/mojo/src/mojo/public/mojo.gni b/third_party/mojo/src/mojo/public/mojo.gni index bb06cdb..adf8e0d 100644 --- a/third_party/mojo/src/mojo/public/mojo.gni +++ b/third_party/mojo/src/mojo/public/mojo.gni
@@ -2,7 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/module_args/dart.gni") import("//build/module_args/mojo.gni") # If using the prebuilt shell, gate its usage by the platforms for which it is