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

Issue 14607023: Add support for persistent file access in apps. (Closed)

Created:
7 years, 7 months ago by Sam McNally
Modified:
7 years, 7 months ago
CC:
chromium-reviews, tzik+watch_chromium.org, tfarina, Aaron Boodman, kinuko+watch, chromium-apps-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Add support for persistent file access in apps. This replaces chrome.fileSystem.getEntry(By)Id with retainEntry, restoreEntry and isRestorable, which enable restoring file access after an app is closed for apps with the fileSystem.retainFiles permission. Retained files are evicted by LRU, with a maximum of 500 retained files. BUG=224684 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=202276

Patch Set 1 : #

Total comments: 39

Patch Set 2 : #

Total comments: 26

Patch Set 3 : #

Total comments: 17

Patch Set 4 : #

Total comments: 2

Patch Set 5 : #

Patch Set 6 : rebase #

Total comments: 108

Patch Set 7 : #

Total comments: 8

Patch Set 8 : #

Total comments: 42

Patch Set 9 : #

Patch Set 10 : rebase #

Patch Set 11 : rebase #

Patch Set 12 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1335 lines, -532 lines) Patch
M apps/app_restore_service.h View 1 2 3 4 5 6 7 8 9 2 chunks +1 line, -10 lines 0 comments Download
M apps/app_restore_service.cc View 1 2 3 4 5 6 7 8 4 chunks +12 lines, -15 lines 0 comments Download
M apps/app_restore_service_browsertest.cc View 1 2 3 4 5 6 5 chunks +10 lines, -20 lines 0 comments Download
M apps/apps.gypi View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
A apps/saved_files_service.h View 1 2 3 4 5 6 7 8 9 1 chunk +135 lines, -0 lines 0 comments Download
A apps/saved_files_service.cc View 1 2 3 4 5 6 7 8 1 chunk +441 lines, -0 lines 0 comments Download
A apps/saved_files_service_factory.h View 1 2 3 4 5 6 7 8 9 1 chunk +35 lines, -0 lines 0 comments Download
A apps/saved_files_service_factory.cc View 1 2 3 4 5 6 7 8 9 1 chunk +36 lines, -0 lines 0 comments Download
A apps/saved_files_service_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +239 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/app_runtime/app_runtime_api.h View 1 chunk +2 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/app_runtime/app_runtime_api.cc View 1 chunk +2 lines, -20 lines 0 comments Download
M chrome/browser/extensions/api/file_handlers/app_file_handler_util.h View 2 chunks +0 lines, -29 lines 0 comments Download
M chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +0 lines, -73 lines 0 comments Download
M chrome/browser/extensions/api/file_system/file_system_api.h View 1 2 3 4 5 6 7 8 2 chunks +42 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/file_system/file_system_api.cc View 1 2 3 4 5 6 7 8 9 10 11 10 chunks +114 lines, -11 lines 0 comments Download
M chrome/browser/extensions/api/file_system/file_system_apitest.cc View 1 2 3 4 5 6 7 8 6 chunks +51 lines, -19 lines 0 comments Download
M chrome/browser/extensions/extension_function_histogram_value.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_service.h View 1 2 3 chunks +1 line, -16 lines 0 comments Download
M chrome/browser/extensions/extension_service.cc View 1 2 3 4 5 6 7 8 9 11 4 chunks +3 lines, -18 lines 0 comments Download
M chrome/browser/extensions/platform_app_launcher.h View 2 chunks +1 line, -9 lines 0 comments Download
M chrome/browser/extensions/platform_app_launcher.cc View 1 2 3 4 5 6 7 8 9 3 chunks +2 lines, -81 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/api/_permission_features.json View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/extensions/api/file_system.idl View 1 2 3 4 5 6 2 chunks +12 lines, -8 lines 0 comments Download
M chrome/common/extensions/permissions/api_permission.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/permissions/chrome_api_permissions.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/permissions/permission_set_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/extensions/file_system_natives.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/extensions/file_system_natives.cc View 1 2 3 2 chunks +15 lines, -0 lines 0 comments Download
M chrome/renderer/resources/extensions/app_runtime_custom_bindings.js View 1 chunk +0 lines, -31 lines 0 comments Download
chrome/renderer/resources/extensions/entry_id_manager.js View 1 2 3 4 5 6 7 8 3 chunks +20 lines, -2 lines 0 comments Download
M chrome/renderer/resources/extensions/file_system_custom_bindings.js View 1 2 3 4 5 6 7 8 2 chunks +36 lines, -5 lines 0 comments Download
D chrome/test/data/extensions/api_test/file_system/get_entry_id/background.js View 1 chunk +0 lines, -7 lines 0 comments Download
D chrome/test/data/extensions/api_test/file_system/get_entry_id/manifest.json View 1 chunk +0 lines, -11 lines 0 comments Download
D chrome/test/data/extensions/api_test/file_system/get_entry_id/test.html View 1 chunk +0 lines, -4 lines 0 comments Download
D chrome/test/data/extensions/api_test/file_system/get_entry_id/test.js View 1 chunk +0 lines, -26 lines 0 comments Download
D chrome/test/data/extensions/api_test/file_system/get_entry_id/test_other_window.html View 1 chunk +0 lines, -3 lines 0 comments Download
D chrome/test/data/extensions/api_test/file_system/get_entry_id/test_other_window.js View 1 chunk +0 lines, -15 lines 0 comments Download
D chrome/test/data/extensions/api_test/file_system/get_entry_id/test_util.js View 1 chunk +0 lines, -62 lines 0 comments Download
A + chrome/test/data/extensions/api_test/file_system/restore_entry/background.js View 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/test/data/extensions/api_test/file_system/restore_entry/manifest.json View 1 chunk +2 lines, -2 lines 0 comments Download
A + chrome/test/data/extensions/api_test/file_system/restore_entry/test.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/test/data/extensions/api_test/file_system/restore_entry/test.js View 1 2 3 4 5 6 1 chunk +27 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/api_test/file_system/restore_entry/test_util.js View 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/test/data/extensions/api_test/file_system/retain_entry/background.js View 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/test/data/extensions/api_test/file_system/retain_entry/manifest.json View 1 chunk +2 lines, -2 lines 0 comments Download
A + chrome/test/data/extensions/api_test/file_system/retain_entry/test.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/test/data/extensions/api_test/file_system/retain_entry/test.js View 1 2 3 4 5 6 7 8 1 chunk +28 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/api_test/file_system/retain_entry/test_other_window.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/test/data/extensions/api_test/file_system/retain_entry/test_other_window.js View 1 2 3 4 5 6 7 8 1 chunk +18 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/api_test/file_system/retain_entry/test_util.js View 0 chunks +-1 lines, --1 lines 0 comments Download
M chrome/test/data/extensions/platform_apps/file_access_restored_test/test.js View 2 chunks +31 lines, -30 lines 0 comments Download
M chrome/test/data/extensions/platform_apps/file_access_saved_to_prefs_test/test.js View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/platform_apps/launch_application_octet_stream/test.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/platform_apps/launch_file/test.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/platform_apps/launch_file_by_extension/test.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/platform_apps/launch_file_by_extension_and_type/test.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/platform_apps/launch_file_with_any_extension/test.js View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/platform_apps/launch_file_with_no_extension/test.js View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 39 (0 generated)
Sam McNally
7 years, 7 months ago (2013-05-15 05:22:26 UTC) #1
Matt Giuca
Here are some starter comments for the main files. I haven't done a full review ...
7 years, 7 months ago (2013-05-16 06:40:59 UTC) #2
benwells
I also haven't done a full review. I have a question / comment. In saved_files_service.cc, ...
7 years, 7 months ago (2013-05-16 06:50:17 UTC) #3
Matt Giuca
https://codereview.chromium.org/14607023/diff/48002/chrome/browser/extensions/api/file_system/saved_files_service.h File chrome/browser/extensions/api/file_system/saved_files_service.h (right): https://codereview.chromium.org/14607023/diff/48002/chrome/browser/extensions/api/file_system/saved_files_service.h#newcode1 chrome/browser/extensions/api/file_system/saved_files_service.h:1: // Copyright (c) 2013 The Chromium Authors. All rights ...
7 years, 7 months ago (2013-05-16 07:20:06 UTC) #4
Sam McNally
https://codereview.chromium.org/14607023/diff/48002/chrome/browser/extensions/api/file_system/file_system_api.cc File chrome/browser/extensions/api/file_system/file_system_api.cc (right): https://codereview.chromium.org/14607023/diff/48002/chrome/browser/extensions/api/file_system/file_system_api.cc#newcode711 chrome/browser/extensions/api/file_system/file_system_api.cc:711: EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &entry_id)); On 2013/05/16 06:40:59, Matt Giuca wrote: > ...
7 years, 7 months ago (2013-05-17 03:38:51 UTC) #5
Matt Giuca
OK I just read the header file. I think mostly I want documentation ;) I ...
7 years, 7 months ago (2013-05-17 08:28:45 UTC) #6
Sam McNally
https://chromiumcodereview.appspot.com/14607023/diff/78001/apps/saved_files_service.cc File apps/saved_files_service.cc (right): https://chromiumcodereview.appspot.com/14607023/diff/78001/apps/saved_files_service.cc#newcode45 apps/saved_files_service.cc:45: const size_t kDefaultMaxSavedFileEntries = 500; On 2013/05/17 08:28:45, Matt ...
7 years, 7 months ago (2013-05-20 01:17:13 UTC) #7
Matt Giuca
https://codereview.chromium.org/14607023/diff/103001/apps/app_restore_service.cc File apps/app_restore_service.cc (right): https://codereview.chromium.org/14607023/diff/103001/apps/app_restore_service.cc#newcode74 apps/app_restore_service.cc:74: if (should_restore_apps) Not your fault, but can you please ...
7 years, 7 months ago (2013-05-20 01:32:57 UTC) #8
Matt Giuca
It would probably be a good thing if you split out the changes that add ...
7 years, 7 months ago (2013-05-20 01:34:12 UTC) #9
benwells
On 2013/05/20 01:34:12, Matt Giuca wrote: > It would probably be a good thing if ...
7 years, 7 months ago (2013-05-20 02:18:59 UTC) #10
Sam McNally
https://chromiumcodereview.appspot.com/14607023/diff/103001/apps/app_restore_service.cc File apps/app_restore_service.cc (right): https://chromiumcodereview.appspot.com/14607023/diff/103001/apps/app_restore_service.cc#newcode74 apps/app_restore_service.cc:74: if (should_restore_apps) On 2013/05/20 01:32:57, Matt Giuca wrote: > ...
7 years, 7 months ago (2013-05-20 04:25:19 UTC) #11
Matt Giuca
https://codereview.chromium.org/14607023/diff/121003/apps/saved_files_service.h File apps/saved_files_service.h (right): https://codereview.chromium.org/14607023/diff/121003/apps/saved_files_service.h#newcode125 apps/saved_files_service.h:125: Profile* profile_; Can this be a const reference?
7 years, 7 months ago (2013-05-20 05:02:03 UTC) #12
Matt Giuca
Ben: Sam walked me through all the places where pointers are used. I think they're ...
7 years, 7 months ago (2013-05-20 05:06:33 UTC) #13
koz (OOO until 15th September)
https://codereview.chromium.org/14607023/diff/103001/apps/app_restore_service_browsertest.cc File apps/app_restore_service_browsertest.cc (right): https://codereview.chromium.org/14607023/diff/103001/apps/app_restore_service_browsertest.cc#newcode83 apps/app_restore_service_browsertest.cc:83: // will have them all cleared. This comment is ...
7 years, 7 months ago (2013-05-20 05:33:51 UTC) #14
Matt Giuca
https://codereview.chromium.org/14607023/diff/103001/apps/saved_files_service.h File apps/saved_files_service.h (right): https://codereview.chromium.org/14607023/diff/103001/apps/saved_files_service.h#newcode70 apps/saved_files_service.h:70: void RetainFileEntry(const std::string& extension_id, On 2013/05/20 05:33:51, koz wrote: ...
7 years, 7 months ago (2013-05-20 05:41:05 UTC) #15
koz (OOO until 15th September)
On 2013/05/20 05:41:05, Matt Giuca wrote: > https://codereview.chromium.org/14607023/diff/103001/apps/saved_files_service.h > File apps/saved_files_service.h (right): > > https://codereview.chromium.org/14607023/diff/103001/apps/saved_files_service.h#newcode70 ...
7 years, 7 months ago (2013-05-20 06:10:54 UTC) #16
Sam McNally
https://codereview.chromium.org/14607023/diff/103001/apps/app_restore_service_browsertest.cc File apps/app_restore_service_browsertest.cc (right): https://codereview.chromium.org/14607023/diff/103001/apps/app_restore_service_browsertest.cc#newcode83 apps/app_restore_service_browsertest.cc:83: // will have them all cleared. On 2013/05/20 05:33:51, ...
7 years, 7 months ago (2013-05-20 07:13:33 UTC) #17
Matt Giuca
OK, I've basically completed my review. There are a bunch of things I didn't look ...
7 years, 7 months ago (2013-05-22 08:26:13 UTC) #18
Sam McNally
https://codereview.chromium.org/14607023/diff/162003/apps/app_restore_service_browsertest.cc File apps/app_restore_service_browsertest.cc (left): https://codereview.chromium.org/14607023/diff/162003/apps/app_restore_service_browsertest.cc#oldcode85 apps/app_restore_service_browsertest.cc:85: // will have them all cleared. On 2013/05/22 08:26:14, ...
7 years, 7 months ago (2013-05-23 03:47:28 UTC) #19
Matt Giuca
https://codereview.chromium.org/14607023/diff/162003/chrome/common/extensions/api/file_system.idl File chrome/common/extensions/api/file_system.idl (right): https://codereview.chromium.org/14607023/diff/162003/chrome/common/extensions/api/file_system.idl#newcode80 chrome/common/extensions/api/file_system.idl:80: // Returns the file entry with the given id ...
7 years, 7 months ago (2013-05-23 04:53:42 UTC) #20
Sam McNally
https://codereview.chromium.org/14607023/diff/184002/apps/saved_files_service.cc File apps/saved_files_service.cc (right): https://codereview.chromium.org/14607023/diff/184002/apps/saved_files_service.cc#newcode165 apps/saved_files_service.cc:165: // g_max_sequence_number. Outside testing, it is set to kint32max, ...
7 years, 7 months ago (2013-05-23 05:21:10 UTC) #21
Matt Giuca
LGTM! https://codereview.chromium.org/14607023/diff/202001/apps/saved_files_service.cc File apps/saved_files_service.cc (right): https://codereview.chromium.org/14607023/diff/202001/apps/saved_files_service.cc#newcode319 apps/saved_files_service.cc:319: DCHECK(it != registered_file_entries_.end()); Please make this a CHECK, ...
7 years, 7 months ago (2013-05-23 05:38:34 UTC) #22
benwells
Looking pretty good. Only nits so far, but I am only about 1/4 through ...
7 years, 7 months ago (2013-05-23 06:26:36 UTC) #23
koz (OOO until 15th September)
Very close, I didn't quite get around to going over the .js tests but I'll ...
7 years, 7 months ago (2013-05-23 07:32:21 UTC) #24
koz (OOO until 15th September)
https://codereview.chromium.org/14607023/diff/202001/apps/saved_files_service.cc File apps/saved_files_service.cc (right): https://codereview.chromium.org/14607023/diff/202001/apps/saved_files_service.cc#newcode212 apps/saved_files_service.cc:212: MaybeClearQueue(extension); ClearQueueIfNoRetainPermission()? https://codereview.chromium.org/14607023/diff/202001/chrome/browser/extensions/api/file_system/file_system_apitest.cc File chrome/browser/extensions/api/file_system/file_system_apitest.cc (right): https://codereview.chromium.org/14607023/diff/202001/chrome/browser/extensions/api/file_system/file_system_apitest.cc#newcode52 chrome/browser/extensions/api/file_system/file_system_apitest.cc:52: service->RegisterFileEntry(extension->id(), ...
7 years, 7 months ago (2013-05-24 00:13:16 UTC) #25
Matt Giuca
https://codereview.chromium.org/14607023/diff/202001/apps/app_restore_service.cc File apps/app_restore_service.cc (right): https://codereview.chromium.org/14607023/diff/202001/apps/app_restore_service.cc#newcode74 apps/app_restore_service.cc:74: // On a Chrome restart, restore the running apps. ...
7 years, 7 months ago (2013-05-24 00:24:02 UTC) #26
koz (OOO until 15th September)
https://codereview.chromium.org/14607023/diff/202001/apps/app_restore_service.cc File apps/app_restore_service.cc (right): https://codereview.chromium.org/14607023/diff/202001/apps/app_restore_service.cc#newcode74 apps/app_restore_service.cc:74: // On a Chrome restart, restore the running apps. ...
7 years, 7 months ago (2013-05-24 00:28:43 UTC) #27
Sam McNally
https://codereview.chromium.org/14607023/diff/202001/apps/app_restore_service.cc File apps/app_restore_service.cc (right): https://codereview.chromium.org/14607023/diff/202001/apps/app_restore_service.cc#newcode74 apps/app_restore_service.cc:74: // On a Chrome restart, restore the running apps. ...
7 years, 7 months ago (2013-05-24 00:46:02 UTC) #28
koz (OOO until 15th September)
LGTM Nicely done!
7 years, 7 months ago (2013-05-24 00:53:44 UTC) #29
Matt Giuca
https://codereview.chromium.org/14607023/diff/202001/chrome/browser/extensions/api/file_system/file_system_api.cc File chrome/browser/extensions/api/file_system/file_system_api.cc (right): https://codereview.chromium.org/14607023/diff/202001/chrome/browser/extensions/api/file_system/file_system_api.cc#newcode784 chrome/browser/extensions/api/file_system/file_system_api.cc:784: ->GetFileEntry(extension_->id(), entry_id); I've seen humans recommend it too. Perhaps ...
7 years, 7 months ago (2013-05-24 00:56:59 UTC) #30
benwells
Removing myself as a reviewer as koz and mgiuca have covered it pretty thoroughly. Looking ...
7 years, 7 months ago (2013-05-24 03:26:32 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sammc@chromium.org/14607023/234001
7 years, 7 months ago (2013-05-24 04:38:07 UTC) #32
commit-bot: I haz the power
Failed to apply patch for chrome/browser/extensions/extension_function_histogram_value.h: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 7 months ago (2013-05-24 04:38:19 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sammc@chromium.org/14607023/238001
7 years, 7 months ago (2013-05-24 04:42:03 UTC) #34
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) base_unittests, cacheinvalidation_unittests, cc_unittests, check_deps, chromedriver2_unittests, components_unittests, ...
7 years, 7 months ago (2013-05-24 13:01:13 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sammc@chromium.org/14607023/238001
7 years, 7 months ago (2013-05-24 23:33:53 UTC) #36
commit-bot: I haz the power
Failed to apply patch for chrome/browser/extensions/extension_function_histogram_value.h: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 7 months ago (2013-05-24 23:34:10 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sammc@chromium.org/14607023/257001
7 years, 7 months ago (2013-05-24 23:44:29 UTC) #38
commit-bot: I haz the power
7 years, 7 months ago (2013-05-25 14:09:26 UTC) #39
Message was sent while issue was closed.
Change committed as 202276

Powered by Google App Engine
This is Rietveld 408576698