Make ParseAndSetExperimentalOptions() a member of URLRequestContextConfig
It didn't previously have a way of handling experimental options which
don't translate to settings on the URLRequestContextBuilder. This change
allows it to directly change settings on the URLRequestContextConfig so
those settings can be used outside of the builder.
This struct shouldn't really be a struct anymore, but it already
shouldn't really have been a struct. This CL is the minimum change
needed to unblock an upcoming feature plus some closely related cleanup.
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_cronet_tester
Review-Url: https://codereview.chromium.org/2952653002
Cr-Commit-Position: refs/heads/master@{#480996}
diff --git a/components/cronet/url_request_context_config.h b/components/cronet/url_request_context_config.h
index 6e55a92a..41ba045d 100644
--- a/components/cronet/url_request_context_config.h
+++ b/components/cronet/url_request_context_config.h
@@ -12,11 +12,11 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_vector.h"
#include "base/time/time.h"
+#include "base/values.h"
#include "net/base/hash_value.h"
#include "net/cert/cert_verifier.h"
namespace base {
-class DictionaryValue;
class SequencedTaskRunner;
} // namespace base
@@ -30,6 +30,8 @@
// Common configuration parameters used by Cronet to configure
// URLRequestContext.
+// TODO(mgersh): This shouldn't be a struct, and experimental option parsing
+// should be kept more separate from applying the configuration.
struct URLRequestContextConfig {
// Type of HTTP cache.
// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net.impl
@@ -166,9 +168,17 @@
ScopedVector<Pkp> pkp_list;
// Experimental options that are recognized by the config parser.
- std::unique_ptr<base::DictionaryValue> effective_experimental_options;
+ std::unique_ptr<base::DictionaryValue> effective_experimental_options =
+ nullptr;
private:
+ // Parses experimental options and makes appropriate changes to settings in
+ // the URLRequestContextConfig and URLRequestContextBuilder.
+ void ParseAndSetExperimentalOptions(
+ net::URLRequestContextBuilder* context_builder,
+ net::NetLog* net_log,
+ const scoped_refptr<base::SequencedTaskRunner>& file_task_runner);
+
DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfig);
};