OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 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. |
| 4 |
| 5 #include "chrome/browser/net/blob_url_request_job_factory.h" |
| 6 |
| 7 #include "chrome/browser/chrome_blob_storage_context.h" |
| 8 #include "chrome/browser/chrome_thread.h" |
| 9 #include "chrome/browser/net/chrome_url_request_context.h" |
| 10 #include "chrome/common/url_constants.h" |
| 11 #include "webkit/blob/blob_storage_controller.h" |
| 12 #include "webkit/blob/blob_url_request_job.h" |
| 13 |
| 14 namespace { |
| 15 |
| 16 URLRequestJob* BlobURLRequestJobFactory(URLRequest* request, |
| 17 const std::string& scheme) { |
| 18 webkit_blob::BlobStorageController* blob_storage_controller = |
| 19 static_cast<ChromeURLRequestContext*>(request->context())-> |
| 20 blob_storage_context()->controller(); |
| 21 return new webkit_blob::BlobURLRequestJob( |
| 22 request, |
| 23 blob_storage_controller->GetBlobDataFromUrl(request->url()), |
| 24 ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE)); |
| 25 } |
| 26 |
| 27 } |
| 28 |
| 29 void RegisterBlobURLRequestJobFactory() { |
| 30 URLRequest::RegisterProtocolFactory(chrome::kBlobScheme, |
| 31 &BlobURLRequestJobFactory); |
| 32 } |
OLD | NEW |