Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Issue 1164483003: Allow startup with missing V8 snapshot file. (Closed)

Created:
5 years, 6 months ago by Erik Corry Chromium.org
Modified:
5 years, 6 months ago
CC:
asvitkine+watch_chromium.org, cbentzel+watch_chromium.org, chromium-apps-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, extensions-reviews_chromium.org, feature-media-reviews_chromium.org, gunsch+watch_chromium.org, jochen+watch_chromium.org, kalyank, lcwu+watch_chromium.org, mkwst+moarreviews-shell_chromium.org, mlamouri+watch-content_chromium.org, sadrul
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow startup with missing V8 snapshot file. We want to stop shipping the snapshot file, and instead we want to generate it on the client. This will reduce the download size. But since snapshot generation will be asynchronous in a utility process, it might not be present on the first few runs of the browser. This means we have to be able to start up without the snapshot file (just with the natives source file). This CL fixes Blink to cope with a missing snapshot file (V8 could already cope). R=rmcilroy@chromium.org, sky@chromium.org BUG= Committed: https://crrev.com/c94eff1e7e8b2bd5973d7211c320d9f025c980c1 Cr-Commit-Position: refs/heads/master@{#333258}

Patch Set 1 #

Total comments: 20

Patch Set 2 : Feedback from Ross #

Patch Set 3 : Add natives_fd_exists and snapshot_fd_exists instead of checking for -1 #

Total comments: 29

Patch Set 4 : Latest feedback from Ross #

Patch Set 5 : Address comments on Patch Set 3 #

Patch Set 6 : Reinstate asserts that the natives are passed to the renderer by fd #

Total comments: 4

Patch Set 7 : Move AppendMappedFileCommandLineSwitches to its own function #

Patch Set 8 : Feedback from sky #

Total comments: 3

Patch Set 9 : merge #

Patch Set 10 : fix battery_monitor_integration_browsertest #

Patch Set 11 : Actually don't think I need that 'fix' for battery_monitor_integration_browsertest #

Patch Set 12 : Add cast for windows #

Patch Set 13 : Fix2 for Windows #

Patch Set 14 : Fix misplaced ifdef for Windows #

Unified diffs Side-by-side diffs Delta from patch set Stats (+318 lines, -173 lines) Patch
M ash/shell/content_client/shell_content_browser_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +5 lines, -2 lines 0 comments Download
M ash/shell/content_client/shell_content_browser_client.cc View 1 2 3 4 5 6 7 3 chunks +9 lines, -6 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.h View 1 2 3 4 5 6 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 7 8 4 chunks +32 lines, -12 lines 0 comments Download
M chrome/plugin/chrome_content_plugin_client.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chromecast/browser/cast_content_browser_client.h View 1 2 3 4 5 6 2 chunks +4 lines, -0 lines 0 comments Download
M chromecast/browser/cast_content_browser_client.cc View 1 2 3 4 5 6 7 3 chunks +18 lines, -9 lines 0 comments Download
M components/html_viewer/ax_provider_impl_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M components/html_viewer/setup.cc View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -4 lines 0 comments Download
M content/app/content_main_runner.cc View 1 2 3 4 5 6 7 8 1 chunk +13 lines, -7 lines 0 comments Download
M content/browser/child_process_launcher.cc View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -0 lines 0 comments Download
M content/public/browser/content_browser_client.h View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M content/public/test/content_test_suite_base.cc View 1 chunk +1 line, -0 lines 0 comments Download
M content/shell/browser/shell_content_browser_client.h View 1 2 3 4 5 6 2 chunks +4 lines, -0 lines 0 comments Download
M content/shell/browser/shell_content_browser_client.cc View 1 2 3 4 5 6 7 3 chunks +14 lines, -6 lines 0 comments Download
M content/test/content_test_launcher.cc View 1 chunk +1 line, -0 lines 0 comments Download
M content/test/test_blink_web_unit_test_support.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M extensions/shell/browser/shell_content_browser_client.h View 1 2 3 4 5 6 2 chunks +4 lines, -0 lines 0 comments Download
M extensions/shell/browser/shell_content_browser_client.cc View 1 2 3 4 5 6 7 8 3 chunks +15 lines, -8 lines 0 comments Download
M gin/public/isolate_holder.h View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -1 line 0 comments Download
M gin/shell/gin_main.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M gin/shell_runner_unittest.cc View 1 chunk +1 line, -0 lines 0 comments Download
M gin/test/file_runner.cc View 1 chunk +1 line, -0 lines 0 comments Download
M gin/test/v8_test.cc View 1 chunk +1 line, -0 lines 0 comments Download
M gin/v8_initializer.h View 1 2 3 1 chunk +17 lines, -11 lines 0 comments Download
M gin/v8_initializer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +148 lines, -107 lines 0 comments Download
M media/blink/run_all_unittests.cc View 1 chunk +1 line, -0 lines 0 comments Download
M net/proxy/proxy_resolver_v8.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 40 (12 generated)
Erik Corry Chromium.org
5 years, 6 months ago (2015-06-01 13:17:39 UTC) #1
rmcilroy
https://codereview.chromium.org/1164483003/diff/1/ash/shell/content_client/shell_content_browser_client.cc File ash/shell/content_client/shell_content_browser_client.cc (right): https://codereview.chromium.org/1164483003/diff/1/ash/shell/content_client/shell_content_browser_client.cc#newcode80 ash/shell/content_client/shell_content_browser_client.cc:80: DCHECK(v8_natives_fd_.get() != -1); nit - please add a comment ...
5 years, 6 months ago (2015-06-01 14:06:32 UTC) #2
Erik Corry Chromium.org
Changed version not uploaded yet https://codereview.chromium.org/1164483003/diff/1/ash/shell/content_client/shell_content_browser_client.cc File ash/shell/content_client/shell_content_browser_client.cc (right): https://codereview.chromium.org/1164483003/diff/1/ash/shell/content_client/shell_content_browser_client.cc#newcode80 ash/shell/content_client/shell_content_browser_client.cc:80: DCHECK(v8_natives_fd_.get() != -1); On ...
5 years, 6 months ago (2015-06-02 11:18:53 UTC) #3
rmcilroy
https://codereview.chromium.org/1164483003/diff/1/content/app/content_main_runner.cc File content/app/content_main_runner.cc (right): https://codereview.chromium.org/1164483003/diff/1/content/app/content_main_runner.cc#newcode746 content/app/content_main_runner.cc:746: gin::V8Initializer::LoadV8Snapshot(); On 2015/06/02 11:18:52, Erik Corry Chromium.org wrote: > ...
5 years, 6 months ago (2015-06-02 11:27:07 UTC) #4
picksi
https://codereview.chromium.org/1164483003/diff/1/ash/shell/content_client/shell_content_browser_client.cc File ash/shell/content_client/shell_content_browser_client.cc (right): https://codereview.chromium.org/1164483003/diff/1/ash/shell/content_client/shell_content_browser_client.cc#newcode54 ash/shell/content_client/shell_content_browser_client.cc:54: if (v8_natives_fd_.get() != -1) { "v8_[natives|snapshot]_fd_.get() != -1" appears ...
5 years, 6 months ago (2015-06-02 11:44:37 UTC) #6
Erik Corry Chromium.org
https://codereview.chromium.org/1164483003/diff/1/ash/shell/content_client/shell_content_browser_client.cc File ash/shell/content_client/shell_content_browser_client.cc (right): https://codereview.chromium.org/1164483003/diff/1/ash/shell/content_client/shell_content_browser_client.cc#newcode54 ash/shell/content_client/shell_content_browser_client.cc:54: if (v8_natives_fd_.get() != -1) { On 2015/06/02 11:44:37, picksi ...
5 years, 6 months ago (2015-06-02 14:29:47 UTC) #8
picksi
On 2015/06/02 14:29:47, Erik Corry Chromium.org wrote: > https://codereview.chromium.org/1164483003/diff/1/ash/shell/content_client/shell_content_browser_client.cc > File ash/shell/content_client/shell_content_browser_client.cc (right): > > ...
5 years, 6 months ago (2015-06-02 14:56:51 UTC) #9
picksi
On 2015/06/02 14:29:47, Erik Corry Chromium.org wrote: > https://codereview.chromium.org/1164483003/diff/1/ash/shell/content_client/shell_content_browser_client.cc > File ash/shell/content_client/shell_content_browser_client.cc (right): > > ...
5 years, 6 months ago (2015-06-02 14:56:51 UTC) #10
rmcilroy
https://codereview.chromium.org/1164483003/diff/40001/ash/shell/content_client/shell_content_browser_client.cc File ash/shell/content_client/shell_content_browser_client.cc (right): https://codereview.chromium.org/1164483003/diff/40001/ash/shell/content_client/shell_content_browser_client.cc#newcode54 ash/shell/content_client/shell_content_browser_client.cc:54: if (natives_fd_exists()) { Just DCHECK(natives_fd_exists() here since it should ...
5 years, 6 months ago (2015-06-02 15:20:28 UTC) #11
picksi
a couple of readability nits/bikeshedding https://codereview.chromium.org/1164483003/diff/40001/gin/v8_initializer.cc File gin/v8_initializer.cc (right): https://codereview.chromium.org/1164483003/diff/40001/gin/v8_initializer.cc#newcode232 gin/v8_initializer.cc:232: } nit: would the ...
5 years, 6 months ago (2015-06-02 16:02:15 UTC) #12
jam
which files do you want me to look at?
5 years, 6 months ago (2015-06-02 17:57:09 UTC) #13
Erik Corry Chromium.org
Hi I need some help to land this since it touches a lot of files. ...
5 years, 6 months ago (2015-06-04 11:40:41 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1164483003/80001
5 years, 6 months ago (2015-06-04 12:54:45 UTC) #17
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win8_chromium_rel on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win8_chromium_rel/builds/90416)
5 years, 6 months ago (2015-06-04 13:31:41 UTC) #19
rmcilroy
https://codereview.chromium.org/1164483003/diff/40001/ash/shell/content_client/shell_content_browser_client.cc File ash/shell/content_client/shell_content_browser_client.cc (right): https://codereview.chromium.org/1164483003/diff/40001/ash/shell/content_client/shell_content_browser_client.cc#newcode54 ash/shell/content_client/shell_content_browser_client.cc:54: if (natives_fd_exists()) { On 2015/06/04 11:40:40, Erik Corry Chromium.org ...
5 years, 6 months ago (2015-06-04 14:03:59 UTC) #20
sky
LGTM https://codereview.chromium.org/1164483003/diff/100001/ash/shell/content_client/shell_content_browser_client.cc File ash/shell/content_client/shell_content_browser_client.cc (right): https://codereview.chromium.org/1164483003/diff/100001/ash/shell/content_client/shell_content_browser_client.cc#newcode57 ash/shell/content_client/shell_content_browser_client.cc:57: if (snapshot_fd_exists()) { nit: no {} https://codereview.chromium.org/1164483003/diff/100001/ash/shell/content_client/shell_content_browser_client.h File ...
5 years, 6 months ago (2015-06-04 19:36:42 UTC) #21
jam
lgtm
5 years, 6 months ago (2015-06-05 04:26:42 UTC) #22
jochen (gone - plz use gerrit)
lgtm once Ross is happy
5 years, 6 months ago (2015-06-05 12:14:00 UTC) #23
Erik Corry Chromium.org
https://codereview.chromium.org/1164483003/diff/100001/ash/shell/content_client/shell_content_browser_client.cc File ash/shell/content_client/shell_content_browser_client.cc (right): https://codereview.chromium.org/1164483003/diff/100001/ash/shell/content_client/shell_content_browser_client.cc#newcode57 ash/shell/content_client/shell_content_browser_client.cc:57: if (snapshot_fd_exists()) { On 2015/06/04 19:36:42, sky wrote: > ...
5 years, 6 months ago (2015-06-05 13:15:17 UTC) #24
rmcilroy
lgtm, thanks! https://codereview.chromium.org/1164483003/diff/140001/content/browser/child_process_launcher.cc File content/browser/child_process_launcher.cc (right): https://codereview.chromium.org/1164483003/diff/140001/content/browser/child_process_launcher.cc#newcode166 content/browser/child_process_launcher.cc:166: GetContentClient()->browser()->AppendMappedFileCommandLineSwitches(cmd_line); nit - there is another call ...
5 years, 6 months ago (2015-06-05 13:24:52 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1164483003/180001
5 years, 6 months ago (2015-06-05 13:45:00 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1164483003/240001
5 years, 6 months ago (2015-06-05 15:15:37 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: win8_chromium_rel on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win8_chromium_rel/builds/90947)
5 years, 6 months ago (2015-06-05 16:36:10 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1164483003/260001
5 years, 6 months ago (2015-06-08 10:25:54 UTC) #36
commit-bot: I haz the power
Committed patchset #14 (id:260001)
5 years, 6 months ago (2015-06-08 11:29:26 UTC) #37
commit-bot: I haz the power
Patchset 14 (id:??) landed as https://crrev.com/c94eff1e7e8b2bd5973d7211c320d9f025c980c1 Cr-Commit-Position: refs/heads/master@{#333258}
5 years, 6 months ago (2015-06-08 11:30:35 UTC) #38
Erik Corry Chromium.org
https://codereview.chromium.org/1164483003/diff/140001/content/browser/child_process_launcher.cc File content/browser/child_process_launcher.cc (right): https://codereview.chromium.org/1164483003/diff/140001/content/browser/child_process_launcher.cc#newcode166 content/browser/child_process_launcher.cc:166: GetContentClient()->browser()->AppendMappedFileCommandLineSwitches(cmd_line); On 2015/06/05 13:24:51, rmcilroy wrote: > nit - ...
5 years, 6 months ago (2015-06-08 13:31:03 UTC) #39
rmcilroy
5 years, 6 months ago (2015-06-08 17:26:12 UTC) #40
Message was sent while issue was closed.
https://codereview.chromium.org/1164483003/diff/140001/content/browser/child_...
File content/browser/child_process_launcher.cc (right):

https://codereview.chromium.org/1164483003/diff/140001/content/browser/child_...
content/browser/child_process_launcher.cc:166:
GetContentClient()->browser()->AppendMappedFileCommandLineSwitches(cmd_line);
On 2015/06/08 13:31:03, Erik Corry Chromium.org wrote:
> On 2015/06/05 13:24:51, rmcilroy wrote:
> > nit - there is another call to GetAdditionalMappedFilesForChildProcess in
> > battery_monitor_integration_browsertest.cc - could you add the
> > AppendMappedFileCommandLineSwitches call there too please.
> 
> In the end I didn't do this becasue the command line is const, and the call to
> GetAdditionalMappedFilesForChildProcess is inside another implementation of
> GetAdditionalMappedFilesForChildProcess, so the caller of the outer version
can
> be expected to call AppendMappedFileCommandLineSwitches

Ahh well, if it works I guess this is fine.

Powered by Google App Engine
This is Rietveld 408576698