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 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1497 | 1497 |
1498 // RDH needs the IO thread to be created | 1498 // RDH needs the IO thread to be created |
1499 { | 1499 { |
1500 TRACE_EVENT0("startup", | 1500 TRACE_EVENT0("startup", |
1501 "BrowserMainLoop::BrowserThreadsStarted:InitResourceDispatcherHost"); | 1501 "BrowserMainLoop::BrowserThreadsStarted:InitResourceDispatcherHost"); |
1502 // TODO(ananta) | 1502 // TODO(ananta) |
1503 // We register an interceptor on the ResourceDispatcherHostImpl instance to | 1503 // We register an interceptor on the ResourceDispatcherHostImpl instance to |
1504 // intercept requests to create handlers for download requests. We need to | 1504 // intercept requests to create handlers for download requests. We need to |
1505 // find a better way to achieve this. Ideally we don't want knowledge of | 1505 // find a better way to achieve this. Ideally we don't want knowledge of |
1506 // downloads in ResourceDispatcherHostImpl. | 1506 // downloads in ResourceDispatcherHostImpl. |
| 1507 // We pass the task runners for the UI and IO threads as a stopgap approach |
| 1508 // for now. Eventually variants of these runners would be available in the |
| 1509 // network service. |
1507 resource_dispatcher_host_.reset(new ResourceDispatcherHostImpl( | 1510 resource_dispatcher_host_.reset(new ResourceDispatcherHostImpl( |
1508 base::Bind(&DownloadResourceHandler::Create))); | 1511 base::Bind(&DownloadResourceHandler::Create), |
| 1512 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO))); |
1509 GetContentClient()->browser()->ResourceDispatcherHostCreated(); | 1513 GetContentClient()->browser()->ResourceDispatcherHostCreated(); |
1510 | 1514 |
1511 loader_delegate_.reset(new LoaderDelegateImpl()); | 1515 loader_delegate_.reset(new LoaderDelegateImpl()); |
1512 resource_dispatcher_host_->SetLoaderDelegate(loader_delegate_.get()); | 1516 resource_dispatcher_host_->SetLoaderDelegate(loader_delegate_.get()); |
1513 } | 1517 } |
1514 | 1518 |
1515 // MediaStreamManager needs the IO thread to be created. | 1519 // MediaStreamManager needs the IO thread to be created. |
1516 { | 1520 { |
1517 TRACE_EVENT0("startup", | 1521 TRACE_EVENT0("startup", |
1518 "BrowserMainLoop::BrowserThreadsStarted:InitMediaStreamManager"); | 1522 "BrowserMainLoop::BrowserThreadsStarted:InitMediaStreamManager"); |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1773 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), | 1777 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
1774 MediaInternals::GetInstance()); | 1778 MediaInternals::GetInstance()); |
1775 } | 1779 } |
1776 CHECK(audio_manager_); | 1780 CHECK(audio_manager_); |
1777 | 1781 |
1778 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); | 1782 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); |
1779 CHECK(audio_system_); | 1783 CHECK(audio_system_); |
1780 } | 1784 } |
1781 | 1785 |
1782 } // namespace content | 1786 } // namespace content |
OLD | NEW |