| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // IPC::Sender implementation: | 89 // IPC::Sender implementation: |
| 90 bool Send(IPC::Message* msg) override; | 90 bool Send(IPC::Message* msg) override; |
| 91 | 91 |
| 92 // ChildThread implementation: | 92 // ChildThread implementation: |
| 93 #if defined(OS_WIN) | 93 #if defined(OS_WIN) |
| 94 void PreCacheFont(const LOGFONT& log_font) override; | 94 void PreCacheFont(const LOGFONT& log_font) override; |
| 95 void ReleaseCachedFonts() override; | 95 void ReleaseCachedFonts() override; |
| 96 #endif | 96 #endif |
| 97 void RecordAction(const base::UserMetricsAction& action) override; | 97 void RecordAction(const base::UserMetricsAction& action) override; |
| 98 void RecordComputedAction(const std::string& action) override; | 98 void RecordComputedAction(const std::string& action) override; |
| 99 shell::InterfaceRegistry* GetInterfaceRegistry() override; |
| 100 shell::InterfaceProvider* GetRemoteInterfaces() override; |
| 99 | 101 |
| 100 IPC::SyncChannel* channel() { return channel_.get(); } | 102 IPC::SyncChannel* channel() { return channel_.get(); } |
| 101 | 103 |
| 102 IPC::MessageRouter* GetRouter(); | 104 IPC::MessageRouter* GetRouter(); |
| 103 | 105 |
| 104 // Allocates a block of shared memory of the given size. Returns NULL on | 106 // Allocates a block of shared memory of the given size. Returns NULL on |
| 105 // failure. | 107 // failure. |
| 106 // Note: On posix, this requires a sync IPC to the browser process, | 108 // Note: On posix, this requires a sync IPC to the browser process, |
| 107 // but on windows the child process directly allocates the block. | 109 // but on windows the child process directly allocates the block. |
| 108 std::unique_ptr<base::SharedMemory> AllocateSharedMemory(size_t buf_size); | 110 std::unique_ptr<base::SharedMemory> AllocateSharedMemory(size_t buf_size); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 190 |
| 189 // Returns the one child thread. Can only be called on the main thread. | 191 // Returns the one child thread. Can only be called on the main thread. |
| 190 static ChildThreadImpl* current(); | 192 static ChildThreadImpl* current(); |
| 191 | 193 |
| 192 #if defined(OS_ANDROID) | 194 #if defined(OS_ANDROID) |
| 193 // Called on Android's service thread to shutdown the main thread of this | 195 // Called on Android's service thread to shutdown the main thread of this |
| 194 // process. | 196 // process. |
| 195 static void ShutdownThread(); | 197 static void ShutdownThread(); |
| 196 #endif | 198 #endif |
| 197 | 199 |
| 198 shell::InterfaceRegistry* interface_registry() { | |
| 199 return mojo_application_->interface_registry(); | |
| 200 } | |
| 201 | |
| 202 shell::InterfaceProvider* remote_interfaces() const { | |
| 203 return mojo_application_->remote_interfaces(); | |
| 204 } | |
| 205 | |
| 206 protected: | 200 protected: |
| 207 friend class ChildProcess; | 201 friend class ChildProcess; |
| 208 | 202 |
| 209 // Called when the process refcount is 0. | 203 // Called when the process refcount is 0. |
| 210 void OnProcessFinalRelease(); | 204 void OnProcessFinalRelease(); |
| 211 | 205 |
| 212 virtual bool OnControlMessageReceived(const IPC::Message& msg); | 206 virtual bool OnControlMessageReceived(const IPC::Message& msg); |
| 213 virtual void OnProcessBackgrounded(bool backgrounded); | 207 virtual void OnProcessBackgrounded(bool backgrounded); |
| 214 virtual void OnProcessPurgeAndSuspend(); | 208 virtual void OnProcessPurgeAndSuspend(); |
| 215 | 209 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 | 336 |
| 343 private: | 337 private: |
| 344 struct Options options_; | 338 struct Options options_; |
| 345 | 339 |
| 346 DISALLOW_COPY_AND_ASSIGN(Builder); | 340 DISALLOW_COPY_AND_ASSIGN(Builder); |
| 347 }; | 341 }; |
| 348 | 342 |
| 349 } // namespace content | 343 } // namespace content |
| 350 | 344 |
| 351 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 345 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
| OLD | NEW |