| 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/public/test/test_file_system_backend.h" | 5 #include "content/public/test/test_file_system_backend.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 public FileUpdateObserver { | 54 public FileUpdateObserver { |
| 55 public: | 55 public: |
| 56 explicit QuotaUtil(base::SequencedTaskRunner* task_runner) | 56 explicit QuotaUtil(base::SequencedTaskRunner* task_runner) |
| 57 : usage_(0), | 57 : usage_(0), |
| 58 task_runner_(task_runner) { | 58 task_runner_(task_runner) { |
| 59 update_observers_ = update_observers_.AddObserver(this, task_runner_.get()); | 59 update_observers_ = update_observers_.AddObserver(this, task_runner_.get()); |
| 60 } | 60 } |
| 61 virtual ~QuotaUtil() {} | 61 virtual ~QuotaUtil() {} |
| 62 | 62 |
| 63 // FileSystemQuotaUtil overrides. | 63 // FileSystemQuotaUtil overrides. |
| 64 virtual base::PlatformFileError DeleteOriginDataOnFileThread( | 64 virtual base::PlatformFileError DeleteOriginDataOnFileTaskRunner( |
| 65 FileSystemContext* context, | 65 FileSystemContext* context, |
| 66 quota::QuotaManagerProxy* proxy, | 66 quota::QuotaManagerProxy* proxy, |
| 67 const GURL& origin_url, | 67 const GURL& origin_url, |
| 68 FileSystemType type) OVERRIDE { | 68 FileSystemType type) OVERRIDE { |
| 69 NOTREACHED(); | 69 NOTREACHED(); |
| 70 return base::PLATFORM_FILE_OK; | 70 return base::PLATFORM_FILE_OK; |
| 71 } | 71 } |
| 72 | 72 |
| 73 virtual scoped_refptr<QuotaReservation> | 73 virtual scoped_refptr<QuotaReservation> |
| 74 CreateQuotaReservationOnFileTaskRunner( | 74 CreateQuotaReservationOnFileTaskRunner( |
| 75 const GURL& origin_url, | 75 const GURL& origin_url, |
| 76 FileSystemType type) OVERRIDE { | 76 FileSystemType type) OVERRIDE { |
| 77 NOTREACHED(); | 77 NOTREACHED(); |
| 78 return scoped_refptr<QuotaReservation>(); | 78 return scoped_refptr<QuotaReservation>(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 virtual void GetOriginsForTypeOnFileThread( | 81 virtual void GetOriginsForTypeOnFileTaskRunner( |
| 82 FileSystemType type, | 82 FileSystemType type, |
| 83 std::set<GURL>* origins) OVERRIDE { | 83 std::set<GURL>* origins) OVERRIDE { |
| 84 NOTREACHED(); | 84 NOTREACHED(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 virtual void GetOriginsForHostOnFileThread( | 87 virtual void GetOriginsForHostOnFileTaskRunner( |
| 88 FileSystemType type, | 88 FileSystemType type, |
| 89 const std::string& host, | 89 const std::string& host, |
| 90 std::set<GURL>* origins) OVERRIDE { | 90 std::set<GURL>* origins) OVERRIDE { |
| 91 NOTREACHED(); | 91 NOTREACHED(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 virtual int64 GetOriginUsageOnFileThread( | 94 virtual int64 GetOriginUsageOnFileTaskRunner( |
| 95 FileSystemContext* context, | 95 FileSystemContext* context, |
| 96 const GURL& origin_url, | 96 const GURL& origin_url, |
| 97 FileSystemType type) OVERRIDE { | 97 FileSystemType type) OVERRIDE { |
| 98 return usage_; | 98 return usage_; |
| 99 } | 99 } |
| 100 | 100 |
| 101 virtual void AddFileUpdateObserver( | 101 virtual void AddFileUpdateObserver( |
| 102 FileSystemType type, | 102 FileSystemType type, |
| 103 FileUpdateObserver* observer, | 103 FileUpdateObserver* observer, |
| 104 base::SequencedTaskRunner* task_runner) OVERRIDE { | 104 base::SequencedTaskRunner* task_runner) OVERRIDE { |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 return quota_util_->GetUpdateObservers(type); | 247 return quota_util_->GetUpdateObservers(type); |
| 248 } | 248 } |
| 249 | 249 |
| 250 void TestFileSystemBackend::AddFileChangeObserver( | 250 void TestFileSystemBackend::AddFileChangeObserver( |
| 251 FileChangeObserver* observer) { | 251 FileChangeObserver* observer) { |
| 252 quota_util_->AddFileChangeObserver( | 252 quota_util_->AddFileChangeObserver( |
| 253 kFileSystemTypeTest, observer, quota_util_->task_runner()); | 253 kFileSystemTypeTest, observer, quota_util_->task_runner()); |
| 254 } | 254 } |
| 255 | 255 |
| 256 } // namespace fileapi | 256 } // namespace fileapi |
| OLD | NEW |