| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/renderer_host/pepper/pepper_file_system_browser_host.h
" | 5 #include "content/browser/renderer_host/pepper/pepper_file_system_browser_host.h
" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "content/browser/renderer_host/pepper/pepper_file_io_host.h" | 9 #include "content/browser/renderer_host/pepper/pepper_file_io_host.h" |
| 10 #include "content/browser/renderer_host/pepper/quota_reservation.h" | 10 #include "content/browser/renderer_host/pepper/quota_reservation.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 namespace content { | 30 namespace content { |
| 31 | 31 |
| 32 namespace { | 32 namespace { |
| 33 | 33 |
| 34 // This is the minimum amount of quota we reserve per file system. | 34 // This is the minimum amount of quota we reserve per file system. |
| 35 const int64_t kMinimumQuotaReservationSize = 1024 * 1024; // 1 MB | 35 const int64_t kMinimumQuotaReservationSize = 1024 * 1024; // 1 MB |
| 36 | 36 |
| 37 scoped_refptr<fileapi::FileSystemContext> | 37 scoped_refptr<fileapi::FileSystemContext> |
| 38 GetFileSystemContextFromRenderId(int render_process_id) { | 38 GetFileSystemContextFromRenderId(int render_process_id) { |
| 39 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 39 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 40 RenderProcessHost* host = RenderProcessHost::FromID(render_process_id); | 40 RenderProcessHost* host = RenderProcessHost::FromID(render_process_id); |
| 41 if (!host) | 41 if (!host) |
| 42 return NULL; | 42 return NULL; |
| 43 StoragePartition* storage_partition = host->GetStoragePartition(); | 43 StoragePartition* storage_partition = host->GetStoragePartition(); |
| 44 if (!storage_partition) | 44 if (!storage_partition) |
| 45 return NULL; | 45 return NULL; |
| 46 return storage_partition->GetFileSystemContext(); | 46 return storage_partition->GetFileSystemContext(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 } // namespace | 49 } // namespace |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 if (!IsAsciiAlpha(*it) && !IsAsciiDigit(*it) && | 499 if (!IsAsciiAlpha(*it) && !IsAsciiDigit(*it) && |
| 500 *it != '.' && *it != '_' && *it != '-') { | 500 *it != '.' && *it != '_' && *it != '-') { |
| 501 LOG(WARNING) << "Failed to generate a plugin id."; | 501 LOG(WARNING) << "Failed to generate a plugin id."; |
| 502 return std::string(); | 502 return std::string(); |
| 503 } | 503 } |
| 504 } | 504 } |
| 505 return output; | 505 return output; |
| 506 } | 506 } |
| 507 | 507 |
| 508 } // namespace content | 508 } // namespace content |
| OLD | NEW |