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

Unified Diff: chrome/browser/extensions/api/file_system/file_system_api.cc

Issue 23629033: Fix a crash in the FileSystem API when the app window closes during a call. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/file_system/file_system_api.cc
diff --git a/chrome/browser/extensions/api/file_system/file_system_api.cc b/chrome/browser/extensions/api/file_system/file_system_api.cc
index a6e91cb30de3808c4a33d1f60025fa35fbdee455..ebd1c4724f24339e446579ac62aef7ccb17d7592 100644
--- a/chrome/browser/extensions/api/file_system/file_system_api.cc
+++ b/chrome/browser/extensions/api/file_system/file_system_api.cc
@@ -164,6 +164,7 @@ bool ValidateFileEntryAndGetPath(
// filesystem.
content::ChildProcessSecurityPolicy* policy =
content::ChildProcessSecurityPolicy::GetInstance();
+ DCHECK(render_view_host);
benwells 2013/09/10 00:47:14 Why add all these DCHECKs?
Sam McNally 2013/09/10 01:04:13 No real reason.
if (!policy->CanReadFileSystem(render_view_host->GetProcess()->GetID(),
filesystem_id)) {
*error = kSecurityError;
@@ -339,6 +340,8 @@ void FileSystemEntryFunction::CheckWritableFiles(
void FileSystemEntryFunction::RegisterFileSystemsAndSendResponse(
const std::vector<base::FilePath>& paths) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ if (!render_view_host_)
+ return;
CreateResponse();
for (std::vector<base::FilePath>::const_iterator it = paths.begin();
@@ -361,6 +364,7 @@ void FileSystemEntryFunction::AddEntryToResponse(
const base::FilePath& path,
const std::string& id_override) {
DCHECK(response_);
+ DCHECK(render_view_host_);
extensions::app_file_handler_util::GrantedFileEntry file_entry =
extensions::app_file_handler_util::CreateFileEntry(
profile(),
@@ -451,6 +455,7 @@ bool FileSystemIsWritableEntryFunction::RunImpl() {
content::ChildProcessSecurityPolicy* policy =
content::ChildProcessSecurityPolicy::GetInstance();
+ DCHECK(render_view_host_);
int renderer_id = render_view_host_->GetProcess()->GetID();
bool is_writable = policy->CanReadWriteFileSystem(renderer_id,
filesystem_id);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698