OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_THREADED_DATA_PROVIDER_H_ | 5 #ifndef CONTENT_CHILD_THREADED_DATA_PROVIDER_H_ |
6 #define CONTENT_CHILD_THREADED_DATA_PROVIDER_H_ | 6 #define CONTENT_CHILD_THREADED_DATA_PROVIDER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/linked_ptr.h" | 9 #include "base/memory/linked_ptr.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/shared_memory.h" | 12 #include "base/memory/shared_memory.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "ipc/ipc_channel.h" | 14 #include "ipc/ipc_channel.h" |
15 #include "ipc/message_filter.h" | 15 #include "ipc/message_filter.h" |
16 | 16 |
17 struct ResourceMsg_RequestCompleteData; | 17 struct ResourceMsg_RequestCompleteData; |
18 | 18 |
19 namespace blink { | 19 namespace blink { |
20 class WebThreadedDataReceiver; | 20 class WebThreadedDataReceiver; |
21 } | 21 } |
22 | 22 |
23 namespace IPC { | 23 namespace IPC { |
24 class SyncChannel; | 24 class SyncChannel; |
25 } | 25 } |
26 | 26 |
27 namespace content { | 27 namespace content { |
28 class ResourceDispatcher; | 28 class ResourceDispatcher; |
29 class WebThreadImplForWorkerScheduler; | 29 class WebThreadImpl; |
30 | 30 |
31 class ThreadedDataProvider { | 31 class ThreadedDataProvider { |
32 public: | 32 public: |
33 ThreadedDataProvider( | 33 ThreadedDataProvider( |
34 int request_id, | 34 int request_id, |
35 blink::WebThreadedDataReceiver* threaded_data_receiver, | 35 blink::WebThreadedDataReceiver* threaded_data_receiver, |
36 linked_ptr<base::SharedMemory> shm_buffer, | 36 linked_ptr<base::SharedMemory> shm_buffer, |
37 int shm_size, | 37 int shm_size, |
38 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_); | 38 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_); |
39 | 39 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 scoped_ptr<std::vector<char> > data_copy, | 71 scoped_ptr<std::vector<char> > data_copy, |
72 int data_length, | 72 int data_length, |
73 int encoded_data_length); | 73 int encoded_data_length); |
74 | 74 |
75 scoped_refptr<IPC::MessageFilter> filter_; | 75 scoped_refptr<IPC::MessageFilter> filter_; |
76 int request_id_; | 76 int request_id_; |
77 linked_ptr<base::SharedMemory> shm_buffer_; | 77 linked_ptr<base::SharedMemory> shm_buffer_; |
78 int shm_size_; | 78 int shm_size_; |
79 scoped_ptr<base::WeakPtrFactory<ThreadedDataProvider> > | 79 scoped_ptr<base::WeakPtrFactory<ThreadedDataProvider> > |
80 background_thread_weak_factory_; | 80 background_thread_weak_factory_; |
81 WebThreadImplForWorkerScheduler& background_thread_; | 81 WebThreadImpl& background_thread_; |
82 IPC::SyncChannel* ipc_channel_; | 82 IPC::SyncChannel* ipc_channel_; |
83 blink::WebThreadedDataReceiver* threaded_data_receiver_; | 83 blink::WebThreadedDataReceiver* threaded_data_receiver_; |
84 bool resource_filter_active_; | 84 bool resource_filter_active_; |
85 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 85 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
86 | 86 |
87 struct QueuedSharedMemoryData { | 87 struct QueuedSharedMemoryData { |
88 const char* data; | 88 const char* data; |
89 int length; | 89 int length; |
90 int encoded_length; | 90 int encoded_length; |
91 }; | 91 }; |
92 std::vector<QueuedSharedMemoryData> queued_data_; | 92 std::vector<QueuedSharedMemoryData> queued_data_; |
93 | 93 |
94 base::WeakPtrFactory<ThreadedDataProvider> | 94 base::WeakPtrFactory<ThreadedDataProvider> |
95 main_thread_weak_factory_; | 95 main_thread_weak_factory_; |
96 | 96 |
97 DISALLOW_COPY_AND_ASSIGN(ThreadedDataProvider); | 97 DISALLOW_COPY_AND_ASSIGN(ThreadedDataProvider); |
98 }; | 98 }; |
99 | 99 |
100 } // namespace content | 100 } // namespace content |
101 | 101 |
102 #endif // CONTENT_CHILD_THREADED_DATA_PROVIDER_H_ | 102 #endif // CONTENT_CHILD_THREADED_DATA_PROVIDER_H_ |
OLD | NEW |