| 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 #include "content/child/child_thread.h" | 5 #include "content/child/child_thread.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/allocator/allocator_extension.h" | 9 #include "base/allocator/allocator_extension.h" |
| 10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "content/child/service_worker/service_worker_message_filter.h" | 32 #include "content/child/service_worker/service_worker_message_filter.h" |
| 33 #include "content/child/socket_stream_dispatcher.h" | 33 #include "content/child/socket_stream_dispatcher.h" |
| 34 #include "content/child/thread_safe_sender.h" | 34 #include "content/child/thread_safe_sender.h" |
| 35 #include "content/child/websocket_dispatcher.h" | 35 #include "content/child/websocket_dispatcher.h" |
| 36 #include "content/common/child_process_messages.h" | 36 #include "content/common/child_process_messages.h" |
| 37 #include "content/public/common/content_switches.h" | 37 #include "content/public/common/content_switches.h" |
| 38 #include "ipc/ipc_logging.h" | 38 #include "ipc/ipc_logging.h" |
| 39 #include "ipc/ipc_switches.h" | 39 #include "ipc/ipc_switches.h" |
| 40 #include "ipc/ipc_sync_channel.h" | 40 #include "ipc/ipc_sync_channel.h" |
| 41 #include "ipc/ipc_sync_message_filter.h" | 41 #include "ipc/ipc_sync_message_filter.h" |
| 42 #include "v8/include/v8.h" |
| 42 | 43 |
| 43 #if defined(OS_WIN) | 44 #if defined(OS_WIN) |
| 44 #include "content/common/handle_enumerator_win.h" | 45 #include "content/common/handle_enumerator_win.h" |
| 45 #endif | 46 #endif |
| 46 | 47 |
| 47 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) | 48 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) |
| 48 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" | 49 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" |
| 49 #endif | 50 #endif |
| 50 | 51 |
| 51 using tracked_objects::ThreadData; | 52 using tracked_objects::ThreadData; |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 g_lazy_tls.Pointer()->Set(NULL); | 273 g_lazy_tls.Pointer()->Set(NULL); |
| 273 } | 274 } |
| 274 | 275 |
| 275 void ChildThread::Shutdown() { | 276 void ChildThread::Shutdown() { |
| 276 // Delete objects that hold references to blink so derived classes can | 277 // Delete objects that hold references to blink so derived classes can |
| 277 // safely shutdown blink in their Shutdown implementation. | 278 // safely shutdown blink in their Shutdown implementation. |
| 278 file_system_dispatcher_.reset(); | 279 file_system_dispatcher_.reset(); |
| 279 quota_dispatcher_.reset(); | 280 quota_dispatcher_.reset(); |
| 280 } | 281 } |
| 281 | 282 |
| 283 void ChildThread::SetJavaScriptFlags(const std::string& str) { |
| 284 v8::V8::SetFlagsFromString(str.data(), static_cast<int>(str.size())); |
| 285 } |
| 286 |
| 282 void ChildThread::OnChannelConnected(int32 peer_pid) { | 287 void ChildThread::OnChannelConnected(int32 peer_pid) { |
| 283 channel_connected_factory_.InvalidateWeakPtrs(); | 288 channel_connected_factory_.InvalidateWeakPtrs(); |
| 284 } | 289 } |
| 285 | 290 |
| 286 void ChildThread::OnChannelError() { | 291 void ChildThread::OnChannelError() { |
| 287 set_on_channel_error_called(true); | 292 set_on_channel_error_called(true); |
| 288 base::MessageLoop::current()->Quit(); | 293 base::MessageLoop::current()->Quit(); |
| 289 } | 294 } |
| 290 | 295 |
| 291 bool ChildThread::Send(IPC::Message* msg) { | 296 bool ChildThread::Send(IPC::Message* msg) { |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 // inflight that would addref it. | 486 // inflight that would addref it. |
| 482 Send(new ChildProcessHostMsg_ShutdownRequest); | 487 Send(new ChildProcessHostMsg_ShutdownRequest); |
| 483 } | 488 } |
| 484 | 489 |
| 485 void ChildThread::EnsureConnected() { | 490 void ChildThread::EnsureConnected() { |
| 486 VLOG(0) << "ChildThread::EnsureConnected()"; | 491 VLOG(0) << "ChildThread::EnsureConnected()"; |
| 487 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); | 492 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); |
| 488 } | 493 } |
| 489 | 494 |
| 490 } // namespace content | 495 } // namespace content |
| OLD | NEW |