Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(722)

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 2785523002: Reduce/remove usage of BrowserThread in content/browser/loader. (Closed)
Patch Set: Fix unittests redness Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 1480
1481 // RDH needs the IO thread to be created 1481 // RDH needs the IO thread to be created
1482 { 1482 {
1483 TRACE_EVENT0("startup", 1483 TRACE_EVENT0("startup",
1484 "BrowserMainLoop::BrowserThreadsStarted:InitResourceDispatcherHost"); 1484 "BrowserMainLoop::BrowserThreadsStarted:InitResourceDispatcherHost");
1485 // TODO(ananta) 1485 // TODO(ananta)
1486 // We register an interceptor on the ResourceDispatcherHostImpl instance to 1486 // We register an interceptor on the ResourceDispatcherHostImpl instance to
1487 // intercept requests to create handlers for download requests. We need to 1487 // intercept requests to create handlers for download requests. We need to
1488 // find a better way to achieve this. Ideally we don't want knowledge of 1488 // find a better way to achieve this. Ideally we don't want knowledge of
1489 // downloads in ResourceDispatcherHostImpl. 1489 // downloads in ResourceDispatcherHostImpl.
1490 // We pass the task runners for the UI and IO threads as a stopgap approach
1491 // for now. Eventually variants of these runners would be available in the
1492 // network service.
1490 resource_dispatcher_host_.reset(new ResourceDispatcherHostImpl( 1493 resource_dispatcher_host_.reset(new ResourceDispatcherHostImpl(
1491 base::Bind(&DownloadResourceHandler::Create))); 1494 base::Bind(&DownloadResourceHandler::Create),
1495 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI),
1496 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)));
1492 GetContentClient()->browser()->ResourceDispatcherHostCreated(); 1497 GetContentClient()->browser()->ResourceDispatcherHostCreated();
1493 1498
1494 loader_delegate_.reset(new LoaderDelegateImpl()); 1499 loader_delegate_.reset(new LoaderDelegateImpl());
1495 resource_dispatcher_host_->SetLoaderDelegate(loader_delegate_.get()); 1500 resource_dispatcher_host_->SetLoaderDelegate(loader_delegate_.get());
1496 } 1501 }
1497 1502
1498 // MediaStreamManager needs the IO thread to be created. 1503 // MediaStreamManager needs the IO thread to be created.
1499 { 1504 {
1500 TRACE_EVENT0("startup", 1505 TRACE_EVENT0("startup",
1501 "BrowserMainLoop::BrowserThreadsStarted:InitMediaStreamManager"); 1506 "BrowserMainLoop::BrowserThreadsStarted:InitMediaStreamManager");
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1755 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), 1760 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE),
1756 MediaInternals::GetInstance()); 1761 MediaInternals::GetInstance());
1757 } 1762 }
1758 CHECK(audio_manager_); 1763 CHECK(audio_manager_);
1759 1764
1760 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); 1765 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get());
1761 CHECK(audio_system_); 1766 CHECK(audio_system_);
1762 } 1767 }
1763 1768
1764 } // namespace content 1769 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698