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

Issue 277463003: Use a proper profile in NaClBrowserDelegateImpl::MapUrlToLocalFilePath (Closed)

Created:
6 years, 7 months ago by Yusuke Sato
Modified:
6 years, 7 months ago
CC:
chromium-reviews, native-client-reviews_googlegroups.com
Visibility:
Public.

Description

Use a proper profile in NaClBrowserDelegateImpl::MapUrlToLocalFilePath not to slow down open_resource IRT call on Chrome OS (and on Chrome with multiple profiles). The function should use a profile associated with the renderer rather than the one created in chrome/browser/chrome_browser_main.cc. Otherwise, MapUrlToLocalFilePath may see an invalid set of extensions and may return false when it should return true. For example, on Chrome OS, the profile created in chrome_browser_main.cc is basically only for the login screen except a few minor cases (e.g. browser crash recovery), and therefore is not suitable for the use in MapUrlToLocalFilePath. This fix allows NaCl apps, both in SFI and non-SFI mode, to open a NaCl resource file with the fast __nacl_irt_open_resource path (see the bug for more details). BUG=360277 TEST=Manually tested. Add two CHECK() calls to DoOpenNaClExecutableOnThreadPool() and OnLaunchNaCl() so that Chrome will crash if MapUrlToLocalFilePath() returns false, build Chrome for Chrome OS, copy it to Chromebook, reboot it, sign in, and then try to load a dynamically linked NaCl app. Confirm that Chrome does not crash. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=269210

Patch Set 1 #

Patch Set 2 : review #

Patch Set 3 : fix tests #

Patch Set 4 : rebase #

Total comments: 4

Patch Set 5 : git cl format #

Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -17 lines) Patch
M chrome/browser/chrome_browser_main.cc View 1 2 3 4 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/nacl_host/nacl_browser_delegate_impl.h View 1 2 3 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/nacl_host/nacl_browser_delegate_impl.cc View 1 2 3 4 4 chunks +20 lines, -6 lines 0 comments Download
M components/nacl/browser/nacl_browser_delegate.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M components/nacl/browser/nacl_file_host.cc View 1 2 3 4 1 chunk +4 lines, -1 line 0 comments Download
M components/nacl/browser/nacl_host_message_filter.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M components/nacl/browser/nacl_host_message_filter.cc View 1 2 3 4 1 chunk +4 lines, -1 line 0 comments Download
M components/nacl/browser/test_nacl_browser_delegate.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M components/nacl/browser/test_nacl_browser_delegate.cc View 1 2 3 4 1 chunk +5 lines, -3 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Yusuke Sato
Could you have a look at this? I would like to fix the issue in ...
6 years, 7 months ago (2014-05-07 17:48:19 UTC) #1
Yusuke Sato
On 2014/05/07 17:48:19, Yusuke Sato wrote: > Could you have a look at this? I ...
6 years, 7 months ago (2014-05-07 19:17:12 UTC) #2
Yusuke Sato
Fixed. Please take a look at Patch Set #4.
6 years, 7 months ago (2014-05-08 00:31:57 UTC) #3
jochen (gone - plz use gerrit)
lgtm https://codereview.chromium.org/277463003/diff/50001/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc File chrome/browser/nacl_host/nacl_browser_delegate_impl.cc (right): https://codereview.chromium.org/277463003/diff/50001/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc#newcode210 chrome/browser/nacl_host/nacl_browser_delegate_impl.cc:210: const base::FilePath& profile_directory, base::FilePath* file_path) { please clang-format ...
6 years, 7 months ago (2014-05-08 07:04:13 UTC) #4
Yusuke Sato
Re-formatted with git cl format. Mark/Tom, please take a look. https://codereview.chromium.org/277463003/diff/50001/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc File chrome/browser/nacl_host/nacl_browser_delegate_impl.cc (right): https://codereview.chromium.org/277463003/diff/50001/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc#newcode210 ...
6 years, 7 months ago (2014-05-08 16:28:01 UTC) #5
Mark Seaborn
Since this doesn't have an automated test, can you add a TEST= line to the ...
6 years, 7 months ago (2014-05-08 19:13:25 UTC) #6
Tom Sepez
LGTM since profile_directory_ is controlled directly by the browser.
6 years, 7 months ago (2014-05-08 19:47:19 UTC) #7
Yusuke Sato
The CQ bit was checked by yusukes@chromium.org
6 years, 7 months ago (2014-05-08 21:03:49 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yusukes@chromium.org/277463003/70001
6 years, 7 months ago (2014-05-08 21:07:38 UTC) #9
commit-bot: I haz the power
6 years, 7 months ago (2014-05-09 10:30:24 UTC) #10
Message was sent while issue was closed.
Change committed as 269210

Powered by Google App Engine
This is Rietveld 408576698