OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_COMMON_CHILD_THREAD_H_ | 5 #ifndef CONTENT_COMMON_CHILD_THREAD_H_ |
6 #define CONTENT_COMMON_CHILD_THREAD_H_ | 6 #define CONTENT_COMMON_CHILD_THREAD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/shared_memory.h" |
11 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
12 #include "content/common/message_router.h" | 13 #include "content/common/message_router.h" |
13 #include "webkit/glue/resource_loader_bridge.h" | 14 #include "webkit/glue/resource_loader_bridge.h" |
14 | 15 |
15 class FileSystemDispatcher; | 16 class FileSystemDispatcher; |
16 class MessageLoop; | 17 class MessageLoop; |
17 class NotificationService; | 18 class NotificationService; |
18 class QuotaDispatcher; | 19 class QuotaDispatcher; |
19 class ResourceDispatcher; | 20 class ResourceDispatcher; |
20 class SocketStreamDispatcher; | 21 class SocketStreamDispatcher; |
(...skipping 22 matching lines...) Expand all Loading... |
43 | 44 |
44 IPC::Channel::Listener* ResolveRoute(int32 routing_id); | 45 IPC::Channel::Listener* ResolveRoute(int32 routing_id); |
45 | 46 |
46 IPC::SyncChannel* channel() { return channel_.get(); } | 47 IPC::SyncChannel* channel() { return channel_.get(); } |
47 | 48 |
48 // Creates a ResourceLoaderBridge. | 49 // Creates a ResourceLoaderBridge. |
49 // Tests can override this method if they want a custom loading behavior. | 50 // Tests can override this method if they want a custom loading behavior. |
50 virtual webkit_glue::ResourceLoaderBridge* CreateBridge( | 51 virtual webkit_glue::ResourceLoaderBridge* CreateBridge( |
51 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info); | 52 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info); |
52 | 53 |
| 54 // Allocates a block of shared memory of the given size and |
| 55 // maps in into the address space. Returns NULL of failure. |
| 56 // Note: On posix, this requires a sync IPC to the browser process, |
| 57 // but on windows the child process directly allocates the block. |
| 58 base::SharedMemory* AllocateSharedMemory(size_t buf_size); |
| 59 |
53 ResourceDispatcher* resource_dispatcher(); | 60 ResourceDispatcher* resource_dispatcher(); |
54 | 61 |
55 SocketStreamDispatcher* socket_stream_dispatcher() { | 62 SocketStreamDispatcher* socket_stream_dispatcher() { |
56 return socket_stream_dispatcher_.get(); | 63 return socket_stream_dispatcher_.get(); |
57 } | 64 } |
58 | 65 |
59 FileSystemDispatcher* file_system_dispatcher() const { | 66 FileSystemDispatcher* file_system_dispatcher() const { |
60 return file_system_dispatcher_.get(); | 67 return file_system_dispatcher_.get(); |
61 } | 68 } |
62 | 69 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 scoped_ptr<NotificationService> notification_service_; | 136 scoped_ptr<NotificationService> notification_service_; |
130 | 137 |
131 scoped_ptr<FileSystemDispatcher> file_system_dispatcher_; | 138 scoped_ptr<FileSystemDispatcher> file_system_dispatcher_; |
132 | 139 |
133 scoped_ptr<QuotaDispatcher> quota_dispatcher_; | 140 scoped_ptr<QuotaDispatcher> quota_dispatcher_; |
134 | 141 |
135 DISALLOW_COPY_AND_ASSIGN(ChildThread); | 142 DISALLOW_COPY_AND_ASSIGN(ChildThread); |
136 }; | 143 }; |
137 | 144 |
138 #endif // CONTENT_COMMON_CHILD_THREAD_H_ | 145 #endif // CONTENT_COMMON_CHILD_THREAD_H_ |
OLD | NEW |