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

Issue 2231353002: Make FileReader return ownership of the string content (Closed)

Created:
4 years, 4 months ago by lazyboy
Modified:
4 years, 4 months ago
Reviewers:
Devlin, dmazzoni
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make FileReader return ownership of the string content. Since FileReader reads stuff on separate thread, moving the content around with std::string& is expensive. Make FileReader pass the string's ownership via unique_ptr. This reduces string copy primarily in ExecuteCodeFunction and web_view declarative content scripts. BUG=622464 Committed: https://crrev.com/b81e69a88c61106c1471d9585a37787f6624e063 Cr-Commit-Position: refs/heads/master@{#412957}

Patch Set 1 #

Patch Set 2 : fix chromeos compile #

Patch Set 3 : sync @tott #

Total comments: 6

Patch Set 4 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+52 lines, -54 lines) Patch
M chrome/browser/chromeos/accessibility/accessibility_manager.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M extensions/browser/api/execute_code_function.h View 2 chunks +3 lines, -3 lines 0 comments Download
M extensions/browser/api/execute_code_function.cc View 1 2 3 4 chunks +26 lines, -31 lines 0 comments Download
M extensions/browser/file_reader.h View 1 chunk +1 line, -1 line 0 comments Download
M extensions/browser/file_reader.cc View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M extensions/browser/file_reader_unittest.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M extensions/browser/guest_view/web_view/web_ui/web_ui_url_fetcher.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M extensions/browser/guest_view/web_view/web_ui/web_ui_url_fetcher.cc View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
M extensions/browser/web_ui_user_script_loader.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M extensions/browser/web_ui_user_script_loader.cc View 1 2 1 chunk +6 lines, -4 lines 0 comments Download

Messages

Total messages: 31 (21 generated)
lazyboy
4 years, 4 months ago (2016-08-12 00:27:15 UTC) #11
Devlin
lgtm https://codereview.chromium.org/2231353002/diff/40001/extensions/browser/api/execute_code_function.cc File extensions/browser/api/execute_code_function.cc (right): https://codereview.chromium.org/2231353002/diff/40001/extensions/browser/api/execute_code_function.cc#newcode222 extensions/browser/api/execute_code_function.cc:222: rb.GetRawDataResource(resource_id).as_string()))); Is the compiler smart enough (through rvalue ...
4 years, 4 months ago (2016-08-12 00:35:11 UTC) #12
lazyboy
+dmazzoni for accessibility_manager.cc https://codereview.chromium.org/2231353002/diff/40001/extensions/browser/api/execute_code_function.cc File extensions/browser/api/execute_code_function.cc (right): https://codereview.chromium.org/2231353002/diff/40001/extensions/browser/api/execute_code_function.cc#newcode222 extensions/browser/api/execute_code_function.cc:222: rb.GetRawDataResource(resource_id).as_string()))); On 2016/08/12 00:35:11, Devlin (ooo ...
4 years, 4 months ago (2016-08-12 01:31:22 UTC) #14
lazyboy
@ dmazzoni ping
4 years, 4 months ago (2016-08-16 22:46:00 UTC) #19
dmazzoni
lgtm
4 years, 4 months ago (2016-08-18 17:18:06 UTC) #20
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/2231353002/60001
4 years, 4 months ago (2016-08-18 17:19:25 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/276234)
4 years, 4 months ago (2016-08-18 19:06:56 UTC) #25
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/2231353002/60001
4 years, 4 months ago (2016-08-18 21:03:40 UTC) #27
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 4 months ago (2016-08-18 22:35:36 UTC) #29
commit-bot: I haz the power
4 years, 4 months ago (2016-08-18 23:24:24 UTC) #31
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/b81e69a88c61106c1471d9585a37787f6624e063
Cr-Commit-Position: refs/heads/master@{#412957}

Powered by Google App Engine
This is Rietveld 408576698