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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 static const int kMaxRecursionDepth = 3; | 43 static const int kMaxRecursionDepth = 3; |
44 static const double progressNotificationIntervalMS = 50; | 44 static const double progressNotificationIntervalMS = 50; |
45 | 45 |
46 FileWriter* FileWriter::create(ExecutionContext* context) { | 46 FileWriter* FileWriter::create(ExecutionContext* context) { |
47 FileWriter* fileWriter = new FileWriter(context); | 47 FileWriter* fileWriter = new FileWriter(context); |
48 fileWriter->suspendIfNeeded(); | 48 fileWriter->suspendIfNeeded(); |
49 return fileWriter; | 49 return fileWriter; |
50 } | 50 } |
51 | 51 |
52 FileWriter::FileWriter(ExecutionContext* context) | 52 FileWriter::FileWriter(ExecutionContext* context) |
53 : ActiveScriptWrappable(this), | 53 : ActiveScriptWrappable<FileWriter>(this), |
54 SuspendableObject(context), | 54 SuspendableObject(context), |
55 m_readyState(kInit), | 55 m_readyState(kInit), |
56 m_operationInProgress(OperationNone), | 56 m_operationInProgress(OperationNone), |
57 m_queuedOperation(OperationNone), | 57 m_queuedOperation(OperationNone), |
58 m_bytesWritten(0), | 58 m_bytesWritten(0), |
59 m_bytesToWrite(0), | 59 m_bytesToWrite(0), |
60 m_truncateLength(-1), | 60 m_truncateLength(-1), |
61 m_numAborts(0), | 61 m_numAborts(0), |
62 m_recursionDepth(0), | 62 m_recursionDepth(0), |
63 m_lastProgressNotificationTimeMS(0) {} | 63 m_lastProgressNotificationTimeMS(0) {} |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 309 |
310 DEFINE_TRACE(FileWriter) { | 310 DEFINE_TRACE(FileWriter) { |
311 visitor->trace(m_error); | 311 visitor->trace(m_error); |
312 visitor->trace(m_blobBeingWritten); | 312 visitor->trace(m_blobBeingWritten); |
313 EventTargetWithInlineData::trace(visitor); | 313 EventTargetWithInlineData::trace(visitor); |
314 FileWriterBase::trace(visitor); | 314 FileWriterBase::trace(visitor); |
315 SuspendableObject::trace(visitor); | 315 SuspendableObject::trace(visitor); |
316 } | 316 } |
317 | 317 |
318 } // namespace blink | 318 } // namespace blink |
OLD | NEW |