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

Side by Side Diff: components/cronet/android/java/src/org/chromium/net/HttpUrlRequestFactory.java

Issue 672533002: Enable separatorWrap module in CheckStyle and fix all the issues. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.net; 5 package org.chromium.net;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.util.Log; 8 import android.util.Log;
9 9
10 import java.lang.reflect.Constructor; 10 import java.lang.reflect.Constructor;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 * Stops NetLog logging and flushes file to disk. If a logging session is 71 * Stops NetLog logging and flushes file to disk. If a logging session is
72 * not in progress this call is ignored. 72 * not in progress this call is ignored.
73 */ 73 */
74 public abstract void stopNetLog(); 74 public abstract void stopNetLog();
75 75
76 private static HttpUrlRequestFactory createChromiumFactory( 76 private static HttpUrlRequestFactory createChromiumFactory(
77 Context context, HttpUrlRequestFactoryConfig config) { 77 Context context, HttpUrlRequestFactoryConfig config) {
78 HttpUrlRequestFactory factory = null; 78 HttpUrlRequestFactory factory = null;
79 try { 79 try {
80 Class<? extends HttpUrlRequestFactory> factoryClass = 80 Class<? extends HttpUrlRequestFactory> factoryClass =
81 HttpUrlRequestFactory.class.getClassLoader(). 81 HttpUrlRequestFactory.class.getClassLoader()
82 loadClass(CHROMIUM_URL_REQUEST_FACTORY). 82 .loadClass(CHROMIUM_URL_REQUEST_FACTORY)
83 asSubclass(HttpUrlRequestFactory.class); 83 .asSubclass(HttpUrlRequestFactory.class);
84 Constructor<? extends HttpUrlRequestFactory> constructor = 84 Constructor<? extends HttpUrlRequestFactory> constructor =
85 factoryClass.getConstructor( 85 factoryClass.getConstructor(
86 Context.class, HttpUrlRequestFactoryConfig.class); 86 Context.class, HttpUrlRequestFactoryConfig.class);
87 HttpUrlRequestFactory chromiumFactory = 87 HttpUrlRequestFactory chromiumFactory =
88 constructor.newInstance(context, config); 88 constructor.newInstance(context, config);
89 if (chromiumFactory.isEnabled()) { 89 if (chromiumFactory.isEnabled()) {
90 factory = chromiumFactory; 90 factory = chromiumFactory;
91 } 91 }
92 } catch (ClassNotFoundException e) { 92 } catch (ClassNotFoundException e) {
93 // Leave as null 93 // Leave as null
94 } catch (Exception e) { 94 } catch (Exception e) {
95 throw new IllegalStateException( 95 throw new IllegalStateException(
96 "Cannot instantiate: " + 96 "Cannot instantiate: " + CHROMIUM_URL_REQUEST_FACTORY,
97 CHROMIUM_URL_REQUEST_FACTORY,
98 e); 97 e);
99 } 98 }
100 return factory; 99 return factory;
101 } 100 }
102 } 101 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698