Chromium Code Reviews| 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..a1f8569005c7d519818a64a2441707f6b923e9dd 100644 |
| --- a/chrome/browser/ui/webui/screenshot_source.h |
| +++ b/chrome/browser/ui/webui/screenshot_source.h |
| @@ -6,6 +6,7 @@ |
| #define CHROME_BROWSER_UI_WEBUI_SCREENSHOT_SOURCE_H_ |
| #include <string> |
| +#include <map> |
|
Daniel Erat
2011/08/12 14:43:40
nit: alphabetize
rkc
2011/08/22 13:23:52
Done.
|
| #include <vector> |
| #include "base/basictypes.h" |
| @@ -18,6 +19,7 @@ class ScreenshotSource : public ChromeURLDataManager::DataSource { |
| explicit ScreenshotSource( |
| std::vector<unsigned char>* current_screenshot); |
|
Daniel Erat
2011/08/12 14:43:40
nit: remove extra blank line
rkc
2011/08/22 13:23:52
Done.
|
| + |
| // Called when the network layer has requested a resource underneath |
| // the path we registered. |
| virtual void StartDataRequest(const std::string& path, |
| @@ -26,12 +28,21 @@ class ScreenshotSource : public ChromeURLDataManager::DataSource { |
| virtual std::string GetMimeType(const std::string&) const; |
| - std::vector<unsigned char> GetScreenshot(const std::string& path); |
| + std::vector<unsigned char> GetCachedScreenshot(const std::string& path); |
| private: |
| virtual ~ScreenshotSource(); |
| + |
| + void CacheAndSendScreenshot(const std::string& path, int request_id, |
|
Daniel Erat
2011/08/12 14:43:40
nit: add comment and only put one param on each li
rkc
2011/08/22 13:23:52
Done.
|
| + const std::vector<unsigned char> bytes); |
|
zel
2011/08/12 13:01:37
const std::vector<unsigned char>& bytes
rkc
2011/08/22 13:23:52
Done.
|
| + void SendScreenshot(const std::string& path, int request_id); |
| +#if defined(OS_CHROMEOS) |
| + void SendSavedScreenshot(const std::string& filename, int request_id); |
| +#endif |
| + |
| std::vector<unsigned char> current_screenshot_; |
| + std::map<std::string, std::vector<unsigned char> > cached_screenshots_; |
|
Daniel Erat
2011/08/12 14:43:40
don't store things that are expensive to copy insi
Daniel Erat
2011/08/12 14:43:40
is this code caching screenshots indefinitely? if
rkc
2011/08/22 13:23:52
Done.
rkc
2011/08/22 13:23:52
No, this gets put in the data sources delete queue
|
| DISALLOW_COPY_AND_ASSIGN(ScreenshotSource); |
| }; |