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

Side by Side Diff: content/child/child_thread.cc

Issue 148243013: Add shared bitmap managers for browser and renderer processes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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
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/child/child_thread.h" 5 #include "content/child/child_thread.h"
6 6
7 #include <signal.h> 7 #include <signal.h>
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/allocator/allocator_extension.h" 11 #include "base/allocator/allocator_extension.h"
12 #include "base/base_switches.h" 12 #include "base/base_switches.h"
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/command_line.h" 14 #include "base/command_line.h"
15 #include "base/debug/leak_annotations.h" 15 #include "base/debug/leak_annotations.h"
16 #include "base/lazy_instance.h" 16 #include "base/lazy_instance.h"
17 #include "base/logging.h" 17 #include "base/logging.h"
18 #include "base/message_loop/message_loop.h" 18 #include "base/message_loop/message_loop.h"
19 #include "base/process/kill.h" 19 #include "base/process/kill.h"
20 #include "base/process/process_handle.h" 20 #include "base/process/process_handle.h"
21 #include "base/strings/string_util.h" 21 #include "base/strings/string_util.h"
22 #include "base/synchronization/condition_variable.h" 22 #include "base/synchronization/condition_variable.h"
23 #include "base/synchronization/lock.h" 23 #include "base/synchronization/lock.h"
24 #include "base/threading/thread_local.h" 24 #include "base/threading/thread_local.h"
25 #include "base/tracked_objects.h" 25 #include "base/tracked_objects.h"
26 #include "components/tracing/child_trace_message_filter.h" 26 #include "components/tracing/child_trace_message_filter.h"
27 #include "content/child/child_histogram_message_filter.h" 27 #include "content/child/child_histogram_message_filter.h"
28 #include "content/child/child_process.h" 28 #include "content/child/child_process.h"
29 #include "content/child/child_resource_message_filter.h" 29 #include "content/child/child_resource_message_filter.h"
30 #include "content/child/child_shared_bitmap_manager.h"
30 #include "content/child/fileapi/file_system_dispatcher.h" 31 #include "content/child/fileapi/file_system_dispatcher.h"
31 #include "content/child/power_monitor_broadcast_source.h" 32 #include "content/child/power_monitor_broadcast_source.h"
32 #include "content/child/quota_dispatcher.h" 33 #include "content/child/quota_dispatcher.h"
33 #include "content/child/quota_message_filter.h" 34 #include "content/child/quota_message_filter.h"
34 #include "content/child/resource_dispatcher.h" 35 #include "content/child/resource_dispatcher.h"
35 #include "content/child/service_worker/service_worker_dispatcher.h" 36 #include "content/child/service_worker/service_worker_dispatcher.h"
36 #include "content/child/service_worker/service_worker_message_filter.h" 37 #include "content/child/service_worker/service_worker_message_filter.h"
37 #include "content/child/socket_stream_dispatcher.h" 38 #include "content/child/socket_stream_dispatcher.h"
38 #include "content/child/thread_safe_sender.h" 39 #include "content/child/thread_safe_sender.h"
39 #include "content/child/websocket_dispatcher.h" 40 #include "content/child/websocket_dispatcher.h"
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 g_lazy_child_thread_cv.Get().Signal(); 292 g_lazy_child_thread_cv.Get().Signal();
292 #endif 293 #endif
293 294
294 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) 295 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED)
295 trace_memory_controller_.reset(new base::debug::TraceMemoryController( 296 trace_memory_controller_.reset(new base::debug::TraceMemoryController(
296 message_loop_->message_loop_proxy(), 297 message_loop_->message_loop_proxy(),
297 ::HeapProfilerWithPseudoStackStart, 298 ::HeapProfilerWithPseudoStackStart,
298 ::HeapProfilerStop, 299 ::HeapProfilerStop,
299 ::GetHeapProfile)); 300 ::GetHeapProfile));
300 #endif 301 #endif
302
303 shared_bitmap_manager_.reset(
304 new ChildSharedBitmapManager(thread_safe_sender()));
301 } 305 }
302 306
303 ChildThread::~ChildThread() { 307 ChildThread::~ChildThread() {
304 #ifdef IPC_MESSAGE_LOG_ENABLED 308 #ifdef IPC_MESSAGE_LOG_ENABLED
305 IPC::Logging::GetInstance()->SetIPCSender(NULL); 309 IPC::Logging::GetInstance()->SetIPCSender(NULL);
306 #endif 310 #endif
307 311
308 channel_->RemoveFilter(histogram_message_filter_.get()); 312 channel_->RemoveFilter(histogram_message_filter_.get());
309 channel_->RemoveFilter(sync_message_filter_.get()); 313 channel_->RemoveFilter(sync_message_filter_.get());
310 314
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 // inflight that would addref it. 533 // inflight that would addref it.
530 Send(new ChildProcessHostMsg_ShutdownRequest); 534 Send(new ChildProcessHostMsg_ShutdownRequest);
531 } 535 }
532 536
533 void ChildThread::EnsureConnected() { 537 void ChildThread::EnsureConnected() {
534 VLOG(0) << "ChildThread::EnsureConnected()"; 538 VLOG(0) << "ChildThread::EnsureConnected()";
535 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); 539 base::KillProcess(base::GetCurrentProcessHandle(), 0, false);
536 } 540 }
537 541
538 } // namespace content 542 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698