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/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/hi_res_timer_manager.h" | 10 #include "base/hi_res_timer_manager.h" |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 #endif | 391 #endif |
392 | 392 |
393 #if defined(OS_WIN) | 393 #if defined(OS_WIN) |
394 system_message_window_.reset(new SystemMessageWindowWin); | 394 system_message_window_.reset(new SystemMessageWindowWin); |
395 #endif | 395 #endif |
396 | 396 |
397 if (parts_.get()) | 397 if (parts_.get()) |
398 parts_->PostMainMessageLoopStart(); | 398 parts_->PostMainMessageLoopStart(); |
399 | 399 |
400 #if defined(OS_ANDROID) | 400 #if defined(OS_ANDROID) |
401 SurfaceTexturePeer::InitInstance(new SurfaceTexturePeerBrowserImpl( | 401 SurfaceTexturePeer::InitInstance(new SurfaceTexturePeerBrowserImpl()); |
402 parameters_.command_line.HasSwitch( | |
403 switches::kMediaPlayerInRenderProcess))); | |
404 DataFetcherImplAndroid::Init(base::android::AttachCurrentThread()); | 402 DataFetcherImplAndroid::Init(base::android::AttachCurrentThread()); |
405 #endif | 403 #endif |
406 | 404 |
407 if (parsed_command_line_.HasSwitch(switches::kMemoryMetrics)) { | 405 if (parsed_command_line_.HasSwitch(switches::kMemoryMetrics)) { |
408 memory_observer_.reset(new MemoryObserver()); | 406 memory_observer_.reset(new MemoryObserver()); |
409 MessageLoop::current()->AddTaskObserver(memory_observer_.get()); | 407 MessageLoop::current()->AddTaskObserver(memory_observer_.get()); |
410 } | 408 } |
411 } | 409 } |
412 | 410 |
413 void BrowserMainLoop::CreateThreads() { | 411 void BrowserMainLoop::CreateThreads() { |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 808 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
811 if (parameters_.ui_task) | 809 if (parameters_.ui_task) |
812 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 810 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
813 | 811 |
814 base::RunLoop run_loop; | 812 base::RunLoop run_loop; |
815 run_loop.Run(); | 813 run_loop.Run(); |
816 #endif | 814 #endif |
817 } | 815 } |
818 | 816 |
819 } // namespace content | 817 } // namespace content |
OLD | NEW |