Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / base / BUILD.gn
index 7aa8659..28967db 100644 (file)
@@ -3,25 +3,30 @@
 # found in the LICENSE file.
 
 import("//build/config/ui.gni")
+import("//build/config/android/rules.gni")
 
 component("base") {
   sources = [
-    "../build/build_config.h",
     "third_party/dmg_fp/dmg_fp.h",
     "third_party/dmg_fp/g_fmt.cc",
     "third_party/dmg_fp/dtoa_wrapper.cc",
     "third_party/icu/icu_utf.cc",
     "third_party/icu/icu_utf.h",
+    "third_party/superfasthash/superfasthash.c",
     "allocator/allocator_extension.cc",
     "allocator/allocator_extension.h",
     "allocator/type_profiler_control.cc",
     "allocator/type_profiler_control.h",
-    "android/activity_status.cc",
-    "android/activity_status.h",
+    "android/application_status_listener.cc",
+    "android/application_status_listener.h",
     "android/base_jni_registrar.cc",
     "android/base_jni_registrar.h",
     "android/build_info.cc",
     "android/build_info.h",
+    "android/command_line_android.cc",
+    "android/command_line_android.h",
+    "android/content_uri_utils.cc",
+    "android/content_uri_utils.h",
     "android/cpu_features.cc",
     "android/fifo_utils.cc",
     "android/fifo_utils.h",
@@ -33,14 +38,18 @@ component("base") {
     "android/jni_android.h",
     "android/jni_array.cc",
     "android/jni_array.h",
-    "android/jni_helper.cc",
-    "android/jni_helper.h",
     "android/jni_registrar.cc",
     "android/jni_registrar.h",
     "android/jni_string.cc",
     "android/jni_string.h",
+    "android/jni_weak_ref.cc",
+    "android/jni_weak_ref.h",
+    "android/library_loader/library_loader_hooks.cc",
+    "android/library_loader/library_loader_hooks.h",
     "android/memory_pressure_listener_android.cc",
     "android/memory_pressure_listener_android.h",
+    "android/java_handler_thread.cc",
+    "android/java_handler_thread.h",
     "android/path_service_android.cc",
     "android/path_service_android.h",
     "android/path_utils.cc",
@@ -76,6 +85,8 @@ component("base") {
     "base64.cc",
     "base64.h",
     "basictypes.h",
+    "big_endian.cc",
+    "big_endian.h",
     "bind.h",
     "bind_helpers.cc",
     "bind_helpers.h",
@@ -100,13 +111,11 @@ component("base") {
     "cpu.cc",
     "cpu.h",
     "critical_closure.h",
-    "critical_closure_ios.mm",
+    "critical_closure_internal_ios.mm",
     "debug/alias.cc",
     "debug/alias.h",
     "debug/crash_logging.cc",
     "debug/crash_logging.h",
-    "debug/debug_on_start_win.cc",
-    "debug/debug_on_start_win.h",
     "debug/debugger.cc",
     "debug/debugger.h",
     "debug/debugger_posix.cc",
@@ -268,8 +277,6 @@ component("base") {
     "memory/aligned_memory.h",
     "memory/discardable_memory.cc",
     "memory/discardable_memory.h",
-    "memory/discardable_memory_allocator_android.cc",
-    "memory/discardable_memory_allocator_android.h",
     "memory/discardable_memory_android.cc",
     "memory/discardable_memory_emulated.cc",
     "memory/discardable_memory_emulated.h",
@@ -329,12 +336,8 @@ component("base") {
     "message_loop/message_pump_mac.h",
     "message_loop/message_pump_mac.mm",
     "message_loop/message_pump_observer.h",
-    "message_loop/message_pump_ozone.cc",
-    "message_loop/message_pump_ozone.h",
     "message_loop/message_pump_win.cc",
     "message_loop/message_pump_win.h",
-    "message_loop/message_pump_x11.cc",
-    "message_loop/message_pump_x11.h",
     "metrics/field_trial.cc",
     "metrics/field_trial.h",
     "metrics/sample_map.cc",
@@ -368,6 +371,10 @@ component("base") {
     "native_library_mac.mm",
     "native_library_posix.cc",
     "native_library_win.cc",
+    "numerics/safe_conversions.h",
+    "numerics/safe_conversions_impl.h",
+    "numerics/safe_math.h",
+    "numerics/safe_math_impl.h",
     "nix/mime_util_xdg.cc",
     "nix/mime_util_xdg.h",
     "nix/xdg_util.cc",
@@ -391,7 +398,6 @@ component("base") {
     "port.h",
     "posix/eintr_wrapper.h",
     "posix/file_descriptor_shuffle.cc",
-    "posix/file_descriptor_shuffle.y",
     "posix/global_descriptors.cc",
     "posix/global_descriptors.h",
     "posix/unix_domain_socket_linux.cc",
@@ -422,6 +428,7 @@ component("base") {
     "process/launch_mac.cc",
     "process/launch_posix.cc",
     "process/launch_win.cc",
+    "process/memory.cc",
     "process/memory.h",
     "process/memory_linux.cc",
     "process/memory_mac.mm",
@@ -453,7 +460,6 @@ component("base") {
     "process/process_metrics_posix.cc",
     "process/process_metrics_win.cc",
     "process/process_posix.cc",
-    "process/process_util.h",
     "process/process_win.cc",
     "profiler/scoped_profile.cc",
     "profiler/scoped_profile.h",
@@ -468,7 +474,6 @@ component("base") {
     "rand_util_win.cc",
     "run_loop.cc",
     "run_loop.h",
-    "safe_numerics.h",
     "safe_strerror_posix.cc",
     "safe_strerror_posix.h",
     "scoped_generic.h",
@@ -708,9 +713,14 @@ component("base") {
     "//third_party/modp_b64",
   ]
 
-  if (!is_chromeos) {
+  if (is_android) {
+    deps += [
+      ":base_jni_headers",
+      "//third_party/android_tools:cpu_features"
+    ]
+
     sources -= [
-      "sys_info_chromeos.cc",
+      "debug/stack_trace_posix.cc",
     ]
   }
 
@@ -755,6 +765,9 @@ component("base") {
     if (is_component_build) {
       sources -= [ "debug/debug_on_start_win.cc" ]
     }
+
+    # Needed by win_util.h
+    libs = [ "netapi32.lib" ]
   } else if (!is_nacl) {
     # Non-Windows.
     deps += [ "//third_party/libevent" ]
@@ -782,18 +795,6 @@ component("base") {
     if (toolkit_uses_gtk) {
       linux_configs += [ "//build/config/linux:gtk" ]
     }
-    if (use_x11) {
-      linux_configs += [
-        "//build/config/linux:x11",
-      ]
-    } else {
-      # On non-Linux platforms, the X11 files will already have been filtered
-      # out using the sources assignment filter.
-      sources -= [
-        "message_loop/message_pump_x11.cc",
-        "message_loop/message_pump_x11.h",
-      ]
-    }
 
     configs += linux_configs
     all_dependent_configs = linux_configs
@@ -823,12 +824,6 @@ component("base") {
       "message_loop/message_pump_glib.h",
     ]
   }
-  if (!use_ozone) {
-    sources -= [
-      "message_loop/message_pump_ozone.cc",
-      "message_loop/message_pump_ozone.h",
-    ]
-  }
   if (!toolkit_uses_gtk) {
     sources -= [
       "message_loop/message_pump_gtk.cc",
@@ -840,7 +835,7 @@ component("base") {
 # This is the subset of files from base that should not be used with a dynamic
 # library. Note that this library cannot depend on base because base depends on
 # base_static.
-static_library("base_static") {
+source_set("base_static") {
   sources = [
     "base_switches.cc",
     "base_switches.h",
@@ -849,19 +844,22 @@ static_library("base_static") {
   ]
 }
 
-component("base_i18n") {
+component("i18n") {
+  output_name = "base_i18n"
   sources = [
     "i18n/base_i18n_export.h",
     "i18n/bidi_line_iterator.cc",
     "i18n/bidi_line_iterator.h",
     "i18n/break_iterator.cc",
     "i18n/break_iterator.h",
-    "i18n/char_iterator.cc",
-    "i18n/char_iterator.h",
     "i18n/case_conversion.cc",
     "i18n/case_conversion.h",
+    "i18n/char_iterator.cc",
+    "i18n/char_iterator.h",
     "i18n/file_util_icu.cc",
     "i18n/file_util_icu.h",
+    "i18n/i18n_constants.cc",
+    "i18n/i18n_constants.h",
     "i18n/icu_encoding_detection.cc",
     "i18n/icu_encoding_detection.h",
     "i18n/icu_string_conversions.cc",
@@ -872,20 +870,25 @@ component("base_i18n") {
     "i18n/number_formatting.h",
     "i18n/rtl.cc",
     "i18n/rtl.h",
+    "i18n/streaming_utf8_validator.cc",
+    "i18n/streaming_utf8_validator.h",
     "i18n/string_compare.cc",
     "i18n/string_compare.h",
     "i18n/string_search.cc",
     "i18n/string_search.h",
     "i18n/time_formatting.cc",
     "i18n/time_formatting.h",
+    "i18n/timezone.cc",
+    "i18n/timezone.h",
+    "i18n/utf8_validator_tables.cc",
+    "i18n/utf8_validator_tables.h",
   ]
   defines = [ "BASE_I18N_IMPLEMENTATION" ]
   configs += [ "//build/config/compiler:wexit_time_destructors" ]
   deps = [
     ":base",
     "//base/third_party/dynamic_annotations",
-    "//third_party/icu:icui18n",
-    "//third_party/icu:icuuc",
+    "//third_party/icu",
   ]
 
   if (toolkit_uses_gtk) {
@@ -905,3 +908,27 @@ component("base_i18n") {
   #  'optimize': 'max',
   #},
 }
+
+if (is_android) {
+  generate_jni("base_jni_headers") {
+    sources = [
+      "android/java/src/org/chromium/base/ApplicationStatus.java",
+      "android/java/src/org/chromium/base/BuildInfo.java",
+      "android/java/src/org/chromium/base/CommandLine.java",
+      "android/java/src/org/chromium/base/ContentUriUtils.java",
+      "android/java/src/org/chromium/base/CpuFeatures.java",
+      "android/java/src/org/chromium/base/ImportantFileWriterAndroid.java",
+      "android/java/src/org/chromium/base/library_loader/LibraryLoader.java",
+      "android/java/src/org/chromium/base/MemoryPressureListener.java",
+      "android/java/src/org/chromium/base/JavaHandlerThread.java",
+      "android/java/src/org/chromium/base/PathService.java",
+      "android/java/src/org/chromium/base/PathUtils.java",
+      "android/java/src/org/chromium/base/PowerMonitor.java",
+      "android/java/src/org/chromium/base/SystemMessageHandler.java",
+      "android/java/src/org/chromium/base/SysUtils.java",
+      "android/java/src/org/chromium/base/ThreadUtils.java",
+      "android/java/src/org/chromium/base/TraceEvent.java",
+    ]
+    jni_package = "base"
+  }
+}