| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 } | 100 } |
| 101 | 101 |
| 102 template <typename CB, typename CBArg> | 102 template <typename CB, typename CBArg> |
| 103 void FileSystemCallbacksBase::handleEventOrScheduleCallback(CB* callback, | 103 void FileSystemCallbacksBase::handleEventOrScheduleCallback(CB* callback, |
| 104 CBArg* arg) { | 104 CBArg* arg) { |
| 105 DCHECK(callback); | 105 DCHECK(callback); |
| 106 if (callback) { | 106 if (callback) { |
| 107 if (shouldScheduleCallback()) { | 107 if (shouldScheduleCallback()) { |
| 108 DOMFileSystem::scheduleCallback( | 108 DOMFileSystem::scheduleCallback( |
| 109 m_executionContext.get(), | 109 m_executionContext.get(), |
| 110 /* DO NOT MERGE - merge conflict marker. |
| 111 * Please spell |handleEvent| below. */ |
| 110 WTF::bind(&CB::handleEvent, wrapPersistent(callback), | 112 WTF::bind(&CB::handleEvent, wrapPersistent(callback), |
| 111 wrapPersistent(arg))); | 113 wrapPersistent(arg))); |
| 112 } else { | 114 } else { |
| 115 /* DO NOT MERGE - merge conflict marker. |
| 116 * Please spell |handleEvent| below. */ |
| 113 callback->handleEvent(arg); | 117 callback->handleEvent(arg); |
| 114 } | 118 } |
| 115 } | 119 } |
| 116 m_executionContext.clear(); | 120 m_executionContext.clear(); |
| 117 } | 121 } |
| 118 | 122 |
| 119 template <typename CB> | 123 template <typename CB> |
| 120 void FileSystemCallbacksBase::handleEventOrScheduleCallback(CB* callback) { | 124 void FileSystemCallbacksBase::handleEventOrScheduleCallback(CB* callback) { |
| 121 DCHECK(callback); | 125 DCHECK(callback); |
| 122 if (callback) { | 126 if (callback) { |
| 123 if (shouldScheduleCallback()) { | 127 if (shouldScheduleCallback()) { |
| 124 DOMFileSystem::scheduleCallback( | 128 DOMFileSystem::scheduleCallback( |
| 125 m_executionContext.get(), | 129 m_executionContext.get(), |
| 130 /* DO NOT MERGE - merge conflict marker. |
| 131 * Please spell |handleEvent| below. */ |
| 126 WTF::bind(&CB::handleEvent, wrapPersistent(callback))); | 132 WTF::bind(&CB::handleEvent, wrapPersistent(callback))); |
| 127 } else { | 133 } else { |
| 134 /* DO NOT MERGE - merge conflict marker. |
| 135 * Please spell |handleEvent| below. */ |
| 128 callback->handleEvent(); | 136 callback->handleEvent(); |
| 129 } | 137 } |
| 130 } | 138 } |
| 131 m_executionContext.clear(); | 139 m_executionContext.clear(); |
| 132 } | 140 } |
| 133 | 141 |
| 134 // ScriptErrorCallback -------------------------------------------------------- | 142 // ScriptErrorCallback -------------------------------------------------------- |
| 135 | 143 |
| 136 // static | 144 // static |
| 137 ScriptErrorCallback* ScriptErrorCallback::wrap(ErrorCallback* callback) { | 145 ScriptErrorCallback* ScriptErrorCallback::wrap(ErrorCallback* callback) { |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 DOMFileSystemBase* fileSystem) | 430 DOMFileSystemBase* fileSystem) |
| 423 : FileSystemCallbacksBase(errorCallback, fileSystem, context), | 431 : FileSystemCallbacksBase(errorCallback, fileSystem, context), |
| 424 m_successCallback(successCallback) {} | 432 m_successCallback(successCallback) {} |
| 425 | 433 |
| 426 void VoidCallbacks::didSucceed() { | 434 void VoidCallbacks::didSucceed() { |
| 427 if (m_successCallback) | 435 if (m_successCallback) |
| 428 handleEventOrScheduleCallback(m_successCallback.release()); | 436 handleEventOrScheduleCallback(m_successCallback.release()); |
| 429 } | 437 } |
| 430 | 438 |
| 431 } // namespace blink | 439 } // namespace blink |
| OLD | NEW |