Skip to content

Commit

Permalink
Move cronet from //net into //components.
Browse files Browse the repository at this point in the history
BUG=354143

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262875 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
mef@chromium.org committed Apr 10, 2014
1 parent 1cdaca4 commit 0dcb1a8
Show file tree
Hide file tree
Showing 45 changed files with 224 additions and 204 deletions.
3 changes: 3 additions & 0 deletions components/OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ per-file cloud_devices*=gene@chromium.org
per-file cloud_devices*=noamsml@chromium.org
per-file cloud_devices*=vitalybuka@chromium.org

per-file cronet*=mef@chromium.org
per-file cronet*=mmenke@chromium.org

per-file dom_distiller*=bengr@chromium.org
per-file dom_distiller*=cjhopman@chromium.org
per-file dom_distiller*=nyquist@chromium.org
Expand Down
1 change: 1 addition & 0 deletions components/components.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'autofill.gypi',
'breakpad.gypi',
'cloud_devices.gypi',
'cronet.gypi',
'dom_distiller.gypi',
'domain_reliability.gypi',
'favicon.gypi',
Expand Down
191 changes: 191 additions & 0 deletions components/cronet.gypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
# Copyright 2014 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.

{
'conditions': [
['OS=="android"', {
# TODO(mef): Consider moving all Cronet Android targets into separate
# file. Also figure out what needs to be done for gn script.
'targets': [
{
'target_name': 'cronet_jni_headers',
'type': 'none',
'sources': [
'cronet/android/java/src/org/chromium/net/UrlRequest.java',
'cronet/android/java/src/org/chromium/net/UrlRequestContext.java',
],
'variables': {
'jni_gen_package': 'cronet',
'jni_generator_ptr_type': 'long',
},
'includes': [ '../build/jni_generator.gypi' ],
},
{
'target_name': 'cronet_url_request_error_list',
'type': 'none',
'sources': [
'cronet/android/java/src/org/chromium/net/UrlRequestError.template',
],
'variables': {
'package_name': 'org/chromium/cronet',
'template_deps': ['cronet/android/org_chromium_net_UrlRequest_error_list.h'],
},
'includes': [ '../build/android/java_cpp_template.gypi' ],
},
{
'target_name': 'cronet_url_request_priority_list',
'type': 'none',
'sources': [
'cronet/android/java/src/org/chromium/net/UrlRequestPriority.template',
],
'variables': {
'package_name': 'org/chromium/cronet',
'template_deps': ['cronet/android/org_chromium_net_UrlRequest_priority_list.h'],
},
'includes': [ '../build/android/java_cpp_template.gypi' ],
},
{
'target_name': 'libcronet',
'type': 'shared_library',
'dependencies': [
'../base/base.gyp:base',
'../base/base.gyp:base_i18n',
'../third_party/icu/icu.gyp:icui18n',
'../third_party/icu/icu.gyp:icuuc',
'../url/url.gyp:url_lib',
'cronet_jni_headers',
'cronet_url_request_error_list',
'cronet_url_request_priority_list',
'../net/net.gyp:net',
],
'sources': [
'cronet/android/org_chromium_net_UrlRequest.cc',
'cronet/android/org_chromium_net_UrlRequest.h',
'cronet/android/org_chromium_net_UrlRequest_error_list.h',
'cronet/android/org_chromium_net_UrlRequest_priority_list.h',
'cronet/android/org_chromium_net_UrlRequestContext.cc',
'cronet/android/url_request_context_peer.cc',
'cronet/android/url_request_context_peer.h',
'cronet/android/url_request_peer.cc',
'cronet/android/url_request_peer.h',
],
'cflags': [
# TODO(mef): Figure out a good way to get version from chrome_version_info_posix.h.
'-DCHROMIUM_VERSION=\\"TBD\\"',
'-DLOGGING=1',
'-fdata-sections',
'-ffunction-sections',
'-fno-rtti',
'-fvisibility=hidden',
'-fvisibility-inlines-hidden',
'-Wno-sign-promo',
'-Wno-missing-field-initializers',
],
'ldflags': [
'-llog',
'-landroid',
'-Wl,--gc-sections',
'-Wl,--exclude-libs,ALL'
]
},
{
'target_name': 'cronet',
'type': 'none',
'dependencies': [
'../base/base.gyp:base',
'libcronet',
'cronet_url_request_error_list',
'cronet_url_request_priority_list',
],
'variables': {
'java_in_dir': 'cronet/android/java',
},
'includes': [ '../build/java.gypi' ],
},
{
'target_name': 'cronet_package',
'type': 'none',
'dependencies': [
'libcronet',
'cronet',
],
'variables': {
'native_lib': 'libcronet.>(android_product_extension)',
'java_lib': 'cronet.jar',
'package_dir': '<(PRODUCT_DIR)/cronet',
},
'actions': [
{
'action_name': 'strip libcronet',
'inputs': ['<(SHARED_LIB_DIR)/<(native_lib)'],
'outputs': ['<(package_dir)/libs/<(android_app_abi)/<(native_lib)'],
'action': [
'<(android_strip)',
'--strip-unneeded',
'<@(_inputs)',
'-o',
'<@(_outputs)',
],
},
],
'copies': [
{
'destination': '<(package_dir)',
'files': [
'<(PRODUCT_DIR)/lib.java/<(java_lib)',
],
},
],
},
{
'target_name': 'cronet_sample_apk',
'type': 'none',
'dependencies': [
'cronet',
],
'variables': {
'apk_name': 'CronetSample',
'java_in_dir': 'cronet/android/sample',
'resource_dir': 'cronet/android/sample/res',
'native_lib_target': 'libcronet',
},
'includes': [ '../build/java_apk.gypi' ],
},
{
# cronet_sample_apk creates a .jar as a side effect. Any java targets
# that need that .jar in their classpath should depend on this target,
# cronet_sample_apk_java. Dependents of cronet_sample_apk receive its
# jar path in the variable 'apk_output_jar_path'. This target should
# only be used by targets which instrument cronet_sample_apk.
'target_name': 'cronet_sample_apk_java',
'type': 'none',
'dependencies': [
'cronet_sample_apk',
],
'includes': [ '../build/apk_fake_jar.gypi' ],
},
{
'target_name': 'cronet_sample_test_apk',
'type': 'none',
'dependencies': [
'cronet_sample_apk_java',
'../base/base.gyp:base_java',
'../base/base.gyp:base_javatests',
'../base/base.gyp:base_java_test_support',
# TODO(mef): Figure out why some tests are failing.
#'../net/net.gyp:net_javatests',
#'../net/net.gyp:net_java_test_support',
],
'variables': {
'apk_name': 'CronetSampleTest',
'java_in_dir': 'cronet/android/sample/javatests',
'resource_dir': 'cronet/android/sample/res',
'is_test_apk': 1,
},
'includes': [ '../build/java_apk.gypi' ],
},
],
}], # OS=="android"
],
}
3 changes: 3 additions & 0 deletions components/cronet/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include_rules = [
"+net",
]
2 changes: 2 additions & 0 deletions components/cronet/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mef@chromium.org
mmenke@chromium.org
3 changes: 3 additions & 0 deletions components/cronet/android/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include_rules = [
"+jni",
]
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ package org.chromium.net;
// net/cronet/android/org_chromium_net_UrlRequest.h
public interface UrlRequestError {
#define DEFINE_REQUEST_ERROR(x,y) public static final int x = y;
#include "net/cronet/android/org_chromium_net_UrlRequest_error_list.h"
#include "components/cronet/android/org_chromium_net_UrlRequest_error_list.h"
#undef DEFINE_REQUEST_ERROR
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ package org.chromium.net;
// net/cronet/android/org_chromium_net_UrlRequest.h
public interface UrlRequestPriority {
#define DEFINE_REQUEST_PRIORITY(x,y) public static final int x = y;
#include "net/cronet/android/org_chromium_net_UrlRequest_priority_list.h"
#include "components/cronet/android/org_chromium_net_UrlRequest_priority_list.h"
#undef DEFINE_REQUEST_PRIORITY
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "net/cronet/android/org_chromium_net_UrlRequest.h"
#include "components/cronet/android/org_chromium_net_UrlRequest.h"

#include "base/android/jni_android.h"
#include "base/macros.h"
#include "components/cronet/android/url_request_context_peer.h"
#include "components/cronet/android/url_request_peer.h"
#include "jni/UrlRequest_jni.h"
#include "net/base/net_errors.h"
#include "net/base/request_priority.h"
#include "net/cronet/android/url_request_context_peer.h"
#include "net/cronet/android/url_request_peer.h"

namespace net {
namespace {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_CRONET_ANDROID_URLREQUEST_H_
#define NET_CRONET_ANDROID_URLREQUEST_H_
#ifndef COMPONENTS_CRONET_ANDROID_URLREQUEST_H_
#define COMPONENTS_CRONET_ANDROID_URLREQUEST_H_

#include <jni.h>

Expand All @@ -13,20 +13,20 @@ namespace net {
// way that ensures they're always the same than their Java counterpart.
enum UrlRequestPriority {
#define DEFINE_REQUEST_PRIORITY(x, y) REQUEST_PRIORITY_##x = y,
#include "net/cronet/android/org_chromium_net_UrlRequest_priority_list.h"
#include "components/cronet/android/org_chromium_net_UrlRequest_priority_list.h"
#undef DEFINE_REQUEST_PRIORITY
};

// Define request priority values like REQUEST_ERROR_SUCCESS in a
// way that ensures they're always the same than their Java counterpart.
enum UrlRequestError {
#define DEFINE_REQUEST_ERROR(x, y) REQUEST_ERROR_##x = y,
#include "net/cronet/android/org_chromium_net_UrlRequest_error_list.h"
#include "components/cronet/android/org_chromium_net_UrlRequest_error_list.h"
#undef DEFINE_REQUEST_ERROR
};

bool UrlRequestRegisterJni(JNIEnv* env);

} // namespace net

#endif // NET_CRONET_ANDROID_URLREQUEST_H_
#endif // COMPONENTS_CRONET_ANDROID_URLREQUEST_H_
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#include "base/at_exit.h"
#include "base/i18n/icu_util.h"
#include "base/metrics/statistics_recorder.h"
#include "components/cronet/android/org_chromium_net_UrlRequest.h"
#include "components/cronet/android/url_request_context_peer.h"
#include "components/cronet/android/url_request_peer.h"
#include "jni/UrlRequestContext_jni.h"
#include "net/android/net_jni_registrar.h"
#include "net/cronet/android/org_chromium_net_UrlRequest.h"
#include "net/cronet/android/url_request_context_peer.h"
#include "net/cronet/android/url_request_peer.h"

// Version of this build of Chromium NET.
#define CHROMIUM_NET_VERSION "1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "net/cronet/android/url_request_context_peer.h"
#include "components/cronet/android/url_request_context_peer.h"

#include "base/file_util.h"
#include "net/base/net_errors.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_CRONET_ANDROID_URL_REQUEST_CONTEXT_PEER_H_
#define NET_CRONET_ANDROID_URL_REQUEST_CONTEXT_PEER_H_
#ifndef COMPONENTS_CRONET_ANDROID_URL_REQUEST_CONTEXT_PEER_H_
#define COMPONENTS_CRONET_ANDROID_URL_REQUEST_CONTEXT_PEER_H_

#include <string>

Expand Down Expand Up @@ -89,4 +89,4 @@ class URLRequestContextPeer : public net::URLRequestContextGetter {
DISALLOW_COPY_AND_ASSIGN(URLRequestContextPeer);
};

#endif // NET_CRONET_ANDROID_URL_REQUEST_CONTEXT_PEER_H_
#endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_CONTEXT_PEER_H_
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_CRONET_ANDROID_URL_REQUEST_PEER_H_
#define NET_CRONET_ANDROID_URL_REQUEST_PEER_H_
#ifndef COMPONENTS_CRONET_ANDROID_URL_REQUEST_PEER_H_
#define COMPONENTS_CRONET_ANDROID_URL_REQUEST_PEER_H_

#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "components/cronet/android/url_request_context_peer.h"
#include "net/base/request_priority.h"
#include "net/base/upload_data_stream.h"
#include "net/cronet/android/url_request_context_peer.h"
#include "net/http/http_request_headers.h"
#include "net/url_request/url_request.h"

Expand Down Expand Up @@ -134,4 +134,4 @@ class URLRequestPeer : public net::URLRequest::Delegate {
DISALLOW_COPY_AND_ASSIGN(URLRequestPeer);
};

#endif // NET_CRONET_ANDROID_URL_REQUEST_PEER_H_
#endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_PEER_H_
Loading

0 comments on commit 0dcb1a8

Please sign in to comment.