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

Side by Side Diff: content/app/android/child_process_service.cc

Issue 17351006: MemoryPressure: sends the signal to the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No IPC Created 7 years, 5 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 #include "content/app/android/child_process_service.h" 5 #include "content/app/android/child_process_service.h"
6 6
7 #include <android/native_window_jni.h> 7 #include <android/native_window_jni.h>
8 #include <cpu-features.h> 8 #include <cpu-features.h>
9 9
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
11 #include "base/android/memory_pressure_listener_android.h"
11 #include "base/logging.h" 12 #include "base/logging.h"
12 #include "base/posix/global_descriptors.h" 13 #include "base/posix/global_descriptors.h"
13 #include "content/child/child_process.h" 14 #include "content/child/child_process.h"
14 #include "content/child/child_thread.h" 15 #include "content/child/child_thread.h"
15 #include "content/common/android/surface_texture_peer.h" 16 #include "content/common/android/surface_texture_peer.h"
16 #include "content/common/gpu/gpu_surface_lookup.h" 17 #include "content/common/gpu/gpu_surface_lookup.h"
17 #include "content/public/app/android_library_loader_hooks.h" 18 #include "content/public/app/android_library_loader_hooks.h"
18 #include "content/public/common/content_descriptors.h" 19 #include "content/public/common/content_descriptors.h"
19 #include "ipc/ipc_descriptors.h" 20 #include "ipc/ipc_descriptors.h"
20 #include "jni/ChildProcessService_jni.h" 21 #include "jni/ChildProcessService_jni.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // Register the file descriptors. 96 // Register the file descriptors.
96 // This includes the IPC channel, the crash dump signals and resource related 97 // This includes the IPC channel, the crash dump signals and resource related
97 // files. 98 // files.
98 DCHECK(file_fds.size() == file_ids.size()); 99 DCHECK(file_fds.size() == file_ids.size());
99 for (size_t i = 0; i < file_ids.size(); ++i) 100 for (size_t i = 0; i < file_ids.size(); ++i)
100 base::GlobalDescriptors::GetInstance()->Set(file_ids[i], file_fds[i]); 101 base::GlobalDescriptors::GetInstance()->Set(file_ids[i], file_fds[i]);
101 102
102 content::SurfaceTexturePeer::InitInstance( 103 content::SurfaceTexturePeer::InitInstance(
103 new SurfaceTexturePeerChildImpl(service)); 104 new SurfaceTexturePeerChildImpl(service));
104 105
106 base::android::MemoryPressureListenerAndroid::RegisterSystemCallback(env);
105 } 107 }
106 108
107 void QuitMainThreadMessageLoop() { 109 void QuitMainThreadMessageLoop() {
108 base::MessageLoop::current()->Quit(); 110 base::MessageLoop::current()->Quit();
109 } 111 }
110 112
111 } // namespace <anonymous> 113 } // namespace <anonymous>
112 114
113 void InitChildProcess(JNIEnv* env, 115 void InitChildProcess(JNIEnv* env,
114 jclass clazz, 116 jclass clazz,
(...skipping 27 matching lines...) Expand all
142 ChildProcess* current_process = ChildProcess::current(); 144 ChildProcess* current_process = ChildProcess::current();
143 if (!current_process) 145 if (!current_process)
144 return; 146 return;
145 ChildThread* main_child_thread = current_process->main_thread(); 147 ChildThread* main_child_thread = current_process->main_thread();
146 if (main_child_thread && main_child_thread->message_loop()) 148 if (main_child_thread && main_child_thread->message_loop())
147 main_child_thread->message_loop()->PostTask(FROM_HERE, 149 main_child_thread->message_loop()->PostTask(FROM_HERE,
148 base::Bind(&QuitMainThreadMessageLoop)); 150 base::Bind(&QuitMainThreadMessageLoop));
149 } 151 }
150 152
151 } // namespace content 153 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698