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
3 // found in the LICENSE file.
5 #include "chrome/browser/chromeos/drive/drive_protocol_handler.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"
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"
15 using content::BrowserThread;
19 DriveProtocolHandler::DriveProtocolHandler(void* profile_id)
20 : 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());
27 DriveProtocolHandler::~DriveProtocolHandler() {
30 net::URLRequestJob* DriveProtocolHandler::MaybeCreateJob(
31 net::URLRequest* request, net::NetworkDelegate* network_delegate) const {
32 DVLOG(1) << "Handling url: " << request->url().spec();
33 return new DriveURLRequestJob(
34 base::Bind(&util::GetFileSystemByProfileId, profile_id_),
35 blocking_task_runner_.get(),