| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_CHILD_FILEAPI_WEBFILESYSTEM_IMPL_H_ | 5 #ifndef CONTENT_CHILD_FILEAPI_WEBFILESYSTEM_IMPL_H_ |
| 6 #define CONTENT_CHILD_FILEAPI_WEBFILESYSTEM_IMPL_H_ | 6 #define CONTENT_CHILD_FILEAPI_WEBFILESYSTEM_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/threading/non_thread_safe.h" | 13 #include "base/sequence_checker.h" |
| 14 #include "content/public/child/worker_thread.h" | 14 #include "content/public/child/worker_thread.h" |
| 15 #include "third_party/WebKit/public/platform/WebFileSystem.h" | 15 #include "third_party/WebKit/public/platform/WebFileSystem.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class SingleThreadTaskRunner; | 18 class SingleThreadTaskRunner; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace blink { | 21 namespace blink { |
| 22 class WebURL; | 22 class WebURL; |
| 23 class WebFileWriterClient; | 23 class WebFileWriterClient; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace content { | 26 namespace content { |
| 27 | 27 |
| 28 class WebFileSystemImpl : public blink::WebFileSystem, | 28 class WebFileSystemImpl : public blink::WebFileSystem, |
| 29 public WorkerThread::Observer, | 29 public WorkerThread::Observer { |
| 30 public base::NonThreadSafe { | |
| 31 public: | 30 public: |
| 32 class WaitableCallbackResults; | 31 class WaitableCallbackResults; |
| 33 | 32 |
| 34 // Returns thread-specific instance. If non-null |main_thread_loop| | 33 // Returns thread-specific instance. If non-null |main_thread_loop| |
| 35 // is given and no thread-specific instance has been created it may | 34 // is given and no thread-specific instance has been created it may |
| 36 // create a new instance. | 35 // create a new instance. |
| 37 static WebFileSystemImpl* ThreadSpecificInstance( | 36 static WebFileSystemImpl* ThreadSpecificInstance( |
| 38 const scoped_refptr<base::SingleThreadTaskRunner>& | 37 const scoped_refptr<base::SingleThreadTaskRunner>& |
| 39 main_thread_task_runner); | 38 main_thread_task_runner); |
| 40 | 39 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 99 |
| 101 WaitableCallbackResults* MaybeCreateWaitableResults( | 100 WaitableCallbackResults* MaybeCreateWaitableResults( |
| 102 const blink::WebFileSystemCallbacks& callbacks, int callbacks_id); | 101 const blink::WebFileSystemCallbacks& callbacks, int callbacks_id); |
| 103 | 102 |
| 104 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 103 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 105 | 104 |
| 106 CallbacksMap callbacks_; | 105 CallbacksMap callbacks_; |
| 107 int next_callbacks_id_; | 106 int next_callbacks_id_; |
| 108 WaitableCallbackResultsMap waitable_results_; | 107 WaitableCallbackResultsMap waitable_results_; |
| 109 | 108 |
| 109 SEQUENCE_CHECKER(sequence_checker_); |
| 110 |
| 110 DISALLOW_COPY_AND_ASSIGN(WebFileSystemImpl); | 111 DISALLOW_COPY_AND_ASSIGN(WebFileSystemImpl); |
| 111 }; | 112 }; |
| 112 | 113 |
| 113 } // namespace content | 114 } // namespace content |
| 114 | 115 |
| 115 #endif // CONTENT_CHILD_FILEAPI_WEBFILESYSTEM_IMPL_H_ | 116 #endif // CONTENT_CHILD_FILEAPI_WEBFILESYSTEM_IMPL_H_ |
| OLD | NEW |