Index: chrome/browser/ui/webui/screenshot_source.h |
diff --git a/chrome/browser/ui/webui/screenshot_source.h b/chrome/browser/ui/webui/screenshot_source.h |
index 4b071d3df0acf92a53068593cca4260e1f4625f2..0fa843291c378095109c8349e2031b845b82e4e7 100644 |
--- a/chrome/browser/ui/webui/screenshot_source.h |
+++ b/chrome/browser/ui/webui/screenshot_source.h |
@@ -5,12 +5,17 @@ |
#ifndef CHROME_BROWSER_UI_WEBUI_SCREENSHOT_SOURCE_H_ |
#define CHROME_BROWSER_UI_WEBUI_SCREENSHOT_SOURCE_H_ |
+#include <map> |
#include <string> |
#include <vector> |
#include "base/basictypes.h" |
+#include "base/memory/linked_ptr.h" |
#include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
+typedef std::vector<unsigned char> ScreenshotData; |
+typedef linked_ptr<ScreenshotData> ScreenshotDataPtr; |
+ |
// ScreenshotSource is the data source that serves screenshots (saved |
// or current) to the bug report html ui |
class ScreenshotSource : public ChromeURLDataManager::DataSource { |
@@ -26,12 +31,23 @@ class ScreenshotSource : public ChromeURLDataManager::DataSource { |
virtual std::string GetMimeType(const std::string&) const; |
- std::vector<unsigned char> GetScreenshot(const std::string& path); |
+ ScreenshotDataPtr GetCachedScreenshot(const std::string& path); |
private: |
virtual ~ScreenshotSource(); |
- std::vector<unsigned char> current_screenshot_; |
+ // Sends the screenshot data to the requestor while caching it locally to the |
+ // class instance, indexed by path. |
+ void CacheAndSendScreenshot(const std::string& path, |
+ int request_id, |
+ ScreenshotDataPtr bytes); |
+ void SendScreenshot(const std::string& path, int request_id); |
+#if defined(OS_CHROMEOS) |
+ void SendSavedScreenshot(const std::string& filename, int request_id); |
Daniel Erat
2011/08/22 16:42:02
headers should have comments describing what funct
rkc
2011/08/23 10:25:20
Done.
|
+#endif |
+ |
+ ScreenshotDataPtr current_screenshot_; |
+ std::map<std::string, ScreenshotDataPtr> cached_screenshots_; |
Daniel Erat
2011/08/22 16:42:02
add a comment here describing what you're using as
rkc
2011/08/23 10:25:20
Done.
|
DISALLOW_COPY_AND_ASSIGN(ScreenshotSource); |
}; |