Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update chromium source #34

Merged
merged 52 commits into from
Jul 23, 2018
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
adc9fec
rename source code folder, add submodules from chromium repo
malloxpb Jul 11, 2018
c29c364
add missing headers
malloxpb Jul 11, 2018
833ac7b
compile cython
malloxpb Jul 11, 2018
fac3fb1
change vendor folder name (it contains submodules)
malloxpb Jul 11, 2018
f1ee5af
update submodules
malloxpb Jul 12, 2018
34eba19
change submodule branch
malloxpb Jul 13, 2018
28da14c
rollback gitsubmodule
malloxpb Jul 13, 2018
45f2aba
update submodules branch
malloxpb Jul 13, 2018
9055c2c
gather all the sources using glob
malloxpb Jul 13, 2018
85e3b51
compile cython
malloxpb Jul 13, 2018
1e8bc2c
update submodule
malloxpb Jul 13, 2018
d6c3aa0
update submodule
malloxpb Jul 13, 2018
02d83a1
update submodule
malloxpb Jul 13, 2018
4e48461
update submodule
malloxpb Jul 13, 2018
e77aff9
update submodules
malloxpb Jul 13, 2018
09a74bc
modify url folder only
malloxpb Jul 13, 2018
f11ecc5
update submodules url
malloxpb Jul 16, 2018
00333a7
add files that needed only
malloxpb Jul 16, 2018
051f350
save progress
malloxpb Jul 17, 2018
8a3cdfa
add third_party submodule
malloxpb Jul 17, 2018
e2e8c57
remove third_party
malloxpb Jul 17, 2018
9a14ea8
add third_party
malloxpb Jul 18, 2018
1456c82
remove third_party
malloxpb Jul 18, 2018
e5ce35a
update submodule
malloxpb Jul 19, 2018
aff8850
update submodules
malloxpb Jul 19, 2018
2b1639a
update submodule
malloxpb Jul 19, 2018
1603260
update submodules, start the doc for the submodules
malloxpb Jul 20, 2018
91e4882
list all the source files needed
malloxpb Jul 20, 2018
81778f9
fix travis build
malloxpb Jul 20, 2018
1fe6843
fix travis build
malloxpb Jul 20, 2018
d1731a9
fix travis build
malloxpb Jul 20, 2018
392280b
fix travis build
malloxpb Jul 20, 2018
445ed4b
change compile option
malloxpb Jul 20, 2018
539452b
fix travis build
malloxpb Jul 20, 2018
ff38db0
it must be gnu++14
malloxpb Jul 20, 2018
fc98795
update doc for the submodules
malloxpb Jul 20, 2018
9c4edea
update submodules
malloxpb Jul 20, 2018
fac1767
update submodules
malloxpb Jul 20, 2018
5b7fc4f
update submodules
malloxpb Jul 20, 2018
745fca0
update submodules
malloxpb Jul 20, 2018
c301c1d
update submodule
malloxpb Jul 20, 2018
f490612
update travis build
malloxpb Jul 20, 2018
4138321
change to c++14
malloxpb Jul 20, 2018
dd9684b
fix travis build
malloxpb Jul 20, 2018
f821e69
try to redo the symlink
malloxpb Jul 20, 2018
768c298
do gcc instead
malloxpb Jul 20, 2018
7a76193
change travis
malloxpb Jul 20, 2018
5b4ebbd
rebuild travis
malloxpb Jul 20, 2018
9d97ec4
update travis
malloxpb Jul 20, 2018
d0c608e
fix travis config
malloxpb Jul 20, 2018
6a9ba51
update submodules
malloxpb Jul 23, 2018
05a5c95
update submodules
malloxpb Jul 23, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "third_party/chromium/url"]
path = third_party/chromium/url
url = https://github.com/nctl144/url-chromium
[submodule "third_party/chromium/base"]
path = third_party/chromium/base
url = https://github.com/nctl144/base-chromium
51 changes: 32 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: python
sudo: false
sudo: required
branches:
only:
- master
Expand All @@ -19,24 +19,37 @@ matrix:
env: TOXENV=pypy3
- python: 3.6
env: TOXENV=py36
dist: trusty
install:
- |
if [ "$TOXENV" = "pypy" ]; then
export PYPY_VERSION="pypy-6.0.0-linux_x86_64-portable"
wget "https://bitbucket.org/squeaky/portable-pypy/downloads/${PYPY_VERSION}.tar.bz2"
tar -jxf ${PYPY_VERSION}.tar.bz2
virtualenv --python="$PYPY_VERSION/bin/pypy" "$HOME/virtualenvs/$PYPY_VERSION"
source "$HOME/virtualenvs/$PYPY_VERSION/bin/activate"
fi
if [ "$TOXENV" = "pypy3" ]; then
export PYPY_VERSION="pypy3.5-5.9-beta-linux_x86_64-portable"
wget "https://bitbucket.org/squeaky/portable-pypy/downloads/${PYPY_VERSION}.tar.bz2"
tar -jxf ${PYPY_VERSION}.tar.bz2
virtualenv --python="$PYPY_VERSION/bin/pypy3" "$HOME/virtualenvs/$PYPY_VERSION"
source "$HOME/virtualenvs/$PYPY_VERSION/bin/activate"
fi
- pip install -U pip tox Cython codecov
- |
if [ "$TOXENV" = "pypy" ]; then
export PYPY_VERSION="pypy-6.0.0-linux_x86_64-portable"
wget "https://bitbucket.org/squeaky/portable-pypy/downloads/${PYPY_VERSION}.tar.bz2"
tar -jxf ${PYPY_VERSION}.tar.bz2
virtualenv --python="$PYPY_VERSION/bin/pypy" "$HOME/virtualenvs/$PYPY_VERSION"
source "$HOME/virtualenvs/$PYPY_VERSION/bin/activate"
fi
if [ "$TOXENV" = "pypy3" ]; then
export PYPY_VERSION="pypy3.5-5.9-beta-linux_x86_64-portable"
wget "https://bitbucket.org/squeaky/portable-pypy/downloads/${PYPY_VERSION}.tar.bz2"
tar -jxf ${PYPY_VERSION}.tar.bz2
virtualenv --python="$PYPY_VERSION/bin/pypy3" "$HOME/virtualenvs/$PYPY_VERSION"
source "$HOME/virtualenvs/$PYPY_VERSION/bin/activate"
fi
- pip install -U pip tox Cython codecov
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-5
- g++-5
before_install: sudo apt-get update -qq
script:
- tox
- sudo unlink /usr/bin/gcc && sudo ln -s /usr/bin/gcc-5 /usr/bin/gcc
- sudo unlink /usr/bin/g++ && sudo ln -s /usr/bin/g++-5 /usr/bin/g++
- gcc --version
- g++ --version
- tox
after_success:
- codecov
- codecov
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
recursive-include vendor *.cpp *.h *.cc
recursive-include third_party *.cpp *.h *.cc
recursive-include scurl *.pxd *.pyx *.cpp
include README.md
include LICENSE
6 changes: 3 additions & 3 deletions scurl/canonicalize.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 48 additions & 42 deletions scurl/cgurl.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scurl/chromium_gurl.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ from libcpp cimport bool
from mozilla_url_parse cimport Component, Parsed


cdef extern from "../vendor/gurl/url/gurl.h":
cdef extern from "../third_party/chromium/url/gurl.h":
cdef cppclass GURL:
GURL()
GURL(const string & url_string)
Expand Down
2 changes: 1 addition & 1 deletion scurl/chromium_url_canon.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ from mozilla_url_parse cimport Component, Parsed
from chromium_url_canon_stdstring cimport StdStringCanonOutput


cdef extern from "../vendor/gurl/url/url_canon.h" namespace "url":
cdef extern from "../third_party/chromium/url/url_canon.h" namespace "url":
cdef cppclass CanonOutputT:
pass

Expand Down
2 changes: 1 addition & 1 deletion scurl/chromium_url_canon_stdstring.pxd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from libcpp.string cimport string


cdef extern from "../vendor/gurl/url/url_canon_stdstring.h" namespace "url":
cdef extern from "../third_party/chromium/url/url_canon_stdstring.h" namespace "url":
cdef cppclass StdStringCanonOutput:
StdStringCanonOutput()
StdStringCanonOutput(string* str)
Expand Down
2 changes: 1 addition & 1 deletion scurl/chromium_url_constant.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ from libcpp cimport bool
from mozilla_url_parse cimport Component, Parsed


cdef extern from "../vendor/gurl/url/url_constants.h" namespace "url":
cdef extern from "../third_party/chromium/url/url_constants.h" namespace "url":

extern const char kAboutBlankURL[];

Expand Down
2 changes: 1 addition & 1 deletion scurl/chromium_url_util.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ from chromium_url_canon cimport CharsetConverter
from chromium_url_canon_stdstring cimport StdStringCanonOutput


cdef extern from "../vendor/gurl/url/url_util.h" namespace "url":
cdef extern from "../third_party/chromium/url/url_util.h" namespace "url":
cdef bool IsStandard(const char* spec, const Component& scheme)
cdef bool Canonicalize(const char* spec,
int spec_len,
Expand Down
2 changes: 1 addition & 1 deletion scurl/chromium_url_util_internal.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ from libcpp cimport bool
from mozilla_url_parse cimport Component, Parsed


cdef extern from "../vendor/gurl/url/url_util_internal.h" namespace "url":
cdef extern from "../third_party/chromium/url/url_util_internal.h" namespace "url":
cdef bool CompareSchemeComponent(const char* spec,
const Component& component,
const char* compare_to)
2 changes: 1 addition & 1 deletion scurl/mozilla_url_parse.pxd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from libcpp cimport bool


cdef extern from "../vendor/gurl/url/third_party/mozilla/url_parse.h" namespace "url":
cdef extern from "../third_party/chromium/url/third_party/mozilla/url_parse.h" namespace "url":
cdef struct Component:
int begin
int len
Expand Down
72 changes: 41 additions & 31 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from os.path import splitext
import logging
import platform
from glob import glob

VERSION = "0.1.0"
ext_macros = []
Expand All @@ -24,49 +25,58 @@
logger.warning('Warning: Enabling line tracing in Cython extension.\
This will make the performance of the library less effective!')

ext_sources = [
'scurl/cgurl.pyx',
'third_party/chromium/base/callback_internal.cc',
'third_party/chromium/base/at_exit.cc',
'third_party/chromium/base/lazy_instance_helpers.cc',
'third_party/chromium/base/strings/utf_string_conversion_utils.cc',
'third_party/chromium/base/strings/string_piece.cc',
'third_party/chromium/base/strings/string16.cc',
'third_party/chromium/base/strings/string_util.cc',
'third_party/chromium/base/strings/utf_string_conversions.cc',
'third_party/chromium/base/strings/string_util_constants.cc',
'third_party/chromium/base/third_party/icu/icu_utf.cc',
'third_party/chromium/url/gurl.cc',
'third_party/chromium/url/url_canon.cc',
'third_party/chromium/url/url_canon_etc.cc',
# 'third_party/chromium/url/url_canon_icu.cc',
'third_party/chromium/url/url_canon_filesystemurl.cc',
'third_party/chromium/url/url_canon_fileurl.cc',
'third_party/chromium/url/url_canon_host.cc',
'third_party/chromium/url/url_canon_internal.cc',
'third_party/chromium/url/url_canon_ip.cc',
'third_party/chromium/url/url_canon_mailtourl.cc',
'third_party/chromium/url/url_canon_path.cc',
'third_party/chromium/url/url_canon_pathurl.cc',
'third_party/chromium/url/url_canon_query.cc',
'third_party/chromium/url/url_canon_relative.cc',
'third_party/chromium/url/url_canon_stdstring.cc',
'third_party/chromium/url/url_canon_stdurl.cc',
'third_party/chromium/url/url_constants.cc',
'third_party/chromium/url/url_parse_file.cc',
'third_party/chromium/url/url_util.cc',
'third_party/chromium/url/third_party/mozilla/url_parse.cc',
]

extension = [
Extension(
name="scurl.cgurl",
sources=["scurl/cgurl.pyx",
"vendor/gurl/base/third_party/icu/icu_utf.cc",
"vendor/gurl/base/strings/string16.cc",
"vendor/gurl/base/strings/string_piece.cc",
"vendor/gurl/base/strings/string_util.cc",
"vendor/gurl/base/strings/utf_string_conversions.cc",
"vendor/gurl/base/strings/utf_string_conversion_utils.cc",
"vendor/gurl/url/gurl.cc",
"vendor/gurl/url/url_canon_etc.cc",
"vendor/gurl/url/url_canon_filesystemurl.cc",
"vendor/gurl/url/url_canon_fileurl.cc",
"vendor/gurl/url/url_canon_host.cc",
"vendor/gurl/url/url_canon_internal.cc",
"vendor/gurl/url/url_canon_ip.cc",
"vendor/gurl/url/url_canon_mailtourl.cc",
"vendor/gurl/url/url_canon_path.cc",
"vendor/gurl/url/url_canon_pathurl.cc",
"vendor/gurl/url/url_canon_query.cc",
"vendor/gurl/url/url_canon_relative.cc",
"vendor/gurl/url/url_canon_stdstring.cc",
"vendor/gurl/url/url_canon_stdurl.cc",
"vendor/gurl/url/url_constants.cc",
"vendor/gurl/url/url_parse_file.cc",
"vendor/gurl/url/url_util.cc",
"vendor/gurl/url/third_party/mozilla/url_parse.cc"
],
sources=ext_sources,
language="c++",
extra_compile_args=["-std=gnu++0x", "-I./vendor/gurl/",
"-fPIC", "-Ofast", "-pthread", "-w"],
extra_link_args=["-std=gnu++0x", "-w"],
extra_compile_args=["-std=gnu++14", "-I./third_party/chromium/",
"-fPIC", "-Ofast", "-pthread", "-w", '-DU_COMMON_IMPLEMENTATION'],
extra_link_args=["-std=gnu++14", "-w"],
include_dirs=['.'],
define_macros=ext_macros
),
Extension(
name="scurl.canonicalize",
sources=["scurl/canonicalize.pyx"],
language="c++",
extra_compile_args=["-std=gnu++0x", "-I./vendor/gurl/",
extra_compile_args=["-std=gnu++14", "-I./third_party/chromium/",
"-fPIC", "-Ofast", "-pthread", "-w"],
extra_link_args=["-std=gnu++0x", "-w"],
extra_link_args=["-std=gnu++14", "-w"],
include_dirs=['.'],
define_macros=ext_macros
)
Expand Down
16 changes: 16 additions & 0 deletions third_party/chromium/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Notes on updating the chromium source for SCURL project

Updating the source for the project might be a lot of work. But sometimes there might be a lot of functionality
implemented in the chromium source code that we might miss if we don't update it regularly

Here are the forked repository of the base component and the url component:

+ [base-chromium](https://github.com/nctl144/base-chromium)
+ [url-chromium](https://github.com/nctl144/url-chromium)

Since base component is really large and we might not even need all of the components defined in it, there are a
few functions/files that we need to skip:

+ YieldCurrentThread
+ lock
+ platforms-related components
1 change: 1 addition & 0 deletions third_party/chromium/base
Submodule base added at e5e68b
Loading