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

Unified 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: Cleanup nits. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/blob/blob_url_request_job_factory.h ('k') | webkit/blob/webkit_blob.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/blob/blob_url_request_job_factory.cc
diff --git a/webkit/blob/blob_url_request_job_factory.cc b/webkit/blob/blob_url_request_job_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..539570e9f582e65ba1876e45523be69747acf869
--- /dev/null
+++ b/webkit/blob/blob_url_request_job_factory.cc
@@ -0,0 +1,43 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "webkit/blob/blob_url_request_job_factory.h"
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/message_loop_proxy.h"
+#include "net/url_request/url_request.h"
+#include "net/url_request/url_request_job_factory.h"
+#include "webkit/blob/blob_storage_controller.h"
+#include "webkit/blob/blob_url_request_job.h"
+
+namespace webkit_blob {
+
+BlobProtocolHandler::BlobProtocolHandler(
+ webkit_blob::BlobStorageController* blob_storage_controller,
+ base::MessageLoopProxy* loop_proxy)
+ : blob_storage_controller_(blob_storage_controller),
+ file_loop_proxy_(loop_proxy) {
+ DCHECK(blob_storage_controller);
+ DCHECK(file_loop_proxy_);
+}
+
+BlobProtocolHandler::~BlobProtocolHandler() {}
+
+net::URLRequestJob* BlobProtocolHandler::MaybeCreateJob(
+ net::URLRequest* request) const {
+ scoped_refptr<webkit_blob::BlobData> data = LookupBlobData(request);
+ if (!data) {
+ // This request is not coming through resource dispatcher host.
+ data = blob_storage_controller_->GetBlobDataFromUrl(request->url());
+ }
+ return new webkit_blob::BlobURLRequestJob(request, data, file_loop_proxy_);
+}
+
+scoped_refptr<webkit_blob::BlobData>
+BlobProtocolHandler::LookupBlobData(net::URLRequest* request) const {
+ return NULL;
+}
+
+} // namespace webkit_blob
« no previous file with comments | « webkit/blob/blob_url_request_job_factory.h ('k') | webkit/blob/webkit_blob.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698