As everyone already knows, Google released a new open-source web browser called Chrome.
Having interest in code reuse, I downloaded the source code and examined all the open-source libraries used.
Google Chrome browser shows excellent example of code reuse. I found that they use at least 25 different software libraries!
Here is the full list of libraries, along with relative paths to source code and short library descriptions. Many of the libraries have been patched by googlers; look for README.google files in each library directory for information about changes.
| Library | Relative Path | Description |
|---|---|---|
| Google Breakpad | /src/breakpad | An open-source multi-platform crash reporting system. |
| Google URL | /src/googleurl | A small library for parsing and canonicalizing URLs. |
| Skia | /src/skia | Vector graphics engine. |
| Google v8 | /src/v8 | Google’s open source JavaScript engine. V8 implements ECMAScript as specified in ECMA-262, 3rd edition, and runs on Windows XP and Vista, Mac OS X 10.5 (Leopard), and Linux systems that use IA-32 or ARM processors. V8 can run standalone, or can be embedded into any C++ application. |
| Webkit | /src/webki | Open source web browser engine. |
| Netscape Portable Runtime (NSPR) | /src/base/third_party/nspr | Netscape Portable Runtime (NSPR) provides a platform-neutral API for system level and libc like functions. |
| Network Security Services (NSS) | /src/base/third_party/nss | Network Security Services (NSS) is a set of libraries designed to support cross-platform development of security-enabled client and server applications. Applications built with NSS can support SSL v2 and v3, TLS, PKCS #5, PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509 v3 certificates, and other security standards. |
| Hunspell | /src/chrome/third_ party/hunspell |
Spell checker and morphological analyzer library and program designed for languages with rich morphology and complex word compounding or character encoding. |
| Windows Template Library | /src/chrome/third_party/wtl | C++ library for developing Windows applications and UI components. It extends ATL (Active Template Library) and provides a set of classes for controls, dialogs, frame windows, GDI objects, and more. |
| Google C++ Testing Framework | /src/testing/gtest | Google’s framework for writing C++ tests on a variety of platforms (Linux, Mac OS X, Windows, Windows CE, and Symbian). Based on the xUnit architecture. Supports automatic test discovery, a rich set of assertions, user-defined assertions, death tests, fatal and non-fatal failures, various options for running the tests, and XML test report generation. |
| bsdiff and bspatch | /src/third_party/bsdiff and /src/third_party/bspatch | bsdiff and bspatch are tools for building and applying patches to binary files. |
| bzip2 | /src/third_party/bzip2 | bzip2 compresses files using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding. |
| International Components for Unicode (ICU) | /src/third_party/icu38 | ICU is a mature, widely used set of C/C++ and Java libraries providing Unicode and Globalization support for software applications. |
| libjpeg | /src/third_party/libjpeg | Library for handling the JPEG (JFIF) image format. |
| libpng | /src/third_party/libpng | PNG image format library. It supports almost all PNG features, is extensible, and has been extensively tested for over 13 years. |
| libxml | /src/third_party/libxml | XML C parsing library. |
| libxslt | /src/third_party/libxslt | XSLT C library. |
| LZMA | /src/third_party/lzma_sdk | LZMA is the default and general compression method of 7z format in the 7-Zip program. |
| stringencoders | /src/third_party/modp_b64 | A collection of high performance c-string transformations (in this case, base 64 encoding/decoding), frequently 2x faster than standard implementations (if they exist at all). |
| Netscape Plugin Application Programming Interface (NPAPI) | /src/third_party/npapi | Cross-platform plugin architecture used by many web browsers. |
| Pthreads-w32 | /src/third_party/pthread | Application programming interface (API) for writing multithreaded applications |
| SCons - a software construction tool | /src/third_party/scons | Open Source software construction tool—that is, a next-generation build tool. Think of SCons as an improved, cross-platform substitute for the classic Make utility with integrated functionality similar to autoconf/automake and compiler caches such as ccache. |
| sqlite | /src/third_party/sqlite | Software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. |
| TLS Lite | /src/third_party/tlslite | Free Python library that implements SSL 3.0, TLS 1.0, and TLS 1.1. TLS Lite supports non-traditional authentication methods such as SRP, shared keys, and cryptoIDs in addition to X.509 certificates. Note: Python is not a part of Chrome. It’s used for testing various parts of Chrome browser, such as code coverage, dependencies, measures page load times, compares generated html, etc. |
| zlib | /src/third_party/zlib | zlib is designed to be a free, general-purpose, legally unencumbered — that is, not covered by any patents — lossless data-compression library for use on virtually any computer hardware and operating system. |
They have done a really good job making these libraries work together. As someone said, “good coders code, great reuse.”
I also found some other exciting things in the source, which I will soon post about. I recommend that you subscribe to my rss feed, if you are interested!
Talking about Chrome, I am waiting for Google to add capability to write extensions for their browser! I already made a list of extensions that I will try to create as soon as they add this feature.

(32 votes, average: 4.38 out of 5)
|
|
|


September 5th, 2008 at 10:20 am
Excellent collection of data.
Inspiring too. Yep, that guy said it well when he said “Good coders code, great reuse!”
Just curious, who said it?
September 5th, 2008 at 10:23 am
You have listed Netscape Portable Runtime (NSPR) twice, once at 6 and again at 8.
September 5th, 2008 at 10:52 am
[…] Per una lista completa e dettagliata vi consiglio di andare a vedere “Code Reuse in Google Chrome Browser“. […]
September 5th, 2008 at 10:54 am
Srikanth, I don’t know who said that! I just remember that I read somewhere “good coders code, great reuse” and it stuck in my memory. When I created my blog, I tried searching for the article but could not find it anymore!
Peter, thanks, I corrected that mistake.
September 5th, 2008 at 10:59 am
I found several other libraries too in code.
Dont know, if they are used directly or required by other tools/libs.
Not sure why you did not mention them.
bsdiff
bspatch
lighttpd
pthread
cygwin
September 5th, 2008 at 11:11 am
Vipsy, I surely did mention bsdiff, bspatch and pthread! I did not mention cygwin and lighttpd as they are not libraries…
September 5th, 2008 at 11:40 am
My Bad..
I did not read it thoroughly.
September 5th, 2008 at 11:46 am
“Windows Template Library” links to hunspell.
September 5th, 2008 at 11:53 am
Grrr, oops, this is what happens when copying and pasting pieces of html code repeatedly… Corrected now! Thanks!
September 5th, 2008 at 11:58 am
Umm, but they just copied the libraries inside their own tree? That’s good?
September 5th, 2008 at 1:19 pm
v, the licenses of the libraries they used allowed Google to include them in their source tree!
September 5th, 2008 at 1:26 pm
s/scr/src/g
September 5th, 2008 at 1:34 pm
me, hehe, collaborative mistake correction is going on here. Thanks, I s/scr/src/g’ed.
September 5th, 2008 at 1:48 pm
Excellent blog post!!
Do you see anywhere in the code where Google collects browsing habits of the user?
September 5th, 2008 at 2:08 pm
Google chrome code reuse nightmare
While some people think that Googles new open source webbrowser Chrome is a great example of code reuse I think the opposite is true. He found at least 25 open source libraries used by the Browser. So far this is not a problem but what is a problem is tha
September 5th, 2008 at 2:08 pm
hi there,
I look forward to your list of plugins you want to develop for Google Chrome.
BR,
~A
September 5th, 2008 at 3:15 pm
http://code.google.com/chromium/terms.html
September 5th, 2008 at 3:22 pm
Thanks for your comment, Dmitry. I did know about this page before I posted… Only later did I find out it existed (from reddit comments)!
September 5th, 2008 at 3:37 pm
I played with Chrome all day yesterday and my conclusion is that FireFox3 kicks Chrome to the curb!
Jeff
[spammy url removed]
September 5th, 2008 at 3:55 pm
Labais
September 5th, 2008 at 4:21 pm
Great read.
September 5th, 2008 at 4:46 pm
um…hows this reuse different from most other FOSS projects? Or is this another one of those “hey look at what everyone already knows” blogs
September 5th, 2008 at 4:57 pm
jon, you are welcome to see if it is one of the “what everyone knows blogs” by browsing around a little!
September 5th, 2008 at 5:07 pm
[…] a nice enumeration of all of the existing libraries that are used by […]
September 5th, 2008 at 5:50 pm
A Python library, but no libpython? How does that work? Do they compile it to their JS VM’s bytecode?
September 5th, 2008 at 6:05 pm
An add-op API was the first thing I was looking for and I was pretty disappointed to find none. I hope this was at least taken into account during their design otherwise I don’t think it will be easy to come up with a good add-on API and framework later. There are some concerns with their EULA too…
September 5th, 2008 at 6:19 pm
300 baud, I should have been more precise in my post. They use a lot of Python for testing various parts of Chrome, such as code coverage, dependencies, measures page load times, compares generated html, etc. I am updating the post now
September 5th, 2008 at 6:26 pm
I guess I should have figured out that the build time required python by the presence of scons. Was just hoping there was a python interpreter buried in the browser someplace.
September 5th, 2008 at 6:42 pm
You list “gzip2″, but I think you meant bzip2…
September 5th, 2008 at 6:46 pm
Does skia mean it handles svg natively?
September 5th, 2008 at 7:14 pm
I think you are just stroking Google’s ego. Many applications written for Linux use most of these libs. Rather, you might as well change your article’s title to “Google Chrome Browser uses many libraries”.
September 5th, 2008 at 7:15 pm
Adam, I have not yet examined skia that closely, as it seems that it was first released just with Chrome. I will look into it in the next few days.
Thanks for noticing the mistake, i corrected that!
September 5th, 2008 at 9:06 pm
Talent imitates, but genius steals. - T.S. Elliott.
September 5th, 2008 at 10:11 pm
Wow, very nice summary of the programming aspect of Chrome. Wonder why lighttpd is being used?
September 5th, 2008 at 11:45 pm
I really like the huge techie/blogger reaction that Google Chrome has caused. Everyone is tinkering and reviewing it.
September 5th, 2008 at 11:58 pm
[…] After pondering about where the Google Chrome download is and finding a version of it, I have finally found the Chrome Developer page, where you can get started with Chrome application development. (Thanks to post by Peteris!) […]
September 6th, 2008 at 12:02 am
[…] 5th, 2008 in Links A list of libraries used in Google’s Chrome browser. It looks like the UI is probably Win32 using the WTL. Also interesting: NPSR is used from the […]
September 6th, 2008 at 1:24 am
That’s along the lines of “Good designers borrow; great designers steal.”
September 6th, 2008 at 2:15 am
[…] about keeping it open and all that. Well, just how open is the sucker? How about super open. This savvy gentleman took Chrome apart and found evidence of 25 open source project libraries being used in its code. They really did take […]
September 6th, 2008 at 9:29 am
The quote is, “Good composers borrow, great composers steal.” It’s attributed to Igor Stravinsky. Stravinsky, true to his word, stole the phrase from T.S. Eliot, who wrote, “Good poets borrow, great poets steal.” Or perhaps from Pablo Picasso, who is reported to have said, “Good artists copy, great artists steal.”
September 6th, 2008 at 10:45 am
[…] Code Reuse in Google Chrome Browser - good coders code, great reuse (tags: google programming tips) […]
September 6th, 2008 at 12:56 pm
[…] post “Code Reuse in Google Chrome Browser” looks at al the external libraries used in Google Chrome. Apart from the obvious libraries WebKit […]
September 7th, 2008 at 7:54 am
[…] Another thing that Google did right is code-reuse. They did it extensivley throughout the code, using different open source and in-house code as you can see here. […]
September 7th, 2008 at 5:52 pm
[…] Code Reuse in Google Chrome Browser […]
September 8th, 2008 at 5:22 am
[…] out Peteris’ blog post for the […]
September 8th, 2008 at 3:19 pm
[…] http://www.catonmat.net/blog/code-reuse-in-google-chrome-browser/ : Google a utilisé beaucoup de bibliothèques existantes pour Chrome, et c’est une bonne chose […]
September 8th, 2008 at 5:48 pm
[…] 本来对我来说这就结束了,但是无意中看到这个链接,又来兴趣了:) […]
September 8th, 2008 at 7:44 pm
You folks are missing the point. The original (and unsourced) quote attributed to Picaso has lost its meaning in the translation. When he said “good artists copy, great artists steal” it was saying that good artists make a copy of the subject as they see it, but a great artist takes the subject and makes it their own through their own interpretation, enhancements, etc. To reuse a library is simply to borrow, and is naught but a nod toward expedience. Taking those libraries and improving on them or using them in a synergistic way that goes beyond their original purpose, that would be great artistry.
September 9th, 2008 at 8:26 am
[…] an interesting post which details the amount of code reuse that google has employed in the development of the […]
September 9th, 2008 at 6:36 pm
[…] the developer: The development side seems the more interesting place to look. See Peteris Krumin’s Blog. What Google is doing is cleaning up the web platform from the mess & confusion of the past, […]
September 12th, 2008 at 9:30 am
hello.
in there,chrome tips and tricks collections.
http://eurekatips.com/2008/09/10/google-chrome-tips-and-tricks-collections/
September 13th, 2008 at 4:49 am
Chrome Browser very good Browser,
i like it,
Thanks for make it.
September 14th, 2008 at 4:13 am
From vBharat.com » Code Reuse in Google Chrome Browser
Google Chrome browser shows excellent example of code reuse. I found that they use at least 25 different software libraries!
September 14th, 2008 at 11:41 am
[…] there are 25 open-source libraries and APIs responsible for the functions in Chrome. Programmer Peteris Krumins dug into the code and fills us in on how Google reused existing, freely available code libraries to build its […]
September 15th, 2008 at 1:38 pm
[…] answer is that Chrome is built on open source software. In fact, it uses at least 25 different software libraries! And we’re talking about simple little helper utilities, the open source dependencies include […]
September 15th, 2008 at 3:56 pm
[…] Code Reuse in Google Chrome Browser Tags: Google Chrome HTTPS, Google Chrome SSL […]
September 16th, 2008 at 1:08 pm
i keep learning about more and more little advantages and features with Chrome, with privacy, for example; now if only they would take care of it’s cookie management glitches…
September 21st, 2008 at 12:09 am
it’s funny, the more i use Chrome (for windows), the more unstable it seems to get… crashes a lot more, can’t handle sites with flash, hangs every time i close a tab… all that to say, i’m switching back to Firefox
September 26th, 2008 at 2:04 pm
I keep reading Good Artist… Talent imitates… and stealing. I see that Chrome, although it hasn’t replace firefox… yet, has some great potential. But I think it’s also created with a conscience, you cannot steal what is given away freely.
October 13th, 2008 at 2:14 pm
They’re using Mozilla’s code which they’re using against them actually because Chrome will take over Mozilla’s market once it’s fully developed.
November 14th, 2008 at 9:38 am
[…] Code Reuse in Google Chrome Browser […]
November 24th, 2008 at 1:44 pm
[…] after I published the “Code Reuse in Google Chrome” post I was contacted by a recruiter at Google. The email said: I recruit top notch Software […]
December 5th, 2008 at 6:17 pm
Peter, How can I miss this famous post; really a great collection of data. Thanks mate.
December 11th, 2008 at 10:36 pm
[…] blog post can certainly prompt contact from a recruiter. But don’t be distracted by the idea that all […]
December 18th, 2008 at 7:50 pm
Chrome Browser very good Browser,
i like it!!!
Axel
December 28th, 2008 at 4:54 pm
[…] is often said that “good coders code, great reuse” (see an example here). I definitely agree with this… unfortunately, too often, developers think that reusing code […]
December 29th, 2008 at 2:54 pm
Yes, code reuse is great when you know the code (so you can assure its good code) or when it comes from Google (haha just kidding)!
Nice set of toolkits at the Chrome browser! C++ is beautiful
December 31st, 2008 at 8:19 am
i want to change the chache directory of chrome using c/c++. i will be gratefull if anyone help me with code.