OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CHILD_THREAD_IMPL_H_ | 5 #ifndef CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
6 #define CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 6 #define CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 const service_manager::ServiceInfo& GetChildServiceInfo() const; | 102 const service_manager::ServiceInfo& GetChildServiceInfo() const; |
103 const service_manager::ServiceInfo& GetBrowserServiceInfo() const; | 103 const service_manager::ServiceInfo& GetBrowserServiceInfo() const; |
104 bool IsConnectedToBrowser() const; | 104 bool IsConnectedToBrowser() const; |
105 | 105 |
106 IPC::SyncChannel* channel() { return channel_.get(); } | 106 IPC::SyncChannel* channel() { return channel_.get(); } |
107 | 107 |
108 IPC::MessageRouter* GetRouter(); | 108 IPC::MessageRouter* GetRouter(); |
109 | 109 |
110 mojom::RouteProvider* GetRemoteRouteProvider(); | 110 mojom::RouteProvider* GetRemoteRouteProvider(); |
111 | 111 |
112 // Allocates a block of shared memory of the given size. Returns NULL on | 112 // Allocates a block of shared memory of the given size. Returns nullptr on |
113 // failure. | 113 // failure. |
114 // Note: On posix, this requires a sync IPC to the browser process, | |
115 // but on windows the child process directly allocates the block. | |
116 std::unique_ptr<base::SharedMemory> AllocateSharedMemory(size_t buf_size); | |
117 | |
118 // A static variant that can be called on background threads provided | |
119 // the |sender| passed in is safe to use on background threads. | |
120 // |out_of_memory| is an output variable populated on failure which tells the | |
121 // caller whether the failure was caused by an out of memory error. | |
122 static std::unique_ptr<base::SharedMemory> AllocateSharedMemory( | 114 static std::unique_ptr<base::SharedMemory> AllocateSharedMemory( |
123 size_t buf_size, | 115 size_t buf_size); |
124 IPC::Sender* sender, | |
125 bool* out_of_memory); | |
126 | 116 |
127 #if defined(OS_LINUX) | 117 #if defined(OS_LINUX) |
128 void SetThreadPriority(base::PlatformThreadId id, | 118 void SetThreadPriority(base::PlatformThreadId id, |
129 base::ThreadPriority priority); | 119 base::ThreadPriority priority); |
130 #endif | 120 #endif |
131 | 121 |
132 ResourceDispatcher* resource_dispatcher() const { | 122 ResourceDispatcher* resource_dispatcher() const { |
133 return resource_dispatcher_.get(); | 123 return resource_dispatcher_.get(); |
134 } | 124 } |
135 | 125 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 | 342 |
353 private: | 343 private: |
354 struct Options options_; | 344 struct Options options_; |
355 | 345 |
356 DISALLOW_COPY_AND_ASSIGN(Builder); | 346 DISALLOW_COPY_AND_ASSIGN(Builder); |
357 }; | 347 }; |
358 | 348 |
359 } // namespace content | 349 } // namespace content |
360 | 350 |
361 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 351 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
OLD | NEW |