| 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 "chrome/browser/chromeos/drive/drive_protocol_handler.h" | 5 #include "chrome/browser/chromeos/drive/drive_protocol_handler.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/threading/sequenced_worker_pool.h" | |
| 9 #include "chrome/browser/chromeos/drive/drive_url_request_job.h" | 8 #include "chrome/browser/chromeos/drive/drive_url_request_job.h" |
| 10 #include "chrome/browser/chromeos/drive/file_system_util.h" | |
| 11 #include "content/public/browser/browser_thread.h" | |
| 12 #include "net/url_request/url_request.h" | 9 #include "net/url_request/url_request.h" |
| 13 #include "url/gurl.h" | 10 #include "url/gurl.h" |
| 14 | 11 |
| 15 using content::BrowserThread; | |
| 16 | |
| 17 namespace drive { | 12 namespace drive { |
| 18 | 13 |
| 19 DriveProtocolHandler::DriveProtocolHandler(void* profile_id) | 14 DriveProtocolHandler::DriveProtocolHandler(void* profile_id) |
| 20 : profile_id_(profile_id) { | 15 : profile_id_(profile_id) { |
| 21 scoped_refptr<base::SequencedWorkerPool> blocking_pool = | |
| 22 BrowserThread::GetBlockingPool(); | |
| 23 blocking_task_runner_ = | |
| 24 blocking_pool->GetSequencedTaskRunner(blocking_pool->GetSequenceToken()); | |
| 25 } | 16 } |
| 26 | 17 |
| 27 DriveProtocolHandler::~DriveProtocolHandler() { | 18 DriveProtocolHandler::~DriveProtocolHandler() { |
| 28 } | 19 } |
| 29 | 20 |
| 30 net::URLRequestJob* DriveProtocolHandler::MaybeCreateJob( | 21 net::URLRequestJob* DriveProtocolHandler::MaybeCreateJob( |
| 31 net::URLRequest* request, net::NetworkDelegate* network_delegate) const { | 22 net::URLRequest* request, net::NetworkDelegate* network_delegate) const { |
| 32 DVLOG(1) << "Handling url: " << request->url().spec(); | 23 DVLOG(1) << "Handling url: " << request->url().spec(); |
| 33 return new DriveURLRequestJob( | 24 return new DriveURLRequestJob( |
| 34 base::Bind(&util::GetFileSystemByProfileId, profile_id_), | 25 profile_id_, |
| 35 blocking_task_runner_.get(), | |
| 36 request, | 26 request, |
| 37 network_delegate); | 27 network_delegate); |
| 38 } | 28 } |
| 39 | 29 |
| 40 } // namespace drive | 30 } // namespace drive |
| OLD | NEW |