summaryrefslogtreecommitdiffstats
path: root/webkit/blob/view_blob_internals_job.h
diff options
context:
space:
mode:
authorjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-08 18:12:09 +0000
committerjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-08 18:12:09 +0000
commitaf561035f6bd3f19318d0500e936d9259a71ffe1 (patch)
tree72977304f6459adb091047978396fcd27c698771 /webkit/blob/view_blob_internals_job.h
parent6777a5795196c21e69169695685191e2df0eb5dd (diff)
downloadchromium_src-af561035f6bd3f19318d0500e936d9259a71ffe1.zip
chromium_src-af561035f6bd3f19318d0500e936d9259a71ffe1.tar.gz
chromium_src-af561035f6bd3f19318d0500e936d9259a71ffe1.tar.bz2
Support chrome://blob-internals to inspect the blob storage.
BUG=none TEST=none Review URL: http://codereview.chromium.org/3516019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61982 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/blob/view_blob_internals_job.h')
-rw-r--r--webkit/blob/view_blob_internals_job.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/webkit/blob/view_blob_internals_job.h b/webkit/blob/view_blob_internals_job.h
new file mode 100644
index 0000000..0248153
--- /dev/null
+++ b/webkit/blob/view_blob_internals_job.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2010 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_VIEW_BLOB_INTERNALS_JOB_H_
+#define WEBKIT_BLOB_VIEW_BLOB_INTERNALS_JOB_H_
+
+#include <string>
+
+#include "net/url_request/url_request_simple_job.h"
+
+class URLRequest;
+
+namespace webkit_blob {
+
+class BlobData;
+class BlobStorageController;
+
+// A job subclass that implements a protocol to inspect the internal
+// state of blob registry.
+class ViewBlobInternalsJob : public URLRequestSimpleJob {
+ public:
+ ViewBlobInternalsJob(URLRequest* request,
+ BlobStorageController* blob_storage_controller);
+
+ virtual void Start();
+ virtual bool GetData(std::string* mime_type,
+ std::string* charset,
+ std::string* data) const;
+ virtual bool IsRedirectResponse(GURL* location, int* http_status_code);
+
+ private:
+ ~ViewBlobInternalsJob();
+
+ void DoWorkAsync();
+ void GenerateHTML(std::string* out) const;
+ static void GenerateHTMLForBlobData(const BlobData& blob_data,
+ std::string* out);
+
+ BlobStorageController* blob_storage_controller_;
+
+ DISALLOW_COPY_AND_ASSIGN(ViewBlobInternalsJob);
+};
+
+} // namespace webkit_blob
+
+#endif // WEBKIT_BLOB_VIEW_BLOB_INTERNALS_JOB_H_