1 // Copyright (c) 2012 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.
5 #ifndef WEBKIT_BROWSER_BLOB_VIEW_BLOB_INTERNALS_JOB_H_
6 #define WEBKIT_BROWSER_BLOB_VIEW_BLOB_INTERNALS_JOB_H_
10 #include "base/memory/weak_ptr.h"
11 #include "net/url_request/url_request_simple_job.h"
12 #include "webkit/browser/webkit_storage_browser_export.h"
18 namespace webkit_blob {
21 class BlobStorageContext;
23 // A job subclass that implements a protocol to inspect the internal
24 // state of blob registry.
25 class WEBKIT_STORAGE_BROWSER_EXPORT ViewBlobInternalsJob
26 : public net::URLRequestSimpleJob {
28 ViewBlobInternalsJob(net::URLRequest* request,
29 net::NetworkDelegate* network_delegate,
30 BlobStorageContext* blob_storage_context);
32 virtual void Start() OVERRIDE;
33 virtual int GetData(std::string* mime_type,
36 const net::CompletionCallback& callback) const OVERRIDE;
37 virtual bool IsRedirectResponse(GURL* location,
38 int* http_status_code) OVERRIDE;
39 virtual void Kill() OVERRIDE;
42 virtual ~ViewBlobInternalsJob();
44 void GenerateHTML(std::string* out) const;
45 static void GenerateHTMLForBlobData(const BlobData& blob_data,
49 BlobStorageContext* blob_storage_context_;
50 base::WeakPtrFactory<ViewBlobInternalsJob> weak_factory_;
52 DISALLOW_COPY_AND_ASSIGN(ViewBlobInternalsJob);
55 } // namespace webkit_blob
57 #endif // WEBKIT_BROWSER_BLOB_VIEW_BLOB_INTERNALS_JOB_H_