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

Side by Side Diff: webkit/blob/view_blob_internals_job.h

Issue 10696135: Offload disk accesses to WorkerPool in ExtensionProtocolHandler (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 10 matching lines...) Expand all
21 class BlobStorageController; 21 class BlobStorageController;
22 22
23 // A job subclass that implements a protocol to inspect the internal 23 // A job subclass that implements a protocol to inspect the internal
24 // state of blob registry. 24 // state of blob registry.
25 class BLOB_EXPORT ViewBlobInternalsJob : public net::URLRequestSimpleJob { 25 class BLOB_EXPORT ViewBlobInternalsJob : public net::URLRequestSimpleJob {
26 public: 26 public:
27 ViewBlobInternalsJob(net::URLRequest* request, 27 ViewBlobInternalsJob(net::URLRequest* request,
28 BlobStorageController* blob_storage_controller); 28 BlobStorageController* blob_storage_controller);
29 29
30 virtual void Start() OVERRIDE; 30 virtual void Start() OVERRIDE;
31 virtual bool GetData(std::string* mime_type, 31 virtual int GetData(std::string* mime_type,
32 std::string* charset, 32 std::string* charset,
33 std::string* data) const OVERRIDE; 33 std::string* data,
34 const net::CompletionCallback& callback) const OVERRIDE;
34 virtual bool IsRedirectResponse(GURL* location, 35 virtual bool IsRedirectResponse(GURL* location,
35 int* http_status_code) OVERRIDE; 36 int* http_status_code) OVERRIDE;
36 virtual void Kill() OVERRIDE; 37 virtual void Kill() OVERRIDE;
37 38
38 private: 39 private:
39 virtual ~ViewBlobInternalsJob(); 40 virtual ~ViewBlobInternalsJob();
40 41
41 void DoWorkAsync(); 42 void DoWorkAsync();
42 void GenerateHTML(std::string* out) const; 43 void GenerateHTML(std::string* out) const;
43 static void GenerateHTMLForBlobData(const BlobData& blob_data, 44 static void GenerateHTMLForBlobData(const BlobData& blob_data,
44 std::string* out); 45 std::string* out);
45 46
46 BlobStorageController* blob_storage_controller_; 47 BlobStorageController* blob_storage_controller_;
47 base::WeakPtrFactory<ViewBlobInternalsJob> weak_factory_; 48 base::WeakPtrFactory<ViewBlobInternalsJob> weak_factory_;
48 49
49 DISALLOW_COPY_AND_ASSIGN(ViewBlobInternalsJob); 50 DISALLOW_COPY_AND_ASSIGN(ViewBlobInternalsJob);
50 }; 51 };
51 52
52 } // namespace webkit_blob 53 } // namespace webkit_blob
53 54
54 #endif // WEBKIT_BLOB_VIEW_BLOB_INTERNALS_JOB_H_ 55 #endif // WEBKIT_BLOB_VIEW_BLOB_INTERNALS_JOB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698