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

Unified Diff: webkit/blob/blob_url_request_job_factory.h

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 side-by-side diff with in-line comments
Download patch
Index: webkit/blob/blob_url_request_job_factory.h
diff --git a/webkit/blob/blob_url_request_job_factory.h b/webkit/blob/blob_url_request_job_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..ad513f5eae61ce13f59864b1f4f98a053cbc54e3
--- /dev/null
+++ b/webkit/blob/blob_url_request_job_factory.h
@@ -0,0 +1,51 @@
+// 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.
+
+#ifndef WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_FACTORY_H_
+#define WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_FACTORY_H_
+
+#include "base/compiler_specific.h"
+#include "base/memory/ref_counted.h"
+#include "net/url_request/url_request_job_factory.h"
+
+namespace base {
+class MessageLoopProxy;
+} // namespace base
+
+namespace net {
+class URLRequest;
+} // namespace net
+
+namespace webkit_blob {
+
+class BlobData;
+class BlobStorageController;
+
+class BlobProtocolHandler
+ : public net::URLRequestJobFactory::ProtocolHandler {
+ public:
+ // |controller|'s lifetime should exceed the lifetime of the ProtocolHandler.
+ explicit BlobProtocolHandler(
+ BlobStorageController* blob_storage_controller,
+ base::MessageLoopProxy* loop_proxy);
michaeln 2011/05/18 01:13:11 can u name this such that it indicates that it's t
willchan no longer on Chromium 2011/05/18 16:17:01 Done.
+ virtual ~BlobProtocolHandler();
+
+ virtual net::URLRequestJob* MaybeCreateJob(
+ net::URLRequest* request) const OVERRIDE;
+
+ private:
+ virtual scoped_refptr<BlobData> LookupBlobData(
+ net::URLRequest* request) const;
+
+ // No scoped_refptr because |blob_storage_controller_| is owned by the
+ // ProfileIOData, which also owns this ProtocolHandler.
+ BlobStorageController* const blob_storage_controller_;
+ const scoped_refptr<base::MessageLoopProxy> loop_proxy_;
+
+ DISALLOW_COPY_AND_ASSIGN(BlobProtocolHandler);
+};
+
+} // namespace webkit_blob
+
+#endif // WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698