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); |