| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/in_process_renderer_thread.h" | 5 #include "content/renderer/in_process_renderer_thread.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "content/renderer/render_process.h" | 8 #include "content/renderer/render_process.h" |
| 9 #include "content/renderer/render_process_impl.h" | 9 #include "content/renderer/render_process_impl.h" |
| 10 #include "content/renderer/render_thread_impl.h" | 10 #include "content/renderer/render_thread_impl.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // Call AttachCurrentThreadWithName, before any other AttachCurrentThread() | 39 // Call AttachCurrentThreadWithName, before any other AttachCurrentThread() |
| 40 // calls. The latter causes Java VM to assign Thread-??? to the thread name. | 40 // calls. The latter causes Java VM to assign Thread-??? to the thread name. |
| 41 // Please note calls to AttachCurrentThreadWithName after AttachCurrentThread | 41 // Please note calls to AttachCurrentThreadWithName after AttachCurrentThread |
| 42 // will not change the thread name kept in Java VM. | 42 // will not change the thread name kept in Java VM. |
| 43 #if defined(OS_ANDROID) | 43 #if defined(OS_ANDROID) |
| 44 base::android::AttachCurrentThreadWithName(thread_name()); | 44 base::android::AttachCurrentThreadWithName(thread_name()); |
| 45 // Make sure we aren't somehow reinitialising the inprocess renderer thread on | 45 // Make sure we aren't somehow reinitialising the inprocess renderer thread on |
| 46 // Android. Temporary CHECK() to debug http://crbug.com/514141 | 46 // Android. Temporary CHECK() to debug http://crbug.com/514141 |
| 47 CHECK(!render_process_); | 47 CHECK(!render_process_); |
| 48 #endif | 48 #endif |
| 49 render_process_.reset(new RenderProcessImpl()); | 49 render_process_ = RenderProcessImpl::Create(); |
| 50 RenderThreadImpl::Create(params_); | 50 RenderThreadImpl::Create(params_); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void InProcessRendererThread::CleanUp() { | 53 void InProcessRendererThread::CleanUp() { |
| 54 #if defined(OS_ANDROID) | 54 #if defined(OS_ANDROID) |
| 55 // Don't allow the render thread to be shut down in single process mode on | 55 // Don't allow the render thread to be shut down in single process mode on |
| 56 // Android unless the browser is shutting down. | 56 // Android unless the browser is shutting down. |
| 57 // Temporary CHECK() to debug http://crbug.com/514141 | 57 // Temporary CHECK() to debug http://crbug.com/514141 |
| 58 CHECK(g_browser_main_loop_shutting_down); | 58 CHECK(g_browser_main_loop_shutting_down); |
| 59 #endif | 59 #endif |
| (...skipping 11 matching lines...) Expand all Loading... |
| 71 // this flag to true in Cleanup works around these problems. | 71 // this flag to true in Cleanup works around these problems. |
| 72 SetThreadWasQuitProperly(true); | 72 SetThreadWasQuitProperly(true); |
| 73 } | 73 } |
| 74 | 74 |
| 75 base::Thread* CreateInProcessRendererThread( | 75 base::Thread* CreateInProcessRendererThread( |
| 76 const InProcessChildThreadParams& params) { | 76 const InProcessChildThreadParams& params) { |
| 77 return new InProcessRendererThread(params); | 77 return new InProcessRendererThread(params); |
| 78 } | 78 } |
| 79 | 79 |
| 80 } // namespace content | 80 } // namespace content |
| OLD | NEW |