Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(816)

Unified Diff: components/cronet/android/chromium_url_request_context.cc

Issue 1429863008: [Cronet] Remove JSON serialization of CronetEngine.Builder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix component_unittests Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/cronet/android/chromium_url_request_context.cc
diff --git a/components/cronet/android/chromium_url_request_context.cc b/components/cronet/android/chromium_url_request_context.cc
index 247077d3b36a57bbb54e0b951607b3ac0884322a..3969ec0cfd99d48b7d797f780afad294b4db1e98 100644
--- a/components/cronet/android/chromium_url_request_context.cc
+++ b/components/cronet/android/chromium_url_request_context.cc
@@ -66,24 +66,11 @@ static jlong CreateRequestContextAdapter(
const JavaParamRef<jobject>& jcaller,
const JavaParamRef<jstring>& juser_agent,
jint jlog_level,
- const JavaParamRef<jstring>& jconfig) {
+ jlong jconfig) {
std::string user_agent = ConvertJavaStringToUTF8(env, juser_agent);
- std::string config = ConvertJavaStringToUTF8(env, jconfig);
-
- scoped_ptr<base::Value> config_value = base::JSONReader::Read(config);
- if (!config_value || !config_value->IsType(base::Value::TYPE_DICTIONARY)) {
- DLOG(ERROR) << "Bad JSON: " << config;
- return 0;
- }
-
scoped_ptr<URLRequestContextConfig> context_config(
- new URLRequestContextConfig());
- base::JSONValueConverter<URLRequestContextConfig> converter;
- if (!converter.Convert(*config_value, context_config.get())) {
- DLOG(ERROR) << "Bad Config: " << config_value;
- return 0;
- }
+ reinterpret_cast<URLRequestContextConfig*>(jconfig));
// TODO(mef): MinLogLevel is global, shared by all URLRequestContexts.
// Revisit this if each URLRequestContext would need an individual log level.

Powered by Google App Engine
This is Rietveld 408576698