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 24 matching lines...) Expand all Loading... |
35 #include "platform/FileMetadata.h" | 35 #include "platform/FileMetadata.h" |
36 #include "public/platform/WebFileInfo.h" | 36 #include "public/platform/WebFileInfo.h" |
37 #include "public/platform/WebFileSystem.h" | 37 #include "public/platform/WebFileSystem.h" |
38 #include "public/platform/WebFileSystemEntry.h" | 38 #include "public/platform/WebFileSystemEntry.h" |
39 #include "public/platform/WebFileWriter.h" | 39 #include "public/platform/WebFileWriter.h" |
40 #include "public/platform/WebString.h" | 40 #include "public/platform/WebString.h" |
41 #include "wtf/PassOwnPtr.h" | 41 #include "wtf/PassOwnPtr.h" |
42 #include "wtf/PassRefPtr.h" | 42 #include "wtf/PassRefPtr.h" |
43 #include "wtf/RefCounted.h" | 43 #include "wtf/RefCounted.h" |
44 | 44 |
45 using namespace blink; | |
46 | |
47 namespace blink { | 45 namespace blink { |
48 | 46 |
49 class WebFileSystemCallbacksPrivate : public RefCounted<WebFileSystemCallbacksPr
ivate> { | 47 class WebFileSystemCallbacksPrivate : public RefCounted<WebFileSystemCallbacksPr
ivate> { |
50 public: | 48 public: |
51 static PassRefPtr<WebFileSystemCallbacksPrivate> create(const PassOwnPtr<Asy
ncFileSystemCallbacks>& callbacks) | 49 static PassRefPtr<WebFileSystemCallbacksPrivate> create(const PassOwnPtr<Asy
ncFileSystemCallbacks>& callbacks) |
52 { | 50 { |
53 return adoptRef(new WebFileSystemCallbacksPrivate(callbacks)); | 51 return adoptRef(new WebFileSystemCallbacksPrivate(callbacks)); |
54 } | 52 } |
55 | 53 |
56 AsyncFileSystemCallbacks* callbacks() { return m_callbacks.get(); } | 54 AsyncFileSystemCallbacks* callbacks() { return m_callbacks.get(); } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 void WebFileSystemCallbacks::didOpenFileSystem(const WebString& name, const WebU
RL& rootURL) | 122 void WebFileSystemCallbacks::didOpenFileSystem(const WebString& name, const WebU
RL& rootURL) |
125 { | 123 { |
126 ASSERT(!m_private.isNull()); | 124 ASSERT(!m_private.isNull()); |
127 m_private->callbacks()->didOpenFileSystem(name, rootURL); | 125 m_private->callbacks()->didOpenFileSystem(name, rootURL); |
128 m_private.reset(); | 126 m_private.reset(); |
129 } | 127 } |
130 | 128 |
131 void WebFileSystemCallbacks::didResolveURL(const WebString& name, const WebURL&
rootURL, WebFileSystemType type, const WebString& filePath, bool isDirectory) | 129 void WebFileSystemCallbacks::didResolveURL(const WebString& name, const WebURL&
rootURL, WebFileSystemType type, const WebString& filePath, bool isDirectory) |
132 { | 130 { |
133 ASSERT(!m_private.isNull()); | 131 ASSERT(!m_private.isNull()); |
134 m_private->callbacks()->didResolveURL(name, rootURL, static_cast<blink::File
SystemType>(type), filePath, isDirectory); | 132 m_private->callbacks()->didResolveURL(name, rootURL, static_cast<FileSystemT
ype>(type), filePath, isDirectory); |
135 m_private.reset(); | 133 m_private.reset(); |
136 } | 134 } |
137 | 135 |
138 void WebFileSystemCallbacks::didCreateFileWriter(WebFileWriter* webFileWriter, l
ong long length) | 136 void WebFileSystemCallbacks::didCreateFileWriter(WebFileWriter* webFileWriter, l
ong long length) |
139 { | 137 { |
140 ASSERT(!m_private.isNull()); | 138 ASSERT(!m_private.isNull()); |
141 m_private->callbacks()->didCreateFileWriter(adoptPtr(webFileWriter), length)
; | 139 m_private->callbacks()->didCreateFileWriter(adoptPtr(webFileWriter), length)
; |
142 m_private.reset(); | 140 m_private.reset(); |
143 } | 141 } |
144 | 142 |
145 void WebFileSystemCallbacks::didFail(WebFileError error) | 143 void WebFileSystemCallbacks::didFail(WebFileError error) |
146 { | 144 { |
147 ASSERT(!m_private.isNull()); | 145 ASSERT(!m_private.isNull()); |
148 m_private->callbacks()->didFail(error); | 146 m_private->callbacks()->didFail(error); |
149 m_private.reset(); | 147 m_private.reset(); |
150 } | 148 } |
151 | 149 |
152 bool WebFileSystemCallbacks::shouldBlockUntilCompletion() const | 150 bool WebFileSystemCallbacks::shouldBlockUntilCompletion() const |
153 { | 151 { |
154 ASSERT(!m_private.isNull()); | 152 ASSERT(!m_private.isNull()); |
155 return m_private->callbacks()->shouldBlockUntilCompletion(); | 153 return m_private->callbacks()->shouldBlockUntilCompletion(); |
156 } | 154 } |
157 | 155 |
158 } // namespace blink | 156 } // namespace blink |
OLD | NEW |