Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

Create Account  |  Retrieve Password

Examining Chrome's Source Code

Posted by Soulskill on Sat Sep 13, 2008 07:04 AM
from the work-in-progress dept.
An anonymous reader writes "Chrome is open source, and there's clearly still some work to be done on it. In this article, Neil McAllister decided to take a peek under Chrome's hood and view it through the eyes of the developers who will improve and maintain it in the coming years. It seems Google's open source browser currently has much to offer prospective hackers — provided they use Windows. Quoting: 'The Chromium site explains how to download the source code for Linux, Mac OS X, or Windows. Unfortunately, if you're eagerly awaiting a Mac version of Chrome, you shouldn't hold your breath. As the Mac OS X area of the Chromium developer site explains, "Right now, the Mac build is a work in progress that is much closer to the start than the finish." In fact, according to the latest status report, the Chrome developers have yet to get even the browser core running under Mac OS X. Rendering actual Web pages is still a long way off, to say nothing of a usable Aqua GUI. Then again, the Linux version is in arguably even worse shape.'"
+ -
story

Related Stories

This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More
Loading... please wait.
  • How can it be? After all it's based on Webkit.
  • by Anonymous Coward on Saturday September 13 2008, @07:10AM (#24989411)

    They still have a near monopoly on the entire Linux desktop market!

    • by Simias (953970) on Saturday September 13 2008, @07:16AM (#24989439)

      And google is really happy with that. They don't need to target the linux market because Mozilla is already working for them here.

      The target is obviously internet explorer.

      • by wisty (1335733) on Saturday September 13 2008, @07:37AM (#24989553)
        And they don't want to destroy the innovative, anti-Microsoft, pro-Google Firefox or Safari browsers. No sensible parasite kills its host. They only want to take down IE, which drives traffic to MS search.
      • by Firehed (942385) on Saturday September 13 2008, @09:24AM (#24990195) Homepage

        But of the eleventy billion IE users who still haven't switch to !IE, why would they switch to Chrome? I think the vast majority of them can be split into two groups: their bank/intranet/some stupid thing/fucking activex/etc doesn't work right elsewhere, and "the blue e takes me to the internet!". The first group can't switch and the second just doesn't care - why/how would Chrome change that?

      • by kripkenstein (913150) on Saturday September 13 2008, @09:55AM (#24990439) Homepage

        And google is really happy with that. They don't need to target the linux market because Mozilla is already working for them here.

        The target is obviously internet explorer.

        I disagree for two reasons.

        First, we can only presume Google wants Chrome to run on Android, Google's handset OS. Which is based on Linux. So clearly Google has a direct and powerful motivation to target Linux with Chrome. (In fact a much stronger motivation than to get Chrome running on OS X - I wouldn't be surprised to see the Android/Linux version out earlier.)

        Second, one of the best ways to weaken IE is to weaken Windows - the less people running Windows, the less run IE. But if Chrome is Windows-only, that just strengthens Windows as the only platform able to run the 'best' browser ('best' at least in Google's eyes and those that like Chrome).

        In other words, every IE convert to Chrome is still locked in to Windows. Whereas Google's long-term goal is to make the OS irrelevant so long as it can access Google's web services.

    • by dotancohen (1015143) on Saturday September 13 2008, @07:21AM (#24989469) Homepage

      They still have a near monopoly on the entire Linux desktop market!

      Truth is, I don't really care if Chrome runs under Linux or not. What _is_ important is that there is a lot of buzz about a non-IE browser out there, and that will help Linux users no matter which browser they use. Chrome will get the attention of at least some PHBs and Frontpa^w webdevs who code IE-only websites. I have been complaining about this for years [dotancohen.com] but now there finally is a product that they will have a hard time ignoring. Firefox was close, but was only talked about by gearheads. Even my mother-in-law asked me about Chrome. Which is too bad, as she's on Ubuntu and feels left out...

  • What I don't get... (Score:5, Interesting)

    by Angstroem (692547) on Saturday September 13 2008, @07:14AM (#24989427)

    So they want to develop a cross-platform browser.

    Why exactly is it then tied that tightly to a platform that porting it over to other platforms seems to basically mean starting all over again? After all, it's not like all 3 platforms would be completely alien in the backend -- they are POSIX compliant. Then the GUI: it's not like there aren't any cross-platform widget sets out there. But even if you want to go for individual approaches for each platform, then you still can separate functionality from the GUI.

    So why again is the Mac port "closer to start than finish" (especially when reminding that Chrome is based on Webkit) and the Linux port "even worse"?

    • by mikeplokta (223052) on Saturday September 13 2008, @07:31AM (#24989527)

      Cross-platform widget sets are always dreadful. An application developed using cross-platform widgets will, at best, work well on one platform, and more usually on no platforms. OS X and Windows have different UI philosophies, and an OS X application needs a different UI from a Windows application.

      • by HuguesT (84078) on Saturday September 13 2008, @08:28AM (#24989821)

        Not that different really. Qt does a very cross-platform good job, and several other toolkits do a more-than-passable job as well such wxWidget or FLTK.

        To me cross-platform is the only way to go, if you don't want your code to obsolete itself in no time at all.

        • by TheRaven64 (641858) on Saturday September 13 2008, @09:38AM (#24990301) Homepage Journal
          Have you ever used a Qt application on OS X? They stick out like a sore thumb. I think they've possibly fixed it in later versions, but until recently even trivial things like the keyboard shortcuts for skipping forwards and backwards one word in a text field were different from every other OS X application. The menus usually have a different structure, the preferences panels are typically horrendous, the services menu doesn't work correctly - they're so frustrating to use that they're typically not worth the bother.
            • by TheRaven64 (641858) on Saturday September 13 2008, @10:14AM (#24990577) Homepage Journal

              Do you mean to say that OS-X breaks convention by using non-standard keyboard shortcuts?

              In OS X, option-left and option-right skip one word to the left or right respectively. This has been the case since the first release of MacOS in 1984. Windows did not exist then, and there were no standards in early X11 toolkits (there still aren't - in 2005 I was using an X11 desktop and had four applications open with different shortcuts in text fields - gtk, tk, Qt and XUL were all doing things subtly differently). Windows standardised on control-left/right, because PCs didn't have an option key and alt was used for the menu (because PCs didn't have a meta key either). It's nothing to do with OS X 'innovating' and 'using non-standard shortcuts,' it's to do with Qt refusing to respect a core element of a user interface that has remained unchanged on a platform for 24 years.

        • by anon mouse-cow-aard (443646) on Saturday September 13 2008, @11:06AM (#24990977) Journal

          mod-parent up. QT is the native toolkit for KDE.
          IT isn't some artificial toolkit people only use for cross platform work, wxwindows or tk. It's a real native toolkit on Linux.

          Heck, there's a windows port of KDE4.x in the works.
          I mean come on...

        • by kollivier (449524) on Saturday September 13 2008, @11:48AM (#24991293)

          There can't be a grand unified HIG, but you're thinking about the problem backwards. Instead of trying to unify the HIGs, just have classes that abstract out the differences. For example, wxPython actually handles much of this already - the SizedControls library gives controls HIG-compliant borders and spacing on Win/Mac/GTK, while wxStdDialogButtonSizer (long name, I know ;-) will take your OK and Cancel button and make sure they appear in the right order on each platform. The platform-specific code is all built into the library - you don't need to deal with it yourself.

          The reason most cross-platform apps don't follow HIGs too well is that rather than use a library like this, they hand-code spacing, positioning, etc., usually doing the whole thing on one platform first. So then when they decide to make it cross-platform, going through and making a huge preferences window, for example, follow HIGs is a massive task.

    • by FooBarWidget (556006) on Saturday September 13 2008, @07:48AM (#24989599)

      "After all, it's not like all 3 platforms would be completely alien in the backend -- they are POSIX compliant."

      Uh, sorry? Since when is Windows POSIX compliant? Windows seems to be the only major modern OS in existence that's not POSIX compliant.

      I know that Windows provides some POSIX support, but it's broken and non-compliant in various ways. For example fork() is not supported.

      • by Haeleth (414428) on Saturday September 13 2008, @08:15AM (#24989731) Journal

        Windows provides basic support for POSIX.1, but it's always been a second-class citizen and was only added to meet some US government requirement or other.

        There is also SFU, or whatever they're calling it these days, but IIRC that's never been easy to integrate with the Windows GUI, and isn't available for major OSes like XP Home anyway.

        To all intents and purposes, if you want to target Windows you either need to use a proprietary Microsoft API, or you need to use a compatibility layer or cross-platform library that translates to a proprietary Microsoft API; this last option is the one used by real cross-platform browsers like Firefox and Opera.

      • by pthisis (27352) on Saturday September 13 2008, @09:00AM (#24989983) Homepage Journal

        I know that Windows provides some POSIX support, but it's broken and non-compliant in various ways. For example fork() is not supported.

        Not true.

        Microsoft Windows Internals, 4th. Ed (Russinovich & Solomon), p. 60:

        Because POSIX.1 compliance was a mandatory goal for Windows, the operating system was designed to ensure that the required base system support was present to allow for the implementation of a POSIX.1 subsystem (such as the fork function, which is implemented in the Windows executive, and the support for hard file links in the Windows file system).

        And to head off the next common incorrect belief, p.394:

        The POSIX subsystem takes advantage of copy-on-write to implement the fork function. Typically, when a UNIX application calls the fork function to create another process, the first thing that the new process does is call the exec function to reinitialize the address space with an executable program. Instead of copying the entire address space on fork, the new process shares the pages in the parent process by marking them copy-on-write.

        The POSIX subsystem blows for a host of reasons (you can't access most normal Win32 functionality, at least not easily), but it's got fork.

        • by cecom (698048) on Saturday September 13 2008, @11:44AM (#24991267) Homepage Journal

          Let me clarify a common misconception. Windows is _NOT_ POSIX compliant for all practical intents and purpose for one simple reason: an application using the POSIX subsystem doesn't have access to the Win32 subsystem, making it completely useless.

          For example, you cannot use POSIX functions (fork, etc) and use Win32 GUI at the same time. Thus the need for solutions like Cygwin, which emulate POSIX with enormous performance cost.

          I hope this puts the Windows POSIX compatibility myth to rest forever and nobody on SlashDot will make it ever again :-)

        • Re: (Score:3, Informative)

          It is easy to find a fork() for windows, or indeed posix threads, etc.

          In fact, Chrome/Chromium actually uses the Pthreads for win32 [google.com] library.

    • by itsdapead (734413) on Saturday September 13 2008, @08:41AM (#24989885)

      So they want to develop a cross-platform browser.

      Not really - they want a Windows browser to deliver their apps on which, largely thanks to the Google name, might stand a chance of making some inroads against IE.

      Mac and Linux versions would be nice too - but those users already use either Firefox or Webkit/Safari which have a better reputation for standards compliance and aren't controlled by Microsoft. That last is particularly important if your name is Google and you produce webapps which compete with Microsofts office products.

      So why again is the Mac port "closer to start than finish"

      Because they obviously chose to develop for Windows and port later, rather than develop all 3 versions in parallel. So maybe they delayed the Mac and Linux versions at the expense of Windows, but the upshot is that they got the Windows beta out before IE8 launches. Kinda strategic.

      Chrome is based on Webkit

      So what if they don't have to write WebKit for Mac? They didn't have to write WebKit for Windows, either! What Google are spending their time on will be the not insubstantial bits that wrap around Webkit to make it Chrome.

      it's not like there aren't any cross-platform widget sets out there

      Looks to me like they're using their own Widget set. Plus (as both MS and Mozilla have found in the past) Mac users tend to come down hard on apps that don't look as if they were born and bred on a Mac.

    • Re: (Score:3, Insightful)

      I don't see how POSIX is even introduced as a reason it should work, at least for Windows. I've never heard of it being useful in Windows except for command line software, that it precluded even using a GUI. I recall it was put in to satisfy a checklist for government purchases, only rarely being useful for anything other than that.

      • by Anonymous Coward on Saturday September 13 2008, @08:04AM (#24989675)

        They even did worse, they made it for MS Windows 32 bits from the start. Too bad for them.

        Yeah, now they're stuck with 90+% of the existing desktops on the planet. Whatever will they do?

  • by txoof (553270) <slashdot1.10.txoofNO@SPAMspamgourmet.com> on Saturday September 13 2008, @07:26AM (#24989505)

    I suppose it's good business sense to write software for the most popular platform. With around 75% [w3schools.com] of the OS hits being from Windows, it would be prudent to sink resources into a windows browser, rather than Mac or Linux.

    On the other hand, Mac use is steadily climbing and climbing among young people. Young people are typically drawn to free and shiny (one might say, Chromed) things. They're also good at starting and perpetuating trends. In that light, it might make sense for Google to sink more resources into making an OS X version. It's important to not only have a good product, but to make it fashionable to use that product. Lord knows how many people are still using IE, not because they like it, but rather because they don't know there's anything faster or better out there out there.

    They might as well forget about Linux though. Everybody knows that Linux users are crotchety and only really want to use wget and for really special pages, lynx. I for one can't remember the last time I used a window manager and LIKED that new fangled environment. Too many colors and flashing lights, it's like those arcades that them darn kids like to visit.

  • Sandbox (Score:3, Informative)

    by lseltzer (311306) on Saturday September 13 2008, @07:40AM (#24989561)

    The implementation of the sandbox in Windows is based on Windows-specific features. I suspect when they finally get it running on other platforms it will behave differenty with different levels of protection.

    • Re: (Score:3, Informative)

      Sorry I didn't put this into the parent.

      See this blog from Microsoft's Robert Hensing [technet.com] on how Chrome implements sandboxing on Windows and from whom at Microsoft they ripped off the idea.

      • Re: (Score:3, Interesting)

        That was a fun read.

        I mean FireFox 3.0 was touted for its "security"....In reality that browser offers even less protection / mitigation against web exploits than IE7 on Vista...

        and this

        I for one don't run FireFox 3.0 . . . I don't consider it even a worthy challenger (though it sure is fast) to IE7 let alone IE8 (due to lack of protection / mitigation technologies, the vuln counts etc.),

        Now, I'm no expert, I'm not saying he's wrong, but what I do know is that this goes against everything I've been hearing around here.

      • Re: (Score:3, Insightful)

        Dude, they freaking bought GreenBorder, one of the original companies that does sandboxing for normal Winblows executables.

        What makes you think they have to rip off anyone?

  • Not open source! (Score:5, Informative)

    by emiraga (1359297) on Saturday September 13 2008, @07:44AM (#24989579)
    There are parts of Google Chrome that are shipped closed source. For starters: GoogleUpdate and RLZ.DLL.
  • Tracemonkey vs. V8 (Score:5, Interesting)

    by Anik315 (585913) <anik@alphaco r . n et> on Saturday September 13 2008, @08:00AM (#24989657)

    Chrome is currently faster than Firefox at most things even when Tracemonkey is enabled. I mostly work with browser based math/finance apps, and one of the most intensive things that can be done is a numerical integral. No other browser even comes close to Chrome in terms of speed. The only drawback is that it isn't cross platform yet. From what I hear, Tracemonkey is working really well on different processors so it will be an interesting match up. Try pasting this code into JavaScript Shell [squarefree.com] from Chrome and Firefox for a comparison.

    Math.precision=function (x, eps) { var dec = Math.pow(10, Math.floor(Math.log(1 / eps) * Math.LOG10E)); return Math.round(dec * x) / dec; };function asr(f, a, b, eps) { var c = (a + b) / 2; var h = (b - a) / 6; var fa = f(a); var fb = f(b); var fc = f(c); return Math.precision(recursive_asr(f, a, b, c, eps, h * (fa + fb + 4 * fc), fa, fb, fc), eps); };function recursive_asr(f, a, b, c, eps, sum, fa, fb, fc) { var cl = (a + c) / 2; var cr = (c + b) / 2; var h = (c - a) / 6; var fcr = f(cr); var fcl = f(cl); var left = (fa + 4 * fcl + fc) * h; var right = (fc + 4 * fcr + fb) * h; if (Math.abs(left + right - sum) <= 15 * eps) { return left + right + (left + right - sum) / 15; } return recursive_asr(f, a, c, cl, eps / 2, left, fa, fc, fcl) + recursive_asr(f, c, b, cr, eps / 2, right, fc, fb, fcr); };asr(Math.sin,0,100,1e-15);

  • Travesty (Score:4, Insightful)

    by markdavis (642305) on Saturday September 13 2008, @08:07AM (#24989693)

    Google had the chance to show openness, platform independence, support for Open Systems principles and designs, and true independence from Microsoft control with Chrome, but lost it. If ever there were an important time to make sure of a simultaneous, multiplatform release, this would have been it. Instead, we have a typical "release for the largest platform" with weak promises of eventual support for everyone else. That isn't a good message for 2008; it doesn't match the "visionary" of what they are trying to do with Chrome.

    Google irritated a large number of users that would have been most likely to try and promote Chrome and to give contributions to the code- those NOT using MS-Windows. I think it was a huge mistake they didn't hold the release until there was a reasonable set of code for all the three major platforms. Given Google's resources, I doubt it would have been all that difficult.

    I have talked to many Linux and MacOS users about Chrome- most are disappointed, some extremely disappointed, and many are quite bitter, too. You can't blame them for being unhappy... and this article indicates that seeing Chrome on Linux and MacOS is nowhere near "right around the corner".

      • by SmallFurryCreature (593017) on Saturday September 13 2008, @08:53AM (#24989951) Journal

        When MS uses the word Beta, they really mean pre-alpha. Release is Beta. If you want a release quality MS product you need to look for the discontinued tag.

        Google is simpler, they got beta, beta and beta. One works, one doesn't, the other works for everyone except you and just when you became totally dependent on it, they kill the project.

        Linux has Beta and RC. RC is solid but out of date so nvidia doesn't have drivers for it anymore, beta is solid but nvidia doesn't have drivers for it yet.

        Solaris has only one version, more solid and sensible then a rock, it is labelled "Giving your accountant a heart attack".

      • Re: (Score:3, Insightful)

        Google Talk is XMPP (an IETF standard) with a number of extensions. The extensions are all documented and submitted to via the XMPP extensions process. They don't need to write a client for your pet platform, whether it's OS X, Linux, *BSD, Haiku, or AROS, because they provide enough documentation to allow anyone to (I've done it - it's really not that hard). If the platform you use doesn't have a significant market share then it's not worth them devoting resources to support it. The difference between G
  • the great irony (Score:3, Interesting)

    by Anonymous Coward on Saturday September 13 2008, @08:19AM (#24989759)

    The great irony of all of this is that Chrome (also Safari) directly owe the KDE and Qt projectÅ credit for constructing the base on which this is built. And now they are primarily targeting windows. When discussing either Safari or Chrome, I never ever even see mention of the F/OSS projectÅ to which they owe their existence. More than a pity, itÅ a crying shame. Do no evil my ass.

  • by chrysalis (50680) on Saturday September 13 2008, @08:22AM (#24989777) Homepage

    Worse : Chrome (especially V8) is only designed to work on ARM and i386 (32 bits) architectures. Yes, no AMD64 support, and don't even think of other architectures yet.

    However, there is a lot of manpower behind the project and the developpers are very skilled. So this is not hopeless.

    • by evilNomad (807119) on Saturday September 13 2008, @08:55AM (#24989959)

      It isn't designed just to work on those, they just haven't done others yet. When building a VM it is bad to start out having to support 10 different architectures as it requires you to test them all for every little change you do. It also requires that all developers know these architectures very well if they are to do proper changes.

      Besides V8 is probably the most portable thing there is in Chrome, it already works on Linux, OS X and Windows, and they provided two different architectures, making it much easier to do a 3rd and a 4th for anyone who should wish to do so.

      How do i know this? Because Lars Bak who leads the V8 team happens to be teaching my VM course, and a guy asked that specific question.

  • Truly, wtf? (Score:5, Insightful)

    by fabs64 (657132) <beaufabry+slashdot,org&gmail,com> on Saturday September 13 2008, @09:55AM (#24990441)
    What is it with google and their inability to write cross-platform GUI's? If nearly every OSS app can do it, why can't google?

    It's a really confusing situation that in my eyes loses them serious geek points. Hell, use .NET if you must, but this seemingly raw win32 nonsense is just silly.

    As for the old argument that nothing cross-platform can look good: eclipse.
    • by skeeto (1138903) on Saturday September 13 2008, @09:22AM (#24990175) Homepage

      And, yuck, they checked in a whole bunch of binaries. If you so a checkout of the Subversion repository (weighing in at 1.5G for the single revision checkout, 8G or so to build!) it is a huge mess. I don't think Chrome is going anywhere for a long time due to these maintainability problems you mentioned, and you won't find hackers poking around Chromium with the mess that the codebase is in. Plus, it's all tied very closely to Windows, and who wants to hack in the hacker-unfriendly Windows?

      Once I saw this, I sort-of forgot all about Chrome/Chromium. It's all hype for now.

    • Re: (Score:3, Insightful)

      Of course, IE7 then came out, with every new "innovation" basically being a copy of whatever made Firefox unique

      Hardly unique. IE7 didn't rip anything off Firefox that Opera hadn't had for years before either Firefox or IE7.