summaryrefslogtreecommitdiffstats
path: root/content/browser/devtools/renderer_overrides_handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/devtools/renderer_overrides_handler.cc')
-rw-r--r--content/browser/devtools/renderer_overrides_handler.cc26
1 files changed, 8 insertions, 18 deletions
diff --git a/content/browser/devtools/renderer_overrides_handler.cc b/content/browser/devtools/renderer_overrides_handler.cc
index 1bd487f..4901f34 100644
--- a/content/browser/devtools/renderer_overrides_handler.cc
+++ b/content/browser/devtools/renderer_overrides_handler.cc
@@ -443,16 +443,13 @@ RendererOverridesHandler::PageCaptureScreenshot(
&png,
gfx::Rect(snapshot_size))) {
std::string base64_data;
- bool success = base::Base64Encode(
+ base::Base64Encode(
base::StringPiece(reinterpret_cast<char*>(&*png.begin()), png.size()),
&base64_data);
- if (success) {
- base::DictionaryValue* result = new base::DictionaryValue();
- result->SetString(
- devtools::Page::captureScreenshot::kResponseData, base64_data);
- return command->SuccessResponse(result);
- }
- return command->InternalErrorResponse("Unable to base64encode screenshot");
+ base::DictionaryValue* result = new base::DictionaryValue();
+ result->SetString(
+ devtools::Page::captureScreenshot::kResponseData, base64_data);
+ return command->SuccessResponse(result);
}
// Fallback to copying from compositing surface.
@@ -553,16 +550,9 @@ void RendererOverridesHandler::ScreenshotCaptured(
}
std::string base_64_data;
- if (!base::Base64Encode(base::StringPiece(
- reinterpret_cast<char*>(&data[0]),
- data.size()),
- &base_64_data)) {
- if (command) {
- SendAsyncResponse(
- command->InternalErrorResponse("Unable to base64 encode"));
- }
- return;
- }
+ base::Base64Encode(
+ base::StringPiece(reinterpret_cast<char*>(&data[0]), data.size()),
+ &base_64_data);
base::DictionaryValue* response = new base::DictionaryValue();
response->SetString(devtools::Page::screencastFrame::kParamData,