| 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/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1194 time_zone_monitor_ = TimeZoneMonitor::Create(); | 1194 time_zone_monitor_ = TimeZoneMonitor::Create(); |
| 1195 } | 1195 } |
| 1196 | 1196 |
| 1197 // Alert the clipboard class to which threads are allowed to access the | 1197 // Alert the clipboard class to which threads are allowed to access the |
| 1198 // clipboard: | 1198 // clipboard: |
| 1199 std::vector<base::PlatformThreadId> allowed_clipboard_threads; | 1199 std::vector<base::PlatformThreadId> allowed_clipboard_threads; |
| 1200 // The current thread is the UI thread. | 1200 // The current thread is the UI thread. |
| 1201 allowed_clipboard_threads.push_back(base::PlatformThread::CurrentId()); | 1201 allowed_clipboard_threads.push_back(base::PlatformThread::CurrentId()); |
| 1202 #if defined(OS_WIN) | 1202 #if defined(OS_WIN) |
| 1203 // On Windows, clipboards are also used on the FILE or IO threads. | 1203 // On Windows, clipboards are also used on the FILE or IO threads. |
| 1204 allowed_clipboard_threads.push_back(file_thread_->thread_id()); | 1204 allowed_clipboard_threads.push_back(file_thread_->GetThreadId()); |
| 1205 allowed_clipboard_threads.push_back(io_thread_->thread_id()); | 1205 allowed_clipboard_threads.push_back(io_thread_->GetThreadId()); |
| 1206 #endif | 1206 #endif |
| 1207 ui::Clipboard::SetAllowedThreads(allowed_clipboard_threads); | 1207 ui::Clipboard::SetAllowedThreads(allowed_clipboard_threads); |
| 1208 | 1208 |
| 1209 // When running the GPU thread in-process, avoid optimistically starting it | 1209 // When running the GPU thread in-process, avoid optimistically starting it |
| 1210 // since creating the GPU thread races against creation of the one-and-only | 1210 // since creating the GPU thread races against creation of the one-and-only |
| 1211 // ChildProcess instance which is created by the renderer thread. | 1211 // ChildProcess instance which is created by the renderer thread. |
| 1212 if (GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(NULL) && | 1212 if (GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(NULL) && |
| 1213 !established_gpu_channel && | 1213 !established_gpu_channel && |
| 1214 always_uses_gpu && | 1214 always_uses_gpu && |
| 1215 !UsingInProcessGpu()) { | 1215 !UsingInProcessGpu()) { |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1345 DCHECK(is_tracing_startup_); | 1345 DCHECK(is_tracing_startup_); |
| 1346 | 1346 |
| 1347 is_tracing_startup_ = false; | 1347 is_tracing_startup_ = false; |
| 1348 TracingController::GetInstance()->DisableRecording( | 1348 TracingController::GetInstance()->DisableRecording( |
| 1349 TracingController::CreateFileSink( | 1349 TracingController::CreateFileSink( |
| 1350 startup_trace_file_, | 1350 startup_trace_file_, |
| 1351 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1351 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
| 1352 } | 1352 } |
| 1353 | 1353 |
| 1354 } // namespace content | 1354 } // namespace content |
| OLD | NEW |