| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 27 matching lines...) Expand all Loading... |
| 38 #include "public/platform/WebFileWriter.h" | 38 #include "public/platform/WebFileWriter.h" |
| 39 #include "public/platform/WebString.h" | 39 #include "public/platform/WebString.h" |
| 40 #include "wtf/PassOwnPtr.h" | 40 #include "wtf/PassOwnPtr.h" |
| 41 #include "wtf/PassRefPtr.h" | 41 #include "wtf/PassRefPtr.h" |
| 42 #include "wtf/RefCounted.h" | 42 #include "wtf/RefCounted.h" |
| 43 | 43 |
| 44 namespace blink { | 44 namespace blink { |
| 45 | 45 |
| 46 class WebFileSystemCallbacksPrivate : public RefCounted<WebFileSystemCallbacksPr
ivate> { | 46 class WebFileSystemCallbacksPrivate : public RefCounted<WebFileSystemCallbacksPr
ivate> { |
| 47 public: | 47 public: |
| 48 static PassRefPtr<WebFileSystemCallbacksPrivate> create(const PassOwnPtr<Asy
ncFileSystemCallbacks>& callbacks) | 48 static PassRefPtr<WebFileSystemCallbacksPrivate> create(PassOwnPtr<AsyncFile
SystemCallbacks> callbacks) |
| 49 { | 49 { |
| 50 return adoptRef(new WebFileSystemCallbacksPrivate(callbacks)); | 50 return adoptRef(new WebFileSystemCallbacksPrivate(std::move(callbacks)))
; |
| 51 } | 51 } |
| 52 | 52 |
| 53 AsyncFileSystemCallbacks* callbacks() { return m_callbacks.get(); } | 53 AsyncFileSystemCallbacks* callbacks() { return m_callbacks.get(); } |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 WebFileSystemCallbacksPrivate(const PassOwnPtr<AsyncFileSystemCallbacks>& ca
llbacks) : m_callbacks(callbacks) { } | 56 WebFileSystemCallbacksPrivate(PassOwnPtr<AsyncFileSystemCallbacks> callbacks
) : m_callbacks(std::move(callbacks)) { } |
| 57 OwnPtr<AsyncFileSystemCallbacks> m_callbacks; | 57 OwnPtr<AsyncFileSystemCallbacks> m_callbacks; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 WebFileSystemCallbacks::WebFileSystemCallbacks(const PassOwnPtr<AsyncFileSystemC
allbacks>& callbacks) | 60 WebFileSystemCallbacks::WebFileSystemCallbacks(PassOwnPtr<AsyncFileSystemCallbac
ks>&& callbacks) |
| 61 { | 61 { |
| 62 m_private = WebFileSystemCallbacksPrivate::create(callbacks); | 62 m_private = WebFileSystemCallbacksPrivate::create(std::move(callbacks)); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void WebFileSystemCallbacks::reset() | 65 void WebFileSystemCallbacks::reset() |
| 66 { | 66 { |
| 67 m_private.reset(); | 67 m_private.reset(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void WebFileSystemCallbacks::assign(const WebFileSystemCallbacks& other) | 70 void WebFileSystemCallbacks::assign(const WebFileSystemCallbacks& other) |
| 71 { | 71 { |
| 72 m_private = other.m_private; | 72 m_private = other.m_private; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 m_private.reset(); | 146 m_private.reset(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 bool WebFileSystemCallbacks::shouldBlockUntilCompletion() const | 149 bool WebFileSystemCallbacks::shouldBlockUntilCompletion() const |
| 150 { | 150 { |
| 151 ASSERT(!m_private.isNull()); | 151 ASSERT(!m_private.isNull()); |
| 152 return m_private->callbacks()->shouldBlockUntilCompletion(); | 152 return m_private->callbacks()->shouldBlockUntilCompletion(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 } // namespace blink | 155 } // namespace blink |
| OLD | NEW |