OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_CHILD_WEBTHREADEDRESOURCEPROVIDER_IMPL_H_ |
| 6 #define CONTENT_CHILD_WEBTHREADEDRESOURCEPROVIDER_IMPL_H_ |
| 7 |
| 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/linked_ptr.h" |
| 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/shared_memory.h" |
| 13 #include "base/memory/weak_ptr.h" |
| 14 #include "content/common/content_export.h" |
| 15 #include "ipc/ipc_channel_proxy.h" |
| 16 #include "third_party/WebKit/public/platform/WebThreadedResourceProvider.h" |
| 17 |
| 18 namespace webkit_glue { |
| 19 class WebThreadImpl; |
| 20 } |
| 21 |
| 22 namespace content { |
| 23 class ResourceDispatcher; |
| 24 |
| 25 class WebThreadedResourceProviderImpl |
| 26 : public blink::WebThreadedResourceProvider { |
| 27 public: |
| 28 WebThreadedResourceProviderImpl( |
| 29 int request_id, |
| 30 base::WeakPtr<ResourceDispatcher> resource_dispatcher, |
| 31 linked_ptr<base::SharedMemory> shm_buffer, |
| 32 int shm_size); |
| 33 virtual ~WebThreadedResourceProviderImpl(); |
| 34 |
| 35 // From blink::WebThreadedResourceProvider |
| 36 virtual void setBackgroundClient( |
| 37 blink::WebThreadedResourceBackgroundClient* backgroundClient) OVERRIDE; |
| 38 virtual void setForegroundClient( |
| 39 blink::WebThreadedResourceForegroundClient* foregroundClient) OVERRIDE; |
| 40 virtual blink::WebThread* resourceThread() OVERRIDE; |
| 41 |
| 42 static void Cleanup(); |
| 43 |
| 44 void OnReceivedData(int data_offset, |
| 45 int data_length, |
| 46 int encoded_data_length); |
| 47 |
| 48 void OnParserResourceMessageFilterAdded(); |
| 49 |
| 50 private: |
| 51 scoped_refptr<IPC::ChannelProxy::MessageFilter> filter_; |
| 52 blink::WebThreadedResourceBackgroundClient* backgroundClient_; |
| 53 blink::WebThreadedResourceForegroundClient* foregroundClient_; |
| 54 int request_id_; |
| 55 base::WeakPtr<ResourceDispatcher> resource_dispatcher_; |
| 56 linked_ptr<base::SharedMemory> shm_buffer_; |
| 57 int shm_size_; |
| 58 base::WeakPtrFactory<WebThreadedResourceProviderImpl> |
| 59 parser_thread_weak_factory_; |
| 60 base::WeakPtrFactory<WebThreadedResourceProviderImpl> |
| 61 main_thread_weak_factory_; |
| 62 base::MessageLoop* main_thread_message_loop; |
| 63 DISALLOW_COPY_AND_ASSIGN(WebThreadedResourceProviderImpl); |
| 64 }; |
| 65 |
| 66 } // namespace content |
| 67 |
| 68 #endif // CONTENT_CHILD_WEBTHREADEDRESOURCEPROVIDER_IMPL_H_ |
OLD | NEW |