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

Issue 2301713002: Remove some UI->FILE->UI thread hops in ExecuteCodeFunction (Closed)

Created:
4 years, 3 months ago by lazyboy
Modified:
4 years, 3 months ago
Reviewers:
Devlin, dmazzoni
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, extensions-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove some UI->FILE->UI thread hops in ExecuteCodeFunction. There are 3 types of tasks in ExecuteCodeFunction that require FILE thread: a) Reading the file content (for non-component extension files) b) Retrieving the file GURL of the script file from base::FilePath c) content l10n (if the script is CSS) This CL does all of these in on UI->FILE hop and doesn't require additional FILE thread hop. Previously, the most common case, i.e. chrome.tabs.executeScript() with {file:...}, would require UI->FILE->UI->FILE->UI. With this CL this become UI->FILE->UI. This CL accomplishes this with adding an optional callback to FileReader, to specify additional tasks to be run on FILE thread. So the thread hop changes are: Component extension's executeScript() with file:... url would stay same. *All* other means of executing script file:... url, e.g. chrome.tabs.executeScript(,{file:..}) would require two (UI->FILE->UI) less thread hops, whee! BUG=622464 Test=None, internal only change. Committed: https://crrev.com/b19fcfe287dbb41ba8ee1e09d660cb27b14d1590 Cr-Commit-Position: refs/heads/master@{#419023}

Patch Set 1 #

Total comments: 2

Patch Set 2 : less thread hops #

Patch Set 3 : fix chromeos #

Total comments: 20

Patch Set 4 : address comments #

Patch Set 5 : git cl format #

Total comments: 11

Patch Set 6 : address comments #

Patch Set 7 : DCHECK comment + sync @tott #

Patch Set 8 : sync, move changes from accessibility_manager.cc -> accessibility_extension_loader.cc #

Unified diffs Side-by-side diffs Delta from patch set Stats (+116 lines, -71 lines) Patch
M chrome/browser/chromeos/accessibility/accessibility_extension_loader.cc View 1 2 3 4 5 6 7 1 chunk +5 lines, -3 lines 0 comments Download
M extensions/browser/api/execute_code_function.h View 1 2 3 4 5 1 chunk +21 lines, -11 lines 0 comments Download
M extensions/browser/api/execute_code_function.cc View 1 2 3 4 5 6 3 chunks +57 lines, -47 lines 0 comments Download
M extensions/browser/file_reader.h View 1 2 3 4 2 chunks +9 lines, -3 lines 0 comments Download
M extensions/browser/file_reader.cc View 1 2 3 4 5 2 chunks +19 lines, -4 lines 0 comments Download
M extensions/browser/file_reader_unittest.cc View 1 2 3 3 chunks +5 lines, -3 lines 0 comments Download

Messages

Total messages: 42 (28 generated)
lazyboy
4 years, 3 months ago (2016-08-31 22:55:02 UTC) #2
Devlin
https://codereview.chromium.org/2301713002/diff/1/extensions/browser/api/execute_code_function.cc File extensions/browser/api/execute_code_function.cc (right): https://codereview.chromium.org/2301713002/diff/1/extensions/browser/api/execute_code_function.cc#newcode236 extensions/browser/api/execute_code_function.cc:236: content::BrowserThread::FILE, FROM_HERE, So, previously it looks like for component ...
4 years, 3 months ago (2016-08-31 23:20:37 UTC) #3
lazyboy
https://codereview.chromium.org/2301713002/diff/1/extensions/browser/api/execute_code_function.cc File extensions/browser/api/execute_code_function.cc (right): https://codereview.chromium.org/2301713002/diff/1/extensions/browser/api/execute_code_function.cc#newcode236 extensions/browser/api/execute_code_function.cc:236: content::BrowserThread::FILE, FROM_HERE, On 2016/08/31 23:20:37, Devlin wrote: > So, ...
4 years, 3 months ago (2016-09-01 03:52:47 UTC) #11
Devlin
Looks like there's a compile error, but I think it's just the unit tests. Overall, ...
4 years, 3 months ago (2016-09-01 04:21:25 UTC) #14
lazyboy
Fix extensions_unittests target, comments addressed in patch set #5 https://codereview.chromium.org/2301713002/diff/40001/extensions/browser/api/execute_code_function.cc File extensions/browser/api/execute_code_function.cc (right): https://codereview.chromium.org/2301713002/diff/40001/extensions/browser/api/execute_code_function.cc#newcode33 extensions/browser/api/execute_code_function.cc:33: ...
4 years, 3 months ago (2016-09-01 05:52:58 UTC) #15
Devlin
lgtm; a few last comments, but they should be pretty straightforward. :) https://codereview.chromium.org/2301713002/diff/80001/extensions/browser/api/execute_code_function.cc File extensions/browser/api/execute_code_function.cc ...
4 years, 3 months ago (2016-09-01 06:15:21 UTC) #18
lazyboy
+David for accessibility_manager.cc OWNERS. Comments addressed in patch set #6 https://codereview.chromium.org/2301713002/diff/80001/extensions/browser/api/execute_code_function.cc File extensions/browser/api/execute_code_function.cc (right): https://codereview.chromium.org/2301713002/diff/80001/extensions/browser/api/execute_code_function.cc#newcode58 ...
4 years, 3 months ago (2016-09-01 18:10:18 UTC) #24
Devlin
https://codereview.chromium.org/2301713002/diff/80001/extensions/browser/api/execute_code_function.cc File extensions/browser/api/execute_code_function.cc (right): https://codereview.chromium.org/2301713002/diff/80001/extensions/browser/api/execute_code_function.cc#newcode202 extensions/browser/api/execute_code_function.cc:202: bool might_require_localization = ShouldInsertCSS() && !extension_id.empty(); On 2016/09/01 18:10:18, ...
4 years, 3 months ago (2016-09-01 18:15:42 UTC) #25
lazyboy
@dtseng, ping.
4 years, 3 months ago (2016-09-07 20:18:57 UTC) #28
lazyboy
+dmazzoni@chromium.org for review instead: chrome/browser/chromeos/accessibility/*
4 years, 3 months ago (2016-09-14 23:24:30 UTC) #30
dmazzoni
lgtm
4 years, 3 months ago (2016-09-15 16:33:19 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2301713002/140001
4 years, 3 months ago (2016-09-15 22:41:56 UTC) #38
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 3 months ago (2016-09-15 22:48:17 UTC) #40
commit-bot: I haz the power
4 years, 3 months ago (2016-09-15 22:50:24 UTC) #42
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/b19fcfe287dbb41ba8ee1e09d660cb27b14d1590
Cr-Commit-Position: refs/heads/master@{#419023}

Powered by Google App Engine
This is Rietveld 408576698