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

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 1009583004: Add UMA histograms and logging for bad IPC message handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "content/browser/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "content/common/browser_plugin/browser_plugin_messages.h" 42 #include "content/common/browser_plugin/browser_plugin_messages.h"
43 #include "content/common/content_switches_internal.h" 43 #include "content/common/content_switches_internal.h"
44 #include "content/common/drag_messages.h" 44 #include "content/common/drag_messages.h"
45 #include "content/common/frame_messages.h" 45 #include "content/common/frame_messages.h"
46 #include "content/common/input_messages.h" 46 #include "content/common/input_messages.h"
47 #include "content/common/inter_process_time_ticks_converter.h" 47 #include "content/common/inter_process_time_ticks_converter.h"
48 #include "content/common/speech_recognition_messages.h" 48 #include "content/common/speech_recognition_messages.h"
49 #include "content/common/swapped_out_messages.h" 49 #include "content/common/swapped_out_messages.h"
50 #include "content/common/view_messages.h" 50 #include "content/common/view_messages.h"
51 #include "content/public/browser/ax_event_notification_details.h" 51 #include "content/public/browser/ax_event_notification_details.h"
52 #include "content/public/browser/bad_message.h"
52 #include "content/public/browser/browser_accessibility_state.h" 53 #include "content/public/browser/browser_accessibility_state.h"
53 #include "content/public/browser/browser_context.h" 54 #include "content/public/browser/browser_context.h"
54 #include "content/public/browser/browser_message_filter.h" 55 #include "content/public/browser/browser_message_filter.h"
55 #include "content/public/browser/content_browser_client.h" 56 #include "content/public/browser/content_browser_client.h"
56 #include "content/public/browser/focused_node_details.h" 57 #include "content/public/browser/focused_node_details.h"
57 #include "content/public/browser/native_web_keyboard_event.h" 58 #include "content/public/browser/native_web_keyboard_event.h"
58 #include "content/public/browser/notification_details.h" 59 #include "content/public/browser/notification_details.h"
59 #include "content/public/browser/notification_service.h" 60 #include "content/public/browser/notification_service.h"
60 #include "content/public/browser/notification_types.h" 61 #include "content/public/browser/notification_types.h"
61 #include "content/public/browser/render_frame_host.h" 62 #include "content/public/browser/render_frame_host.h"
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 void RenderViewHostImpl::OnUpdateState(int32 page_id, const PageState& state) { 996 void RenderViewHostImpl::OnUpdateState(int32 page_id, const PageState& state) {
996 // If the following DCHECK fails, you have encountered a tricky edge-case that 997 // If the following DCHECK fails, you have encountered a tricky edge-case that
997 // has evaded reproduction for a very long time. Please report what you were 998 // has evaded reproduction for a very long time. Please report what you were
998 // doing on http://crbug.com/407376, whether or not you can reproduce the 999 // doing on http://crbug.com/407376, whether or not you can reproduce the
999 // failure. 1000 // failure.
1000 DCHECK_EQ(page_id, page_id_); 1001 DCHECK_EQ(page_id, page_id_);
1001 1002
1002 // Without this check, the renderer can trick the browser into using 1003 // Without this check, the renderer can trick the browser into using
1003 // filenames it can't access in a future session restore. 1004 // filenames it can't access in a future session restore.
1004 if (!CanAccessFilesOfPageState(state)) { 1005 if (!CanAccessFilesOfPageState(state)) {
1005 GetProcess()->ReceivedBadMessage(); 1006 GetProcess()->ReceivedBadMessage(
1007 BadMessage::RVH_CAN_ACCESS_FILES_OF_PAGE_STATE);
1006 return; 1008 return;
1007 } 1009 }
1008 1010
1009 delegate_->UpdateState(this, page_id, state); 1011 delegate_->UpdateState(this, page_id, state);
1010 } 1012 }
1011 1013
1012 void RenderViewHostImpl::OnUpdateTargetURL(const GURL& url) { 1014 void RenderViewHostImpl::OnUpdateTargetURL(const GURL& url) {
1013 if (is_active_) 1015 if (is_active_)
1014 delegate_->UpdateTargetURL(this, url); 1016 delegate_->UpdateTargetURL(this, url);
1015 1017
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 return; 1363 return;
1362 host_zoom_map->SetPageScaleFactorIsOneForView(GetProcess()->GetID(), 1364 host_zoom_map->SetPageScaleFactorIsOneForView(GetProcess()->GetID(),
1363 GetRoutingID(), is_one); 1365 GetRoutingID(), is_one);
1364 } 1366 }
1365 1367
1366 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) { 1368 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) {
1367 // Do not allow messages with absolute paths in them as this can permit a 1369 // Do not allow messages with absolute paths in them as this can permit a
1368 // renderer to coerce the browser to perform I/O on a renderer controlled 1370 // renderer to coerce the browser to perform I/O on a renderer controlled
1369 // path. 1371 // path.
1370 if (params.default_file_name != params.default_file_name.BaseName()) { 1372 if (params.default_file_name != params.default_file_name.BaseName()) {
1371 GetProcess()->ReceivedBadMessage(); 1373 GetProcess()->ReceivedBadMessage(BadMessage::RVH_FILE_CHOOSER_PATH);
1372 return; 1374 return;
1373 } 1375 }
1374 1376
1375 delegate_->RunFileChooser(this, params); 1377 delegate_->RunFileChooser(this, params);
1376 } 1378 }
1377 1379
1378 void RenderViewHostImpl::OnFocusedNodeTouched(bool editable) { 1380 void RenderViewHostImpl::OnFocusedNodeTouched(bool editable) {
1379 #if defined(OS_WIN) 1381 #if defined(OS_WIN)
1380 if (editable) { 1382 if (editable) {
1381 virtual_keyboard_requested_ = base::win::DisplayVirtualKeyboard(); 1383 virtual_keyboard_requested_ = base::win::DisplayVirtualKeyboard();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1416 FrameTree* frame_tree = delegate_->GetFrameTree(); 1418 FrameTree* frame_tree = delegate_->GetFrameTree();
1417 1419
1418 frame_tree->ResetForMainFrameSwap(); 1420 frame_tree->ResetForMainFrameSwap();
1419 } 1421 }
1420 1422
1421 void RenderViewHostImpl::SelectWordAroundCaret() { 1423 void RenderViewHostImpl::SelectWordAroundCaret() {
1422 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); 1424 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID()));
1423 } 1425 }
1424 1426
1425 } // namespace content 1427 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698