OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_BLOB_VIEW_BLOB_INTERNALS_JOB_H_ | 5 #ifndef WEBKIT_BLOB_VIEW_BLOB_INTERNALS_JOB_H_ |
6 #define WEBKIT_BLOB_VIEW_BLOB_INTERNALS_JOB_H_ | 6 #define WEBKIT_BLOB_VIEW_BLOB_INTERNALS_JOB_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "net/url_request/url_request_simple_job.h" | 10 #include "net/url_request/url_request_simple_job.h" |
11 | 11 |
| 12 namespace net { |
12 class URLRequest; | 13 class URLRequest; |
| 14 } // namespace net |
13 | 15 |
14 namespace webkit_blob { | 16 namespace webkit_blob { |
15 | 17 |
16 class BlobData; | 18 class BlobData; |
17 class BlobStorageController; | 19 class BlobStorageController; |
18 | 20 |
19 // A job subclass that implements a protocol to inspect the internal | 21 // A job subclass that implements a protocol to inspect the internal |
20 // state of blob registry. | 22 // state of blob registry. |
21 class ViewBlobInternalsJob : public URLRequestSimpleJob { | 23 class ViewBlobInternalsJob : public URLRequestSimpleJob { |
22 public: | 24 public: |
23 ViewBlobInternalsJob(URLRequest* request, | 25 ViewBlobInternalsJob(net::URLRequest* request, |
24 BlobStorageController* blob_storage_controller); | 26 BlobStorageController* blob_storage_controller); |
25 | 27 |
26 virtual void Start(); | 28 virtual void Start(); |
27 virtual bool GetData(std::string* mime_type, | 29 virtual bool GetData(std::string* mime_type, |
28 std::string* charset, | 30 std::string* charset, |
29 std::string* data) const; | 31 std::string* data) const; |
30 virtual bool IsRedirectResponse(GURL* location, int* http_status_code); | 32 virtual bool IsRedirectResponse(GURL* location, int* http_status_code); |
31 | 33 |
32 private: | 34 private: |
33 ~ViewBlobInternalsJob(); | 35 ~ViewBlobInternalsJob(); |
34 | 36 |
35 void DoWorkAsync(); | 37 void DoWorkAsync(); |
36 void GenerateHTML(std::string* out) const; | 38 void GenerateHTML(std::string* out) const; |
37 static void GenerateHTMLForBlobData(const BlobData& blob_data, | 39 static void GenerateHTMLForBlobData(const BlobData& blob_data, |
38 std::string* out); | 40 std::string* out); |
39 | 41 |
40 BlobStorageController* blob_storage_controller_; | 42 BlobStorageController* blob_storage_controller_; |
41 | 43 |
42 DISALLOW_COPY_AND_ASSIGN(ViewBlobInternalsJob); | 44 DISALLOW_COPY_AND_ASSIGN(ViewBlobInternalsJob); |
43 }; | 45 }; |
44 | 46 |
45 } // namespace webkit_blob | 47 } // namespace webkit_blob |
46 | 48 |
47 #endif // WEBKIT_BLOB_VIEW_BLOB_INTERNALS_JOB_H_ | 49 #endif // WEBKIT_BLOB_VIEW_BLOB_INTERNALS_JOB_H_ |
OLD | NEW |