| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 } else { | 924 } else { |
| 925 NOTREACHED(); | 925 NOTREACHED(); |
| 926 } | 926 } |
| 927 | 927 |
| 928 TRACE_EVENT_END0("startup", "BrowserMainLoop::CreateThreads:start"); | 928 TRACE_EVENT_END0("startup", "BrowserMainLoop::CreateThreads:start"); |
| 929 } | 929 } |
| 930 created_threads_ = true; | 930 created_threads_ = true; |
| 931 return result_code_; | 931 return result_code_; |
| 932 } | 932 } |
| 933 | 933 |
| 934 static void LogDog() { |
| 935 LOG(ERROR) << "boliu LogDog"; |
| 936 base::MessageLoop::current()->PostDelayedTask( |
| 937 FROM_HERE, base::Bind(&LogDog), base::TimeDelta::FromMilliseconds(100)); |
| 938 } |
| 939 |
| 934 int BrowserMainLoop::PreMainMessageLoopRun() { | 940 int BrowserMainLoop::PreMainMessageLoopRun() { |
| 935 if (parts_) { | 941 if (parts_) { |
| 936 TRACE_EVENT0("startup", | 942 TRACE_EVENT0("startup", |
| 937 "BrowserMainLoop::CreateThreads:PreMainMessageLoopRun"); | 943 "BrowserMainLoop::CreateThreads:PreMainMessageLoopRun"); |
| 938 | 944 |
| 939 parts_->PreMainMessageLoopRun(); | 945 parts_->PreMainMessageLoopRun(); |
| 940 } | 946 } |
| 941 | 947 |
| 948 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind(&LogDog)); |
| 949 |
| 942 // If the UI thread blocks, the whole UI is unresponsive. | 950 // If the UI thread blocks, the whole UI is unresponsive. |
| 943 // Do not allow disk IO from the UI thread. | 951 // Do not allow disk IO from the UI thread. |
| 944 base::ThreadRestrictions::SetIOAllowed(false); | 952 base::ThreadRestrictions::SetIOAllowed(false); |
| 945 base::ThreadRestrictions::DisallowWaiting(); | 953 base::ThreadRestrictions::DisallowWaiting(); |
| 946 return result_code_; | 954 return result_code_; |
| 947 } | 955 } |
| 948 | 956 |
| 949 void BrowserMainLoop::RunMainMessageLoopParts() { | 957 void BrowserMainLoop::RunMainMessageLoopParts() { |
| 950 // Don't use the TRACE_EVENT0 macro because the tracing infrastructure doesn't | 958 // Don't use the TRACE_EVENT0 macro because the tracing infrastructure doesn't |
| 951 // expect synchronous events around the main loop of a thread. | 959 // expect synchronous events around the main loop of a thread. |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1537 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = | 1545 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = |
| 1538 audio_thread_->task_runner(); | 1546 audio_thread_->task_runner(); |
| 1539 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), | 1547 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), |
| 1540 std::move(worker_task_runner), | 1548 std::move(worker_task_runner), |
| 1541 MediaInternals::GetInstance()); | 1549 MediaInternals::GetInstance()); |
| 1542 } | 1550 } |
| 1543 CHECK(audio_manager_); | 1551 CHECK(audio_manager_); |
| 1544 } | 1552 } |
| 1545 | 1553 |
| 1546 } // namespace content | 1554 } // namespace content |
| OLD | NEW |