ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / storage / browser / blob / view_blob_internals_job.h
blob6216dd3226904b6b0d22e802d827a702df773690
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 STORAGE_BROWSER_BLOB_VIEW_BLOB_INTERNALS_JOB_H_
6 #define STORAGE_BROWSER_BLOB_VIEW_BLOB_INTERNALS_JOB_H_
8 #include <string>
10 #include "base/memory/weak_ptr.h"
11 #include "net/url_request/url_request_simple_job.h"
12 #include "storage/browser/storage_browser_export.h"
14 namespace net {
15 class URLRequest;
16 } // namespace net
18 namespace storage {
20 class InternalBlobData;
21 class BlobStorageContext;
23 // A job subclass that implements a protocol to inspect the internal
24 // state of blob registry.
25 class STORAGE_EXPORT ViewBlobInternalsJob
26 : public net::URLRequestSimpleJob {
27 public:
28 ViewBlobInternalsJob(net::URLRequest* request,
29 net::NetworkDelegate* network_delegate,
30 BlobStorageContext* blob_storage_context);
32 void Start() override;
33 int GetData(std::string* mime_type,
34 std::string* charset,
35 std::string* data,
36 const net::CompletionCallback& callback) const override;
37 bool IsRedirectResponse(GURL* location, int* http_status_code) override;
38 void Kill() override;
40 private:
41 ~ViewBlobInternalsJob() override;
43 void GenerateHTML(std::string* out) const;
44 static void GenerateHTMLForBlobData(const InternalBlobData& blob_data,
45 int refcount,
46 std::string* out);
48 BlobStorageContext* blob_storage_context_;
49 base::WeakPtrFactory<ViewBlobInternalsJob> weak_factory_;
51 DISALLOW_COPY_AND_ASSIGN(ViewBlobInternalsJob);
54 } // namespace storage
56 #endif // STORAGE_BROWSER_BLOB_VIEW_BLOB_INTERNALS_JOB_H_