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

Issue 4821005: Make FileSystemOperation's lifetime more explicit. (Closed)

Created:
10 years, 1 month ago by kinuko
Modified:
9 years, 7 months ago
Reviewers:
dumi, ericu, michaeln
CC:
chromium-reviews, pam+watch_chromium.org, darin-cc_chromium.org, ben+cc_chromium.org, michaeln, kinuko, Paweł Hajdan Jr.
Visibility:
Public.

Description

Make FileSystemOperation's lifetime more explicit. In the current code calling dispatcher->DidXxx in an operation's DidXxx method MAY indirectly delete the operation itself depending on the dispatcher's implementation. I was confused by this several times and I want to make this flow more explicit. This patch lets FileSystemOperation control its lifetime by itself so that each callback dispatcher implementation does not need to take care of it. Also moved BrowserFileSystemCallbackDispatcher into file_system_dispatcher_host.cc as it's only used in it and its implementation is tightly coupled with the DispatcherHost. BUG=60243 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=67732

Patch Set 1 : '' #

Total comments: 4

Patch Set 2 : w/o destructive_dispatcher #

Total comments: 2

Patch Set 3 : rebased (upon codereview/4879001) #

Total comments: 1

Patch Set 4 : rebased + add comment #

Patch Set 5 : simple_file_writer fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+255 lines, -335 lines) Patch
D chrome/browser/file_system/browser_file_system_callback_dispatcher.h View 1 chunk +0 lines, -35 lines 0 comments Download
D chrome/browser/file_system/browser_file_system_callback_dispatcher.cc View 1 chunk +0 lines, -60 lines 0 comments Download
M chrome/browser/file_system/file_system_dispatcher_host.h View 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/file_system/file_system_dispatcher_host.cc View 3 chunks +54 lines, -2 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 1 chunk +0 lines, -2 lines 0 comments Download
M webkit/fileapi/file_system_operation.h View 1 2 3 4 3 chunks +10 lines, -6 lines 0 comments Download
M webkit/fileapi/file_system_operation.cc View 1 12 chunks +22 lines, -12 lines 0 comments Download
M webkit/fileapi/file_system_operation_unittest.cc View 1 2 3 43 chunks +107 lines, -167 lines 0 comments Download
M webkit/fileapi/sandboxed_file_system_operation.h View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
M webkit/fileapi/sandboxed_file_system_operation.cc View 1 2 6 chunks +37 lines, -12 lines 0 comments Download
M webkit/tools/test_shell/simple_file_system.cc View 1 2 3 6 chunks +2 lines, -22 lines 0 comments Download
M webkit/tools/test_shell/simple_file_writer.cc View 1 2 3 4 10 chunks +17 lines, -14 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
kinuko
10 years, 1 month ago (2010-11-12 20:28:37 UTC) #1
ericu
I have some small comments below, but overall I'm iffy on this changelist. I'm not ...
10 years, 1 month ago (2010-11-16 19:26:54 UTC) #2
kinuko
Removed the destructive_dispatcher stuff (it's a last min hacky device). How does it look now? ...
10 years, 1 month ago (2010-11-16 20:29:08 UTC) #3
michaeln
This CL is definitely more involved than the other one. http://codereview.chromium.org/4821005/diff/19001/webkit/tools/test_shell/simple_file_system.cc File webkit/tools/test_shell/simple_file_system.cc (left): http://codereview.chromium.org/4821005/diff/19001/webkit/tools/test_shell/simple_file_system.cc#oldcode87 ...
10 years, 1 month ago (2010-11-18 01:49:05 UTC) #4
ericu
10 years, 1 month ago (2010-11-23 03:18:20 UTC) #5
LGTM

http://codereview.chromium.org/4821005/diff/33001/webkit/fileapi/sandboxed_fi...
File webkit/fileapi/sandboxed_file_system_operation.cc (right):

http://codereview.chromium.org/4821005/diff/33001/webkit/fileapi/sandboxed_fi...
webkit/fileapi/sandboxed_file_system_operation.cc:162: if
(!file_system_context_->path_manager()->CrackFileSystemPath(
In general, any dispatcher()->didFoo call is followed by a "delete this;".  It's
not for these last two utility functions; that's worth a comment.

Powered by Google App Engine
This is Rietveld 408576698