OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 DirectoryEntry* DOMFileSystem::root() const { | 114 DirectoryEntry* DOMFileSystem::root() const { |
115 return root_entry_.Get(); | 115 return root_entry_.Get(); |
116 } | 116 } |
117 | 117 |
118 void DOMFileSystem::AddPendingCallbacks() { | 118 void DOMFileSystem::AddPendingCallbacks() { |
119 ++number_of_pending_callbacks_; | 119 ++number_of_pending_callbacks_; |
120 } | 120 } |
121 | 121 |
122 void DOMFileSystem::RemovePendingCallbacks() { | 122 void DOMFileSystem::RemovePendingCallbacks() { |
123 ASSERT(number_of_pending_callbacks_ > 0); | 123 DCHECK_GT(number_of_pending_callbacks_, 0); |
124 --number_of_pending_callbacks_; | 124 --number_of_pending_callbacks_; |
125 } | 125 } |
126 | 126 |
127 bool DOMFileSystem::HasPendingActivity() const { | 127 bool DOMFileSystem::HasPendingActivity() const { |
128 ASSERT(number_of_pending_callbacks_ >= 0); | 128 DCHECK_GE(number_of_pending_callbacks_, 0); |
129 return number_of_pending_callbacks_; | 129 return number_of_pending_callbacks_; |
130 } | 130 } |
131 | 131 |
132 void DOMFileSystem::ReportError(ErrorCallbackBase* error_callback, | 132 void DOMFileSystem::ReportError(ErrorCallbackBase* error_callback, |
133 FileError::ErrorCode file_error) { | 133 FileError::ErrorCode file_error) { |
134 ReportError(GetExecutionContext(), error_callback, file_error); | 134 ReportError(GetExecutionContext(), error_callback, file_error); |
135 } | 135 } |
136 | 136 |
137 void DOMFileSystem::ReportError(ExecutionContext* execution_context, | 137 void DOMFileSystem::ReportError(ExecutionContext* execution_context, |
138 ErrorCallbackBase* error_callback, | 138 ErrorCallbackBase* error_callback, |
(...skipping 26 matching lines...) Expand all Loading... |
165 explicit ConvertToFileWriterCallback(FileWriterCallback* callback) | 165 explicit ConvertToFileWriterCallback(FileWriterCallback* callback) |
166 : callback_(callback) {} | 166 : callback_(callback) {} |
167 Member<FileWriterCallback> callback_; | 167 Member<FileWriterCallback> callback_; |
168 }; | 168 }; |
169 | 169 |
170 } // namespace | 170 } // namespace |
171 | 171 |
172 void DOMFileSystem::CreateWriter(const FileEntry* file_entry, | 172 void DOMFileSystem::CreateWriter(const FileEntry* file_entry, |
173 FileWriterCallback* success_callback, | 173 FileWriterCallback* success_callback, |
174 ErrorCallbackBase* error_callback) { | 174 ErrorCallbackBase* error_callback) { |
175 ASSERT(file_entry); | 175 DCHECK(file_entry); |
176 | 176 |
177 if (!FileSystem()) { | 177 if (!FileSystem()) { |
178 ReportError(error_callback, FileError::kAbortErr); | 178 ReportError(error_callback, FileError::kAbortErr); |
179 return; | 179 return; |
180 } | 180 } |
181 | 181 |
182 FileWriter* file_writer = FileWriter::Create(GetExecutionContext()); | 182 FileWriter* file_writer = FileWriter::Create(GetExecutionContext()); |
183 FileWriterBaseCallback* conversion_callback = | 183 FileWriterBaseCallback* conversion_callback = |
184 ConvertToFileWriterCallback::Create(success_callback); | 184 ConvertToFileWriterCallback::Create(success_callback); |
185 std::unique_ptr<AsyncFileSystemCallbacks> callbacks = | 185 std::unique_ptr<AsyncFileSystemCallbacks> callbacks = |
(...skipping 29 matching lines...) Expand all Loading... |
215 WTF::Passed(std::move(task)))); | 215 WTF::Passed(std::move(task)))); |
216 } | 216 } |
217 | 217 |
218 DEFINE_TRACE(DOMFileSystem) { | 218 DEFINE_TRACE(DOMFileSystem) { |
219 visitor->Trace(root_entry_); | 219 visitor->Trace(root_entry_); |
220 DOMFileSystemBase::Trace(visitor); | 220 DOMFileSystemBase::Trace(visitor); |
221 ContextClient::Trace(visitor); | 221 ContextClient::Trace(visitor); |
222 } | 222 } |
223 | 223 |
224 } // namespace blink | 224 } // namespace blink |
OLD | NEW |