Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: content/child/child_thread_impl.h

Issue 2544953002: content: Some code cleanup related to shared memory allocation. (Closed)
Patch Set: tot merge Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/child/child_shared_bitmap_manager.cc ('k') | content/child/child_thread_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // A static variant that can be called on background threads.
nasko 2016/12/08 18:40:10 A static variant of what? The non-static method is
sadrul 2016/12/08 19:50:59 Done.
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( 113 static std::unique_ptr<base::SharedMemory> AllocateSharedMemory(
123 size_t buf_size, 114 size_t buf_size);
124 IPC::Sender* sender,
125 bool* out_of_memory);
126 115
127 #if defined(OS_LINUX) 116 #if defined(OS_LINUX)
128 void SetThreadPriority(base::PlatformThreadId id, 117 void SetThreadPriority(base::PlatformThreadId id,
129 base::ThreadPriority priority); 118 base::ThreadPriority priority);
130 #endif 119 #endif
131 120
132 ResourceDispatcher* resource_dispatcher() const { 121 ResourceDispatcher* resource_dispatcher() const {
133 return resource_dispatcher_.get(); 122 return resource_dispatcher_.get();
134 } 123 }
135 124
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 341
353 private: 342 private:
354 struct Options options_; 343 struct Options options_;
355 344
356 DISALLOW_COPY_AND_ASSIGN(Builder); 345 DISALLOW_COPY_AND_ASSIGN(Builder);
357 }; 346 };
358 347
359 } // namespace content 348 } // namespace content
360 349
361 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ 350 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_
OLDNEW
« no previous file with comments | « content/child/child_shared_bitmap_manager.cc ('k') | content/child/child_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698