summaryrefslogtreecommitdiffstats
path: root/third_party/libphonenumber
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/libphonenumber')
-rw-r--r--third_party/libphonenumber/README.chromium22
-rw-r--r--third_party/libphonenumber/libphonenumber.gyp64
-rw-r--r--third_party/libphonenumber/patches/version277a.patch21
-rw-r--r--third_party/libphonenumber/src/LICENSE13
-rw-r--r--third_party/libphonenumber/src/phonenumber_api.h13
5 files changed, 59 insertions, 74 deletions
diff --git a/third_party/libphonenumber/README.chromium b/third_party/libphonenumber/README.chromium
index 94700e8..e662452 100644
--- a/third_party/libphonenumber/README.chromium
+++ b/third_party/libphonenumber/README.chromium
@@ -2,7 +2,7 @@ Name: International Phone Number Library
Short Name: libphonenumber
URL: http://libphonenumber.googlecode.com/svn/trunk/
Version: unknown
-Revision: 403
+Revision: 277
Security Critical: yes
This directory contains the source code of International Phone Number Library
@@ -17,13 +17,15 @@ This library depends on
Additional files, not in the original library:
libphonenumber.gyp
README.chromium
- src/LICENSE # Taken from http://code.google.com/p/libphonenumber.
- src/phonenumber_api.h
-The library is mapped through the DEPS file into src/ folder. To update:
-1. Get the latest version number from
- http://code.google.com/p/libphonenumber/source/list
-2. Locally update this file and DEPS.
-3. run 'gclient sync'
-4. Adjust libphonenumber.gyp if necessary.
-5. Verify that all compiles and all of the tests are successfull.
+Until the changes are upstreamed library is included directly, with patches
+in patches/version277.patch and patches/version277a.patch applied.
+
+The folders included in our repository for now are
+ cpp/
+ resource/
+
+TODO(georgey) : remove following lines when updated to version after 186
+ cpp/src/phonelibutil.cc made icu::Transliteration member of PhoneUtil
+ to improve performance, Not needed in recent versions.
+
diff --git a/third_party/libphonenumber/libphonenumber.gyp b/third_party/libphonenumber/libphonenumber.gyp
index d5a4bf5..92415da 100644
--- a/third_party/libphonenumber/libphonenumber.gyp
+++ b/third_party/libphonenumber/libphonenumber.gyp
@@ -8,17 +8,15 @@
'../..', # add it first, so src/base headers are used instead of the ones
# brought with the library as cc files would be taken from the
# main chrome tree as well.
- 'src',
- 'src/test',
+ 'cpp/src',
# The libphonenumber source (and test code) expects the
- # generated protocol headers to be available with "phonenumbers" include
- # path, e.g. #include "phonenumbers/foo.pb.h".
+ # generated protocol headers to be available with no include
+ # path, e.g. #include "foo.pb.h".
'<(SHARED_INTERMEDIATE_DIR)/protoc_out/third_party/libphonenumber',
],
'defines': [
'USE_HASH_MAP=1',
'USE_GOOGLE_BASE=1',
- 'USE_ICU_REGEXP=1',
],
},
'includes': [
@@ -34,36 +32,32 @@
'../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
],
'sources': [
- 'src/phonenumbers/asyoutypeformatter.cc',
- 'src/phonenumbers/default_logger.cc',
- # Comment next line and uncomment the line after, if complete metadata
- # (with examples) is needed.
- 'src/phonenumbers/lite_metadata.cc',
- #'src/phonenumbers/metadata.cc',
- 'src/phonenumbers/logger.cc',
- 'src/phonenumbers/phonenumber.cc',
- # The following two files should be added on 'as needed' basis.
- #'src/phonenumbers/phonenumbermatch.cc',
- #'src/phonenumbers/phonenumbermatcher.cc',
- 'src/phonenumbers/phonenumberutil.cc',
- 'src/phonenumbers/regexp_adapter_icu.cc',
- 'src/phonenumbers/regexp_cache.cc',
- 'src/phonenumbers/stringutil.cc',
- 'src/phonenumbers/unicodestring.cc',
- 'src/phonenumbers/utf/rune.c',
- 'src/phonenumbers/utf/unicodetext.cc',
- 'src/phonenumbers/utf/unilib.cc',
- 'src/resources/phonemetadata.proto',
- 'src/resources/phonenumber.proto',
+ # 'chrome/regexp_adapter_icuregexp.cc',
+ 'cpp/src/default_logger.cc',
+ 'cpp/src/lite_metadata.cc',
+ 'cpp/src/logger.cc',
+ 'cpp/src/phonenumber.cc',
+ 'cpp/src/phonenumberutil.cc',
+ 'cpp/src/regexp_adapter_icu.cc',
+ 'cpp/src/regexp_cache.cc',
+ 'cpp/src/stringutil.cc',
+ 'cpp/src/utf/rune.c',
+ 'cpp/src/utf/unicodetext.cc',
+ 'cpp/src/utf/unilib.cc',
+ 'resources/phonemetadata.proto',
+ 'resources/phonenumber.proto',
],
'direct_dependent_settings': {
'include_dirs': [
+ # The libphonenumber headers expect generated protocol headers
+ # to be available with no include path, e.g. #include
+ # "foo.pb.h".
'<(SHARED_INTERMEDIATE_DIR)/protoc_out/third_party/libphonenumber',
],
},
'variables': {
- 'proto_in_dir': 'src/resources',
- 'proto_out_dir': 'third_party/libphonenumber/phonenumbers',
+ 'proto_in_dir': 'resources',
+ 'proto_out_dir': 'third_party/libphonenumber',
},
'includes': [ '../../build/protoc.gypi' ],
'conditions': [
@@ -79,16 +73,10 @@
'type': 'executable',
'sources': [
'../../base/test/run_all_unittests.cc',
- 'src/phonenumbers/test_metadata.cc',
- 'src/test/phonenumbers/asyoutypeformatter_test.cc',
- # The following two files should be added on 'as needed' basis.
- #'src/test/phonenumbers/phonenumbermatch_test.cc',
- #'src/test/phonenumbers/phonenumbermatcher_test.cc',
- 'src/test/phonenumbers/phonenumberutil_test.cc',
- 'src/test/phonenumbers/regexp_adapter_test.cc',
- 'src/test/phonenumbers/stringutil_test.cc',
- 'src/test/phonenumbers/test_util.cc',
- 'src/test/phonenumbers/unicodestring_test.cc',
+ 'cpp/src/phonenumberutil_test.cc',
+ 'cpp/src/regexp_adapter_test.cc',
+ 'cpp/src/stringutil_test.cc',
+ 'cpp/src/test_metadata.cc',
],
'dependencies': [
'../icu/icu.gyp:icui18n',
diff --git a/third_party/libphonenumber/patches/version277a.patch b/third_party/libphonenumber/patches/version277a.patch
new file mode 100644
index 0000000..8757107
--- /dev/null
+++ b/third_party/libphonenumber/patches/version277a.patch
@@ -0,0 +1,21 @@
+diff -Naur src-orig/default_logger.h src/default_logger.h
+--- src-orig/default_logger.h 2011-07-02 16:27:58.000000000 -0700
++++ src/default_logger.h 2011-07-02 16:28:29.000000000 -0700
+@@ -17,6 +17,8 @@
+ #ifndef I18N_PHONENUMBERS_DEFAULT_LOGGER_H_
+ #define I18N_PHONENUMBERS_DEFAULT_LOGGER_H_
+
++#include <stdio.h>
++
+ #include <string>
+
+ #include "logger.h"
+@@ -45,7 +47,7 @@
+ struct ConvertToString<int> {
+ static inline string DoWork(const int& n) {
+ char buffer[16];
+- std::snprintf(buffer, sizeof(buffer), "%d", n);
++ snprintf(buffer, sizeof(buffer), "%d", n);
+ return string(buffer);
+ }
+ };
diff --git a/third_party/libphonenumber/src/LICENSE b/third_party/libphonenumber/src/LICENSE
deleted file mode 100644
index 145f008..0000000
--- a/third_party/libphonenumber/src/LICENSE
+++ /dev/null
@@ -1,13 +0,0 @@
-Copyright (C) 2011 Google Inc.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
diff --git a/third_party/libphonenumber/src/phonenumber_api.h b/third_party/libphonenumber/src/phonenumber_api.h
deleted file mode 100644
index 4a7fcd1..0000000
--- a/third_party/libphonenumber/src/phonenumber_api.h
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright (c) 2011 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.
-
-#ifndef THIRD_PARTY_LIBPHONENUMBER_SRC_PHONENUMBER_API_H_
-#define THIRD_PARTY_LIBPHONENUMBER_SRC_PHONENUMBER_API_H_
-#pragma once
-
-#define USE_GOOGLE_BASE
-#include "third_party/libphonenumber/src/phonenumbers/phonenumberutil.h"
-#undef USE_GOOGLE_BASE
-
-#endif // THIRD_PARTY_LIBPHONENUMBER_SRC_PHONENUMBER_API_H_