1 // Copyright 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CONTENT_COMMON_FRAME_MESSAGES_H_ 6 #define CONTENT_COMMON_FRAME_MESSAGES_H_ 7 8 // IPC messages for interacting with frames. 9 10 #include <stddef.h> 11 #include <stdint.h> 12 13 #include <map> 14 #include <set> 15 #include <string> 16 #include <vector> 17 18 #include "base/optional.h" 19 #include "base/unguessable_token.h" 20 #include "build/build_config.h" 21 #include "cc/input/touch_action.h" 22 #include "components/viz/common/surfaces/surface_id.h" 23 #include "components/viz/common/surfaces/surface_info.h" 24 #include "content/common/buildflags.h" 25 #include "content/common/common_param_traits_macros.h" 26 #include "content/common/content_export.h" 27 #include "content/common/content_param_traits.h" 28 #include "content/common/frame_delete_intention.h" 29 #include "content/common/frame_replication_state.h" 30 #include "content/common/navigation_gesture.h" 31 #include "content/common/navigation_params.h" 32 #include "content/public/common/common_param_traits.h" 33 #include "content/public/common/impression.h" 34 #include "content/public/common/navigation_policy.h" 35 #include "content/public/common/referrer.h" 36 #include "content/public/common/stop_find_action.h" 37 #include "content/public/common/three_d_api_types.h" 38 #include "content/public/common/untrustworthy_context_menu_params.h" 39 #include "ipc/ipc_channel_handle.h" 40 #include "ipc/ipc_message_macros.h" 41 #include "ipc/ipc_platform_file.h" 42 #include "mojo/public/cpp/system/message_pipe.h" 43 #include "ppapi/buildflags/buildflags.h" 44 #include "services/network/public/mojom/content_security_policy.mojom.h" 45 #include "third_party/blink/public/common/feature_policy/feature_policy.h" 46 #include "third_party/blink/public/common/frame/frame_policy.h" 47 #include "third_party/blink/public/common/frame/frame_visual_properties.h" 48 #include "third_party/blink/public/common/loader/previews_state.h" 49 #include "third_party/blink/public/common/messaging/message_port_channel.h" 50 #include "third_party/blink/public/common/navigation/triggering_event_info.h" 51 #include "third_party/blink/public/common/page_state/page_state.h" 52 #include "third_party/blink/public/mojom/choosers/file_chooser.mojom.h" 53 #include "third_party/blink/public/mojom/devtools/console_message.mojom.h" 54 #include "third_party/blink/public/mojom/favicon/favicon_url.mojom.h" 55 #include "third_party/blink/public/mojom/feature_policy/document_policy_feature.mojom.h" 56 #include "third_party/blink/public/mojom/feature_policy/feature_policy_feature.mojom-shared.h" 57 #include "third_party/blink/public/mojom/feature_policy/policy_disposition.mojom.h" 58 #include "third_party/blink/public/mojom/frame/blocked_navigation_types.mojom.h" 59 #include "third_party/blink/public/mojom/frame/frame_owner_element_type.mojom.h" 60 #include "third_party/blink/public/mojom/frame/frame_owner_properties.mojom.h" 61 #include "third_party/blink/public/mojom/frame/lifecycle.mojom.h" 62 #include "third_party/blink/public/mojom/frame/tree_scope_type.mojom.h" 63 #include "third_party/blink/public/mojom/frame/user_activation_update_types.mojom.h" 64 #include "third_party/blink/public/mojom/loader/resource_load_info.mojom-shared.h" 65 #include "third_party/blink/public/mojom/manifest/display_mode.mojom.h" 66 #include "third_party/blink/public/mojom/scroll/scrollbar_mode.mojom.h" 67 #include "third_party/blink/public/mojom/security_context/insecure_request_policy.mojom.h" 68 #include "third_party/blink/public/mojom/web_feature/web_feature.mojom.h" 69 #include "third_party/blink/public/web/web_frame_owner_properties.h" 70 #include "ui/gfx/geometry/rect.h" 71 #include "ui/gfx/geometry/rect_f.h" 72 #include "ui/gfx/ipc/color/gfx_param_traits.h" 73 #include "ui/gfx/ipc/gfx_param_traits.h" 74 #include "url/gurl.h" 75 #include "url/origin.h" 76 77 #if BUILDFLAG(ENABLE_PLUGINS) 78 #include "content/common/pepper_renderer_instance_data.h" 79 #endif 80 81 #undef IPC_MESSAGE_EXPORT 82 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT 83 84 #define IPC_MESSAGE_START FrameMsgStart 85 IPC_ENUM_TRAITS_MAX_VALUE(content::FrameDeleteIntention, 86 content::FrameDeleteIntention::kMaxValue) 87 IPC_ENUM_TRAITS_MAX_VALUE(blink::mojom::FrameOwnerElementType, 88 blink::mojom::FrameOwnerElementType::kMaxValue) 89 IPC_ENUM_TRAITS_MAX_VALUE(blink::mojom::AdFrameType, 90 blink::mojom::AdFrameType::kMaxValue) 91 IPC_ENUM_TRAITS_MAX_VALUE(blink::ContextMenuDataMediaType, 92 blink::ContextMenuDataMediaType::kLast) 93 IPC_ENUM_TRAITS_MAX_VALUE(blink::ContextMenuDataInputFieldType, 94 blink::ContextMenuDataInputFieldType::kMaxValue) 95 IPC_ENUM_TRAITS_MAX_VALUE(blink::mojom::ScrollbarMode, 96 blink::mojom::ScrollbarMode::kMaxValue) 97 IPC_ENUM_TRAITS_MAX_VALUE(content::StopFindAction, 98 content::STOP_FIND_ACTION_LAST) 99 IPC_ENUM_TRAITS(network::mojom::WebSandboxFlags) // Bitmask. 100 IPC_ENUM_TRAITS_MAX_VALUE(blink::mojom::TreeScopeType, 101 blink::mojom::TreeScopeType::kMaxValue) 102 IPC_ENUM_TRAITS_MAX_VALUE(ui::MenuSourceType, ui::MENU_SOURCE_TYPE_LAST) 103 IPC_ENUM_TRAITS_MAX_VALUE(network::mojom::CSPDirectiveName, 104 network::mojom::CSPDirectiveName::kMaxValue) 105 IPC_ENUM_TRAITS_MAX_VALUE(blink::mojom::FeaturePolicyFeature, 106 blink::mojom::FeaturePolicyFeature::kMaxValue) 107 IPC_ENUM_TRAITS_MAX_VALUE(blink::mojom::DocumentPolicyFeature, 108 blink::mojom::DocumentPolicyFeature::kMaxValue) 109 IPC_ENUM_TRAITS_MAX_VALUE(blink::TriggeringEventInfo, 110 blink::TriggeringEventInfo::kMaxValue) 111 IPC_ENUM_TRAITS_MAX_VALUE(blink::mojom::UserActivationUpdateType, 112 blink::mojom::UserActivationUpdateType::kMaxValue) 113 IPC_ENUM_TRAITS_MAX_VALUE(blink::mojom::PolicyDisposition, 114 blink::mojom::PolicyDisposition::kMaxValue) 115 IPC_ENUM_TRAITS_MAX_VALUE(blink::mojom::FrameVisibility, 116 blink::mojom::FrameVisibility::kMaxValue) 117 IPC_ENUM_TRAITS_MAX_VALUE(blink::mojom::WebFeature, 118 blink::mojom::WebFeature::kMaxValue) 119 IPC_ENUM_TRAITS_MAX_VALUE(blink::mojom::InsecureRequestPolicy, 120 blink::mojom::InsecureRequestPolicy::kMaxValue) 121 122 IPC_STRUCT_TRAITS_BEGIN(content::NavigationDownloadPolicy) 123 IPC_STRUCT_TRAITS_MEMBER(observed_types) 124 IPC_STRUCT_TRAITS_MEMBER(disallowed_types) 125 IPC_STRUCT_TRAITS_MEMBER(blocking_downloads_in_sandbox_enabled) 126 IPC_STRUCT_TRAITS_END() 127 128 IPC_STRUCT_TRAITS_BEGIN(content::Impression) 129 IPC_STRUCT_TRAITS_MEMBER(conversion_destination) 130 IPC_STRUCT_TRAITS_MEMBER(reporting_origin) 131 IPC_STRUCT_TRAITS_MEMBER(impression_data) 132 IPC_STRUCT_TRAITS_MEMBER(expiry) 133 IPC_STRUCT_TRAITS_END() 134 135 IPC_STRUCT_TRAITS_BEGIN(content::UntrustworthyContextMenuParams) 136 IPC_STRUCT_TRAITS_MEMBER(media_type) 137 IPC_STRUCT_TRAITS_MEMBER(x) 138 IPC_STRUCT_TRAITS_MEMBER(y) 139 IPC_STRUCT_TRAITS_MEMBER(link_url) 140 IPC_STRUCT_TRAITS_MEMBER(link_text) 141 IPC_STRUCT_TRAITS_MEMBER(impression) 142 IPC_STRUCT_TRAITS_MEMBER(unfiltered_link_url) 143 IPC_STRUCT_TRAITS_MEMBER(src_url) 144 IPC_STRUCT_TRAITS_MEMBER(has_image_contents) 145 IPC_STRUCT_TRAITS_MEMBER(media_flags) 146 IPC_STRUCT_TRAITS_MEMBER(selection_text) 147 IPC_STRUCT_TRAITS_MEMBER(title_text) 148 IPC_STRUCT_TRAITS_MEMBER(alt_text) 149 IPC_STRUCT_TRAITS_MEMBER(suggested_filename) 150 IPC_STRUCT_TRAITS_MEMBER(misspelled_word) 151 IPC_STRUCT_TRAITS_MEMBER(dictionary_suggestions) 152 IPC_STRUCT_TRAITS_MEMBER(spellcheck_enabled) 153 IPC_STRUCT_TRAITS_MEMBER(is_editable) 154 IPC_STRUCT_TRAITS_MEMBER(writing_direction_default) 155 IPC_STRUCT_TRAITS_MEMBER(writing_direction_left_to_right) 156 IPC_STRUCT_TRAITS_MEMBER(writing_direction_right_to_left) 157 IPC_STRUCT_TRAITS_MEMBER(edit_flags) 158 IPC_STRUCT_TRAITS_MEMBER(frame_charset) 159 IPC_STRUCT_TRAITS_MEMBER(referrer_policy) 160 IPC_STRUCT_TRAITS_MEMBER(custom_context) 161 IPC_STRUCT_TRAITS_MEMBER(custom_items) 162 IPC_STRUCT_TRAITS_MEMBER(source_type) 163 IPC_STRUCT_TRAITS_MEMBER(input_field_type) 164 IPC_STRUCT_TRAITS_MEMBER(selection_rect) 165 IPC_STRUCT_TRAITS_MEMBER(selection_start_offset) 166 IPC_STRUCT_TRAITS_END() 167 168 IPC_STRUCT_TRAITS_BEGIN(content::CustomContextMenuContext) 169 IPC_STRUCT_TRAITS_MEMBER(is_pepper_menu) 170 IPC_STRUCT_TRAITS_MEMBER(request_id) 171 IPC_STRUCT_TRAITS_MEMBER(render_widget_id) 172 IPC_STRUCT_TRAITS_MEMBER(link_followed) 173 IPC_STRUCT_TRAITS_END() 174 175 IPC_STRUCT_TRAITS_BEGIN(blink::FrameVisualProperties) 176 IPC_STRUCT_TRAITS_MEMBER(screen_info) 177 IPC_STRUCT_TRAITS_MEMBER(auto_resize_enabled) 178 IPC_STRUCT_TRAITS_MEMBER(visible_viewport_size) 179 IPC_STRUCT_TRAITS_MEMBER(min_size_for_auto_resize) 180 IPC_STRUCT_TRAITS_MEMBER(max_size_for_auto_resize) 181 IPC_STRUCT_TRAITS_MEMBER(root_widget_window_segments) 182 IPC_STRUCT_TRAITS_MEMBER(capture_sequence_number) 183 IPC_STRUCT_TRAITS_MEMBER(zoom_level) 184 IPC_STRUCT_TRAITS_MEMBER(page_scale_factor) 185 IPC_STRUCT_TRAITS_MEMBER(is_pinch_gesture_active) 186 IPC_STRUCT_TRAITS_MEMBER(screen_space_rect) 187 IPC_STRUCT_TRAITS_MEMBER(local_frame_size) 188 IPC_STRUCT_TRAITS_MEMBER(compositor_viewport) 189 IPC_STRUCT_TRAITS_MEMBER(local_surface_id) 190 IPC_STRUCT_TRAITS_END() 191 192 IPC_STRUCT_TRAITS_BEGIN(blink::FramePolicy) 193 IPC_STRUCT_TRAITS_MEMBER(sandbox_flags) 194 IPC_STRUCT_TRAITS_MEMBER(container_policy) 195 IPC_STRUCT_TRAITS_MEMBER(required_document_policy) 196 IPC_STRUCT_TRAITS_MEMBER(allowed_to_download) 197 IPC_STRUCT_TRAITS_MEMBER(disallow_document_access) 198 IPC_STRUCT_TRAITS_END() 199 200 IPC_STRUCT_TRAITS_BEGIN(blink::ScreenInfo) 201 IPC_STRUCT_TRAITS_MEMBER(device_scale_factor) 202 IPC_STRUCT_TRAITS_MEMBER(display_color_spaces) 203 IPC_STRUCT_TRAITS_MEMBER(depth) 204 IPC_STRUCT_TRAITS_MEMBER(depth_per_component) 205 IPC_STRUCT_TRAITS_MEMBER(is_monochrome) 206 IPC_STRUCT_TRAITS_MEMBER(display_frequency) 207 IPC_STRUCT_TRAITS_MEMBER(rect) 208 IPC_STRUCT_TRAITS_MEMBER(available_rect) 209 IPC_STRUCT_TRAITS_MEMBER(orientation_type) 210 IPC_STRUCT_TRAITS_MEMBER(orientation_angle) 211 IPC_STRUCT_TRAITS_END() 212 213 // Parameters structure for mojom::FrameHost::DidCommitProvisionalLoad. 214 // TODO(https://crbug.com/729021, https://crbug.com/1145888): 215 // Convert this to a Mojo struct. 216 IPC_STRUCT_BEGIN(FrameHostMsg_DidCommitProvisionalLoad_Params) 217 // The unique ID of the NavigationEntry for browser-initiated navigations. 218 // This value was given to the render process in the HistoryNavigationParams 219 // and is being returned by the renderer without it having any idea what it 220 // means. If the navigation was renderer-initiated, this value is 0. 221 IPC_STRUCT_MEMBER(int, nav_entry_id, 0) 222 223 // The item sequence number identifies each stop in the session history. It 224 // is unique within the renderer process and makes a best effort to be unique 225 // across browser sessions (using a renderer process timestamp). 226 IPC_STRUCT_MEMBER(int64_t, item_sequence_number, -1) 227 228 // The document sequence number is used to identify cross-document navigations 229 // in session history. It increments for each new document and is unique in 230 // the same way as |item_sequence_number|. In-page navigations get a new item 231 // sequence number but the same document sequence number. 232 IPC_STRUCT_MEMBER(int64_t, document_sequence_number, -1) 233 234 // URL of the page being loaded. 235 IPC_STRUCT_MEMBER(GURL, url) 236 237 // The base URL for the page's document when the frame was committed. Empty if 238 // similar to 'url' above. Note that any base element in the page has not been 239 // parsed yet and is therefore not reflected. 240 // This is of interest when a MHTML file is loaded, as the base URL has been 241 // set to original URL of the site the MHTML represents. 242 IPC_STRUCT_MEMBER(GURL, base_url) 243 244 // URL of the referrer of this load. WebKit generates this based on the 245 // source of the event that caused the load. 246 IPC_STRUCT_MEMBER(content::Referrer, referrer) 247 248 // The type of transition. 249 IPC_STRUCT_MEMBER(ui::PageTransition, transition, ui::PAGE_TRANSITION_LINK) 250 251 // Lists the redirects that occurred on the way to the current page. This 252 // vector has the same format as reported by the WebDataSource in the glue, 253 // with the current page being the last one in the list (so even when 254 // there's no redirect, there will be one entry in the list. 255 IPC_STRUCT_MEMBER(std::vector<GURL>, redirects) 256 257 // Set to false if we want to update the session history but not update 258 // the browser history. E.g., on unreachable urls. 259 IPC_STRUCT_MEMBER(bool, should_update_history, false) 260 261 // Contents MIME type of main frame. 262 IPC_STRUCT_MEMBER(std::string, contents_mime_type) 263 264 // This is the value from the browser (copied from the navigation request) 265 // indicating whether it intended to make a new entry. TODO(avi): Remove this 266 // when the pending entry situation is made sane and the browser keeps them 267 // around long enough to match them via nav_entry_id. 268 IPC_STRUCT_MEMBER(bool, intended_as_new_entry) 269 270 // Whether this commit created a new entry. 271 IPC_STRUCT_MEMBER(bool, did_create_new_entry) 272 273 // Whether this commit should replace the current entry. 274 IPC_STRUCT_MEMBER(bool, should_replace_current_entry) 275 276 // The gesture that initiated this navigation. 277 IPC_STRUCT_MEMBER(content::NavigationGesture, gesture) 278 279 // The HTTP method used by the navigation. 280 IPC_STRUCT_MEMBER(std::string, method) 281 282 // The POST body identifier. -1 if it doesn't exist. 283 IPC_STRUCT_MEMBER(int64_t, post_id) 284 285 // The status code of the HTTP request. 286 IPC_STRUCT_MEMBER(int, http_status_code) 287 288 // This flag is used to warn if the renderer is displaying an error page, 289 // so that we can set the appropriate page type. 290 IPC_STRUCT_MEMBER(bool, url_is_unreachable) 291 292 // Serialized history item state to store in the navigation entry. 293 IPC_STRUCT_MEMBER(blink::PageState, page_state) 294 295 // Original request's URL. 296 IPC_STRUCT_MEMBER(GURL, original_request_url) 297 298 // User agent override used to navigate. 299 IPC_STRUCT_MEMBER(bool, is_overriding_user_agent) 300 301 // Notifies the browser that for this navigation, the session history was 302 // successfully cleared. 303 IPC_STRUCT_MEMBER(bool, history_list_was_cleared) 304 305 // Origin of the frame. This will be replicated to any associated 306 // RenderFrameProxies. 307 IPC_STRUCT_MEMBER(url::Origin, origin) 308 309 // The insecure request policy the document for the load is enforcing. 310 IPC_STRUCT_MEMBER(blink::mojom::InsecureRequestPolicy, 311 insecure_request_policy) 312 313 // The upgrade insecure navigations set the document for the load is 314 // enforcing. 315 IPC_STRUCT_MEMBER(std::vector<uint32_t>, insecure_navigations_set) 316 317 // True if the document for the load is a unique origin that should be 318 // considered potentially trustworthy. 319 IPC_STRUCT_MEMBER(bool, has_potentially_trustworthy_unique_origin) 320 321 // Request ID generated by the renderer. 322 IPC_STRUCT_MEMBER(int, request_id) 323 324 // A token that has been passed by the browser process when it asked the 325 // renderer process to commit the navigation. 326 IPC_STRUCT_MEMBER(base::UnguessableToken, navigation_token) 327 328 // An embedding token used to signify the relationship between a document and 329 // its parent. This is populated for cross-document navigations including 330 // sub-documents and the main document. 331 IPC_STRUCT_MEMBER(base::Optional<base::UnguessableToken>, embedding_token) 332 IPC_STRUCT_END() 333 334 IPC_STRUCT_TRAITS_BEGIN(blink::ParsedFeaturePolicyDeclaration) 335 IPC_STRUCT_TRAITS_MEMBER(feature) 336 IPC_STRUCT_TRAITS_MEMBER(allowed_origins) 337 IPC_STRUCT_TRAITS_MEMBER(matches_all_origins) 338 IPC_STRUCT_TRAITS_MEMBER(matches_opaque_src) 339 IPC_STRUCT_TRAITS_END() 340 341 IPC_STRUCT_TRAITS_BEGIN(content::FrameReplicationState) 342 IPC_STRUCT_TRAITS_MEMBER(origin) 343 IPC_STRUCT_TRAITS_MEMBER(name) 344 IPC_STRUCT_TRAITS_MEMBER(unique_name) 345 IPC_STRUCT_TRAITS_MEMBER(feature_policy_header) 346 IPC_STRUCT_TRAITS_MEMBER(active_sandbox_flags) 347 IPC_STRUCT_TRAITS_MEMBER(frame_policy) 348 IPC_STRUCT_TRAITS_MEMBER(opener_feature_state) 349 IPC_STRUCT_TRAITS_MEMBER(accumulated_csp_headers) 350 IPC_STRUCT_TRAITS_MEMBER(scope) 351 IPC_STRUCT_TRAITS_MEMBER(insecure_request_policy) 352 IPC_STRUCT_TRAITS_MEMBER(insecure_navigations_set) 353 IPC_STRUCT_TRAITS_MEMBER(has_potentially_trustworthy_unique_origin) 354 IPC_STRUCT_TRAITS_MEMBER(has_active_user_gesture) 355 IPC_STRUCT_TRAITS_MEMBER(has_received_user_gesture_before_nav) 356 IPC_STRUCT_TRAITS_MEMBER(frame_owner_element_type) 357 IPC_STRUCT_TRAITS_MEMBER(ad_frame_type) 358 IPC_STRUCT_TRAITS_END() 359 360 IPC_STRUCT_TRAITS_BEGIN(network::mojom::ContentSecurityPolicyHeader) 361 IPC_STRUCT_TRAITS_MEMBER(header_value) 362 IPC_STRUCT_TRAITS_MEMBER(type) 363 IPC_STRUCT_TRAITS_MEMBER(source) 364 IPC_STRUCT_TRAITS_END() 365 366 #if BUILDFLAG(ENABLE_PLUGINS) 367 IPC_STRUCT_TRAITS_BEGIN(content::PepperRendererInstanceData) 368 IPC_STRUCT_TRAITS_MEMBER(render_process_id) 369 IPC_STRUCT_TRAITS_MEMBER(render_frame_id) 370 IPC_STRUCT_TRAITS_MEMBER(document_url) 371 IPC_STRUCT_TRAITS_MEMBER(plugin_url) 372 IPC_STRUCT_TRAITS_MEMBER(is_potentially_secure_plugin_context) 373 IPC_STRUCT_TRAITS_END() 374 #endif 375 376 // ----------------------------------------------------------------------------- 377 // Messages sent from the browser to the renderer. 378 379 // Sent in response to a FrameHostMsg_ContextMenu to let the renderer know that 380 // the menu has been closed. 381 IPC_MESSAGE_ROUTED1(FrameMsg_ContextMenuClosed, 382 content::CustomContextMenuContext /* custom_context */) 383 384 // Executes custom context menu action that was provided from Blink. 385 IPC_MESSAGE_ROUTED2(FrameMsg_CustomContextMenuAction, 386 content::CustomContextMenuContext /* custom_context */, 387 unsigned /* action */) 388 389 #if BUILDFLAG(ENABLE_PLUGINS) 390 // This message notifies that the frame that the volume of the Pepper instance 391 // for |pp_instance| should be changed to |volume|. 392 IPC_MESSAGE_ROUTED2(FrameMsg_SetPepperVolume, 393 int32_t /* pp_instance */, 394 double /* volume */) 395 #endif // BUILDFLAG(ENABLE_PLUGINS) 396 397 // ----------------------------------------------------------------------------- 398 // Messages sent from the renderer to the browser. 399 400 #if BUILDFLAG(ENABLE_PLUGINS) 401 // Notification sent from a renderer to the browser that a Pepper plugin 402 // instance is created in the DOM. 403 IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperInstanceCreated, 404 int32_t /* pp_instance */) 405 406 // Notification sent from a renderer to the browser that a Pepper plugin 407 // instance is deleted from the DOM. 408 IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperInstanceDeleted, 409 int32_t /* pp_instance */) 410 411 // Sent to the browser when the renderer detects it is blocked on a pepper 412 // plugin message for too long. This is also sent when it becomes unhung 413 // (according to the value of is_hung). The browser can give the user the 414 // option of killing the plugin. 415 IPC_MESSAGE_ROUTED3(FrameHostMsg_PepperPluginHung, 416 int /* plugin_child_id */, 417 base::FilePath /* path */, 418 bool /* is_hung */) 419 420 // Sent by the renderer process to indicate that a plugin instance has crashed. 421 // Note: |plugin_pid| should not be trusted. The corresponding process has 422 // probably died. Moreover, the ID may have been reused by a new process. Any 423 // usage other than displaying it in a prompt to the user is very likely to be 424 // wrong. 425 IPC_MESSAGE_ROUTED2(FrameHostMsg_PluginCrashed, 426 base::FilePath /* plugin_path */, 427 base::ProcessId /* plugin_pid */) 428 429 // Notification sent from a renderer to the browser that a Pepper plugin 430 // instance has started playback. 431 IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStartsPlayback, 432 int32_t /* pp_instance */) 433 434 // Notification sent from a renderer to the browser that a Pepper plugin 435 // instance has stopped playback. 436 IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback, 437 int32_t /* pp_instance */) 438 439 // Return information about a plugin for the given URL and MIME 440 // type. If there is no matching plugin, |found| is false. 441 // |actual_mime_type| is the actual mime type supported by the 442 // found plugin. 443 IPC_SYNC_MESSAGE_CONTROL4_3(FrameHostMsg_GetPluginInfo, 444 int /* render_frame_id */, 445 GURL /* url */, 446 url::Origin /* main_frame_origin */, 447 std::string /* mime_type */, 448 bool /* found */, 449 content::WebPluginInfo /* plugin info */, 450 std::string /* actual_mime_type */) 451 452 // A renderer sends this to the browser process when it wants to create a ppapi 453 // plugin. The browser will create the plugin process if necessary, and will 454 // return a handle to the channel on success. 455 // 456 // The plugin_child_id is the ChildProcessHost ID assigned in the browser 457 // process. This ID is valid only in the context of the browser process and is 458 // used to identify the proper process when the renderer notifies it that the 459 // plugin is hung. 460 // 461 // |embedder_origin| provides the origin of the frame that embeds the plugin 462 // (i.e. the origin of the document that contains the <embed> html tag). 463 // |embedder_origin| needs to be included in the message payload, because the 464 // message is received and handled on the IO thread in the browser process 465 // (where it is not possible to consult 466 // RenderFrameHostImpl::GetLastCommittedOrigin). 467 // 468 // On error an empty string and null handles are returned. 469 IPC_SYNC_MESSAGE_CONTROL3_3(FrameHostMsg_OpenChannelToPepperPlugin, 470 url::Origin /* embedder_origin */, 471 base::FilePath /* path */, 472 base::Optional<url::Origin>, /* origin_lock */ 473 IPC::ChannelHandle /* handle to channel */, 474 base::ProcessId /* plugin_pid */, 475 int /* plugin_child_id */) 476 477 // Message from the renderer to the browser indicating the in-process instance 478 // has been created. 479 IPC_MESSAGE_CONTROL2(FrameHostMsg_DidCreateInProcessInstance, 480 int32_t /* instance */, 481 content::PepperRendererInstanceData /* instance_data */) 482 483 // Message from the renderer to the browser indicating the in-process instance 484 // has been destroyed. 485 IPC_MESSAGE_CONTROL1(FrameHostMsg_DidDeleteInProcessInstance, 486 int32_t /* instance */) 487 488 // Notification that a plugin has created a new plugin instance. The parameters 489 // indicate: 490 // - The plugin process ID that we're creating the instance for. 491 // - The instance ID of the instance being created. 492 // - A PepperRendererInstanceData struct which contains properties from the 493 // renderer which are associated with the plugin instance. This includes the 494 // routing ID of the associated RenderFrame and the URL of plugin. 495 // - Whether the plugin we're creating an instance for is external or internal. 496 // 497 // This message must be sync even though it returns no parameters to avoid 498 // a race condition with the plugin process. The plugin process sends messages 499 // to the browser that assume the browser knows about the instance. We need to 500 // make sure that the browser actually knows about the instance before we tell 501 // the plugin to run. 502 IPC_SYNC_MESSAGE_CONTROL4_0( 503 FrameHostMsg_DidCreateOutOfProcessPepperInstance, 504 int /* plugin_child_id */, 505 int32_t /* pp_instance */, 506 content::PepperRendererInstanceData /* creation_data */, 507 bool /* is_external */) 508 509 // Notification that a plugin has destroyed an instance. This is the opposite of 510 // the "DidCreate" message above. 511 IPC_MESSAGE_CONTROL3(FrameHostMsg_DidDeleteOutOfProcessPepperInstance, 512 int /* plugin_child_id */, 513 int32_t /* pp_instance */, 514 bool /* is_external */) 515 516 #endif // BUILDFLAG(ENABLE_PLUGINS) 517 518 // Indicates that the current frame has finished running its unload handler (if 519 // one was registered) and has been detached, as a response to 520 // UnfreezableFrameMsg_Unload message from the browser process. 521 IPC_MESSAGE_ROUTED0(FrameHostMsg_Unload_ACK) 522 523 // Tells the browser that a child's visual properties have changed. 524 IPC_MESSAGE_ROUTED1(FrameHostMsg_SynchronizeVisualProperties, 525 blink::FrameVisualProperties) 526 527 // Used to tell the parent that the user right clicked on an area of the 528 // content area, and a context menu should be shown for it. The params 529 // object contains information about the node(s) that were selected when the 530 // user right clicked. 531 IPC_MESSAGE_ROUTED1(FrameHostMsg_ContextMenu, 532 content::UntrustworthyContextMenuParams) 533 534 // Adding a new message? Stick to the sort order above: first platform 535 // independent FrameMsg, then ifdefs for platform specific FrameMsg, then 536 // platform independent FrameHostMsg, then ifdefs for platform specific 537 // FrameHostMsg. 538 539 #endif // CONTENT_COMMON_FRAME_MESSAGES_H_ 540