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

Side by Side Diff: webkit/blob/blob_url_request_job_factory.cc

Issue 7036004: Remove more URLRequest::RegisterProtocolFactory calls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops Created 9 years, 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 "webkit/blob/blob_url_request_job_factory.h"
6
7 #include "base/basictypes.h"
8 #include "base/compiler_specific.h"
9 #include "base/message_loop_proxy.h"
10 #include "net/url_request/url_request.h"
11 #include "net/url_request/url_request_job_factory.h"
12 #include "webkit/blob/blob_storage_controller.h"
13 #include "webkit/blob/blob_url_request_job.h"
14
15 namespace webkit_blob {
16
17 BlobProtocolHandler::BlobProtocolHandler(
18 webkit_blob::BlobStorageController* blob_storage_controller,
19 base::MessageLoopProxy* loop_proxy)
20 : blob_storage_controller_(blob_storage_controller),
21 loop_proxy_(loop_proxy) {
22 DCHECK(blob_storage_controller);
23 DCHECK(loop_proxy_);
24 }
25
26 BlobProtocolHandler::~BlobProtocolHandler() {}
27
28 net::URLRequestJob* BlobProtocolHandler::MaybeCreateJob(
29 net::URLRequest* request) const {
30 scoped_refptr<webkit_blob::BlobData> data = LookupBlobData(request);
31 if (!data) {
32 // This request is not coming through resource dispatcher host.
33 data = blob_storage_controller_->GetBlobDataFromUrl(request->url());
34 }
35 return new webkit_blob::BlobURLRequestJob(request, data, loop_proxy_);
36 }
37
38 scoped_refptr<webkit_blob::BlobData>
39 BlobProtocolHandler::LookupBlobData(net::URLRequest* request) const {
40 return NULL;
41 }
42
43 } // namespace webkit_blob
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698