summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/browser/gpu_blacklist.cc3
-rw-r--r--content/browser/renderer_host/file_utilities_message_filter.cc14
-rw-r--r--content/browser/renderer_host/render_view_host.cc10
3 files changed, 16 insertions, 11 deletions
diff --git a/content/browser/gpu_blacklist.cc b/content/browser/gpu_blacklist.cc
index 9130149..1724c5f 100644
--- a/content/browser/gpu_blacklist.cc
+++ b/content/browser/gpu_blacklist.cc
@@ -584,8 +584,7 @@ bool GpuBlacklist::LoadGpuBlacklist(const DictionaryValue& parsed_json,
return false;
ListValue* list = NULL;
- parsed_json.GetList("entries", &list);
- if (list == NULL)
+ if (!parsed_json.GetList("entries", &list))
return false;
uint32 max_entry_id = 0;
diff --git a/content/browser/renderer_host/file_utilities_message_filter.cc b/content/browser/renderer_host/file_utilities_message_filter.cc
index e99f126..1971946 100644
--- a/content/browser/renderer_host/file_utilities_message_filter.cc
+++ b/content/browser/renderer_host/file_utilities_message_filter.cc
@@ -38,34 +38,36 @@ bool FileUtilitiesMessageFilter::OnMessageReceived(const IPC::Message& message,
void FileUtilitiesMessageFilter::OnGetFileSize(const FilePath& path,
int64* result) {
+ *result = -1;
+
// Get file size only when the child process has been granted permission to
// upload the file.
if (!ChildProcessSecurityPolicy::GetInstance()->CanReadFile(
process_id_, path)) {
- *result = -1;
return;
}
base::PlatformFileInfo file_info;
file_info.size = 0;
- file_util::GetFileInfo(path, &file_info);
- *result = file_info.size;
+ if (file_util::GetFileInfo(path, &file_info))
+ *result = file_info.size;
}
void FileUtilitiesMessageFilter::OnGetFileModificationTime(
const FilePath& path, base::Time* result) {
+ *result = base::Time();
+
// Get file modification time only when the child process has been granted
// permission to upload the file.
if (!ChildProcessSecurityPolicy::GetInstance()->CanReadFile(
process_id_, path)) {
- *result = base::Time();
return;
}
base::PlatformFileInfo file_info;
file_info.size = 0;
- file_util::GetFileInfo(path, &file_info);
- *result = file_info.last_modified;
+ if (file_util::GetFileInfo(path, &file_info))
+ *result = file_info.last_modified;
}
void FileUtilitiesMessageFilter::OnOpenFile(
diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc
index 6767702..07f2ceb 100644
--- a/content/browser/renderer_host/render_view_host.cc
+++ b/content/browser/renderer_host/render_view_host.cc
@@ -1426,7 +1426,7 @@ void RenderViewHost::ForwardMouseEvent(
view->HandleMouseDown();
break;
case WebInputEvent::MouseWheel:
- if (ignore_input_events() && delegate_)
+ if (ignore_input_events())
delegate_->OnIgnoredUIEvent();
break;
case WebInputEvent::MouseUp:
@@ -1447,7 +1447,7 @@ void RenderViewHost::OnMouseActivate() {
void RenderViewHost::ForwardKeyboardEvent(
const NativeWebKeyboardEvent& key_event) {
if (ignore_input_events()) {
- if (key_event.type == WebInputEvent::RawKeyDown && delegate_)
+ if (key_event.type == WebInputEvent::RawKeyDown)
delegate_->OnIgnoredUIEvent();
return;
}
@@ -1665,7 +1665,11 @@ void RenderViewHost::OnUpdateZoomLimits(int minimum_percent,
void RenderViewHost::OnScriptEvalResponse(int id, const ListValue& result) {
Value* result_value;
- result.Get(0, &result_value);
+ if (!result.Get(0, &result_value)) {
+ // Programming error or rogue renderer.
+ NOTREACHED() << "Got bad arguments for OnScriptEvalResponse";
+ return;
+ }
std::pair<int, Value*> details(id, result_value);
NotificationService::current()->Notify(
NotificationType::EXECUTE_JAVASCRIPT_RESULT,