[email protected] | 6c54e7e4 | 2011-03-02 20:52:34 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 4 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 5 | // Multiply-included file, no traditional include guard. |
| 6 | #include <map> |
| 7 | #include <set> |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 8 | #include <string> |
| 9 | #include <vector> |
| 10 | |
[email protected] | 7a4de7a6 | 2010-08-17 18:38:24 | [diff] [blame] | 11 | // TODO(erg): This list has been temporarily annotated by erg while doing work |
| 12 | // on which headers to pull out. |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 13 | #include "base/basictypes.h" |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 14 | #include "base/file_path.h" |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 15 | #include "base/process.h" |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 16 | #include "base/shared_memory.h" |
[email protected] | 4c79e3e | 2009-10-23 18:31:32 | [diff] [blame] | 17 | #include "base/string16.h" |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 18 | #include "base/values.h" |
| 19 | #include "build/build_config.h" |
[email protected] | 79d68c6 | 2011-04-15 21:07:03 | [diff] [blame] | 20 | #include "chrome/common/common_param_traits.h" |
[email protected] | 1c9c7fb | 2011-03-11 16:38:38 | [diff] [blame] | 21 | #include "chrome/common/instant_types.h" |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 22 | #include "chrome/common/nacl_types.h" |
[email protected] | c08e793 | 2011-03-29 04:08:14 | [diff] [blame] | 23 | #include "chrome/common/search_provider.h" |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 24 | #include "chrome/common/thumbnail_score.h" |
[email protected] | 152b8ba3 | 2010-03-29 19:40:16 | [diff] [blame] | 25 | #include "chrome/common/translate_errors.h" |
[email protected] | 7b291f9 | 2009-08-14 05:43:53 | [diff] [blame] | 26 | #include "chrome/common/view_types.h" |
[email protected] | db803aae | 2011-03-05 02:00:42 | [diff] [blame] | 27 | #include "content/common/common_param_traits.h" |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 28 | #include "ipc/ipc_message_macros.h" |
[email protected] | fffaf97 | 2011-03-24 01:34:35 | [diff] [blame] | 29 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" |
[email protected] | fffaf97 | 2011-03-24 01:34:35 | [diff] [blame] | 30 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 31 | #include "third_party/skia/include/core/SkBitmap.h" |
| 32 | #include "ui/gfx/rect.h" |
[email protected] | 7a4de7a6 | 2010-08-17 18:38:24 | [diff] [blame] | 33 | |
[email protected] | 44c49c9 | 2011-03-28 16:17:23 | [diff] [blame] | 34 | // Singly-included section for enums and custom IPC traits. |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 35 | #ifndef CHROME_COMMON_RENDER_MESSAGES_H_ |
| 36 | #define CHROME_COMMON_RENDER_MESSAGES_H_ |
[email protected] | 049eec2 | 2010-10-20 21:32:52 | [diff] [blame] | 37 | |
[email protected] | a6097f4 | 2011-01-10 08:50:51 | [diff] [blame] | 38 | // Command values for the cmd parameter of the |
| 39 | // ViewHost_JavaScriptStressTestControl message. For each command the parameter |
| 40 | // passed has a different meaning: |
| 41 | // For the command kJavaScriptStressTestSetStressRunType the parameter it the |
| 42 | // type taken from the enumeration v8::Testing::StressType. |
| 43 | // For the command kJavaScriptStressTestPrepareStressRun the parameter it the |
| 44 | // number of the stress run about to take place. |
| 45 | enum ViewHostMsg_JavaScriptStressTestControl_Commands { |
| 46 | kJavaScriptStressTestSetStressRunType = 0, |
| 47 | kJavaScriptStressTestPrepareStressRun = 1, |
| 48 | }; |
| 49 | |
[email protected] | 7d5c3ac | 2009-02-04 08:58:19 | [diff] [blame] | 50 | namespace IPC { |
| 51 | |
[email protected] | 661eb9d | 2009-02-03 02:11:48 | [diff] [blame] | 52 | #if defined(OS_POSIX) |
| 53 | |
| 54 | // TODO(port): this shouldn't exist. However, the plugin stuff is really using |
| 55 | // HWNDS (NativeView), and making Windows calls based on them. I've not figured |
| 56 | // out the deal with plugins yet. |
| 57 | template <> |
| 58 | struct ParamTraits<gfx::NativeView> { |
| 59 | typedef gfx::NativeView param_type; |
[email protected] | 7d5c3ac | 2009-02-04 08:58:19 | [diff] [blame] | 60 | static void Write(Message* m, const param_type& p) { |
[email protected] | 661eb9d | 2009-02-03 02:11:48 | [diff] [blame] | 61 | NOTIMPLEMENTED(); |
| 62 | } |
| 63 | |
[email protected] | 7d5c3ac | 2009-02-04 08:58:19 | [diff] [blame] | 64 | static bool Read(const Message* m, void** iter, param_type* p) { |
[email protected] | 661eb9d | 2009-02-03 02:11:48 | [diff] [blame] | 65 | NOTIMPLEMENTED(); |
| 66 | *p = NULL; |
| 67 | return true; |
| 68 | } |
| 69 | |
[email protected] | 252cad6 | 2010-08-18 18:33:57 | [diff] [blame] | 70 | static void Log(const param_type& p, std::string* l) { |
[email protected] | 93f1052 | 2010-10-31 16:27:48 | [diff] [blame] | 71 | l->append(base::StringPrintf("<gfx::NativeView>")); |
[email protected] | 661eb9d | 2009-02-03 02:11:48 | [diff] [blame] | 72 | } |
| 73 | }; |
| 74 | |
| 75 | #endif // defined(OS_POSIX) |
| 76 | |
[email protected] | 7b291f9 | 2009-08-14 05:43:53 | [diff] [blame] | 77 | template <> |
[email protected] | fffaf97 | 2011-03-24 01:34:35 | [diff] [blame] | 78 | struct ParamTraits<ContentSettings> { |
| 79 | typedef ContentSettings param_type; |
| 80 | static void Write(Message* m, const param_type& p); |
| 81 | static bool Read(const Message* m, void** iter, param_type* r); |
| 82 | static void Log(const param_type& p, std::string* l); |
[email protected] | 7b291f9 | 2009-08-14 05:43:53 | [diff] [blame] | 83 | }; |
[email protected] | 1b9af29 | 2009-07-09 04:30:30 | [diff] [blame] | 84 | |
[email protected] | b3df5a4 | 2010-05-11 14:31:09 | [diff] [blame] | 85 | } // namespace IPC |
[email protected] | 9f4db51 | 2010-05-10 20:21:41 | [diff] [blame] | 86 | |
[email protected] | 5a52f16 | 2008-08-27 04:15:31 | [diff] [blame] | 87 | #endif // CHROME_COMMON_RENDER_MESSAGES_H_ |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 88 | |
[email protected] | 778574e | 2011-03-21 22:03:50 | [diff] [blame] | 89 | #define IPC_MESSAGE_START ChromeMsgStart |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 90 | |
[email protected] | fffaf97 | 2011-03-24 01:34:35 | [diff] [blame] | 91 | IPC_ENUM_TRAITS(InstantCompleteBehavior) |
[email protected] | c08e793 | 2011-03-29 04:08:14 | [diff] [blame] | 92 | IPC_ENUM_TRAITS(search_provider::OSDDType) |
| 93 | IPC_ENUM_TRAITS(search_provider::InstallState) |
[email protected] | fffaf97 | 2011-03-24 01:34:35 | [diff] [blame] | 94 | IPC_ENUM_TRAITS(TranslateErrors::Type) |
| 95 | IPC_ENUM_TRAITS(ViewType::Type) |
| 96 | IPC_ENUM_TRAITS(WebKit::WebConsoleMessage::Level) |
[email protected] | fffaf97 | 2011-03-24 01:34:35 | [diff] [blame] | 97 | |
| 98 | IPC_STRUCT_TRAITS_BEGIN(ThumbnailScore) |
| 99 | IPC_STRUCT_TRAITS_MEMBER(boring_score) |
| 100 | IPC_STRUCT_TRAITS_MEMBER(good_clipping) |
| 101 | IPC_STRUCT_TRAITS_MEMBER(at_top) |
| 102 | IPC_STRUCT_TRAITS_MEMBER(time_at_snapshot) |
| 103 | IPC_STRUCT_TRAITS_END() |
| 104 | |
[email protected] | fffaf97 | 2011-03-24 01:34:35 | [diff] [blame] | 105 | IPC_STRUCT_TRAITS_BEGIN(WebKit::WebCache::ResourceTypeStat) |
| 106 | IPC_STRUCT_TRAITS_MEMBER(count) |
| 107 | IPC_STRUCT_TRAITS_MEMBER(size) |
| 108 | IPC_STRUCT_TRAITS_MEMBER(liveSize) |
| 109 | IPC_STRUCT_TRAITS_MEMBER(decodedSize) |
| 110 | IPC_STRUCT_TRAITS_END() |
| 111 | |
| 112 | IPC_STRUCT_TRAITS_BEGIN(WebKit::WebCache::ResourceTypeStats) |
| 113 | IPC_STRUCT_TRAITS_MEMBER(images) |
| 114 | IPC_STRUCT_TRAITS_MEMBER(cssStyleSheets) |
| 115 | IPC_STRUCT_TRAITS_MEMBER(scripts) |
| 116 | IPC_STRUCT_TRAITS_MEMBER(xslStyleSheets) |
| 117 | IPC_STRUCT_TRAITS_MEMBER(fonts) |
| 118 | IPC_STRUCT_TRAITS_END() |
| 119 | |
| 120 | IPC_STRUCT_TRAITS_BEGIN(WebKit::WebCache::UsageStats) |
| 121 | IPC_STRUCT_TRAITS_MEMBER(minDeadCapacity) |
| 122 | IPC_STRUCT_TRAITS_MEMBER(maxDeadCapacity) |
| 123 | IPC_STRUCT_TRAITS_MEMBER(capacity) |
| 124 | IPC_STRUCT_TRAITS_MEMBER(liveSize) |
| 125 | IPC_STRUCT_TRAITS_MEMBER(deadSize) |
| 126 | IPC_STRUCT_TRAITS_END() |
| 127 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 128 | //----------------------------------------------------------------------------- |
| 129 | // RenderView messages |
| 130 | // These are messages sent from the browser to the renderer process. |
| 131 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 132 | // Tells the renderer to set its maximum cache size to the supplied value. |
| 133 | IPC_MESSAGE_CONTROL3(ViewMsg_SetCacheCapacities, |
| 134 | size_t /* min_dead_capacity */, |
| 135 | size_t /* max_dead_capacity */, |
| 136 | size_t /* capacity */) |
| 137 | |
| 138 | // Tells the renderer to clear the cache. |
| 139 | IPC_MESSAGE_CONTROL0(ViewMsg_ClearCache) |
| 140 | |
[email protected] | 5572215 | 2011-03-22 01:33:53 | [diff] [blame] | 141 | // Tells the renderer to dump as much memory as it can, perhaps because we |
| 142 | // have memory pressure or the renderer is (or will be) paged out. This |
| 143 | // should only result in purging objects we can recalculate, e.g. caches or |
| 144 | // JS garbage, not in purging irreplaceable objects. |
| 145 | IPC_MESSAGE_CONTROL0(ViewMsg_PurgeMemory) |
| 146 | |
| 147 | // Tells the render view to capture a thumbnail image of the page. The |
| 148 | // render view responds with a ViewHostMsg_Snapshot. |
| 149 | IPC_MESSAGE_ROUTED0(ViewMsg_CaptureSnapshot) |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 150 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 151 | // History system notification that the visited link database has been |
| 152 | // replaced. It has one SharedMemoryHandle argument consisting of the table |
| 153 | // handle. This handle is valid in the context of the renderer |
| 154 | IPC_MESSAGE_CONTROL1(ViewMsg_VisitedLink_NewTable, base::SharedMemoryHandle) |
| 155 | |
| 156 | // History system notification that a link has been added and the link |
| 157 | // coloring state for the given hash must be re-calculated. |
| 158 | IPC_MESSAGE_CONTROL1(ViewMsg_VisitedLink_Add, std::vector<uint64>) |
| 159 | |
| 160 | // History system notification that one or more history items have been |
| 161 | // deleted, which at this point means that all link coloring state must be |
| 162 | // re-calculated. |
| 163 | IPC_MESSAGE_CONTROL0(ViewMsg_VisitedLink_Reset) |
| 164 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 165 | // Set the content settings for a particular url that the renderer is in the |
| 166 | // process of loading. This will be stored, to be used if the load commits |
| 167 | // and ignored otherwise. |
| 168 | IPC_MESSAGE_ROUTED2(ViewMsg_SetContentSettingsForLoadingURL, |
| 169 | GURL /* url */, |
| 170 | ContentSettings /* content_settings */) |
| 171 | |
| 172 | // Set the content settings for a particular url, so all render views |
| 173 | // displaying this host url update their content settings to match. |
| 174 | IPC_MESSAGE_CONTROL2(ViewMsg_SetContentSettingsForCurrentURL, |
| 175 | GURL /* url */, |
| 176 | ContentSettings /* content_settings */) |
| 177 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 178 | // Tells the render view to load all blocked plugins. |
| 179 | IPC_MESSAGE_ROUTED0(ViewMsg_LoadBlockedPlugins) |
| 180 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 181 | // Used to instruct the RenderView to go into "view source" mode. |
| 182 | IPC_MESSAGE_ROUTED0(ViewMsg_EnableViewSourceMode) |
| 183 | |
| 184 | // Get all savable resource links from current webpage, include main |
| 185 | // frame and sub-frame. |
| 186 | IPC_MESSAGE_ROUTED1(ViewMsg_GetAllSavableResourceLinksForCurrentPage, |
| 187 | GURL /* url of page which is needed to save */) |
| 188 | |
| 189 | // Get html data by serializing all frames of current page with lists |
| 190 | // which contain all resource links that have local copy. |
| 191 | IPC_MESSAGE_ROUTED3(ViewMsg_GetSerializedHtmlDataForCurrentPageWithLocalLinks, |
| 192 | std::vector<GURL> /* urls that have local copy */, |
| 193 | std::vector<FilePath> /* paths of local copy */, |
| 194 | FilePath /* local directory path */) |
| 195 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 196 | // Asks the renderer to send back stats on the WebCore cache broken down by |
| 197 | // resource types. |
| 198 | IPC_MESSAGE_CONTROL0(ViewMsg_GetCacheResourceStats) |
| 199 | |
| 200 | // Asks the renderer to send back Histograms. |
| 201 | IPC_MESSAGE_CONTROL1(ViewMsg_GetRendererHistograms, |
| 202 | int /* sequence number of Renderer Histograms. */) |
| 203 | |
[email protected] | 63a8ba1 | 2011-04-29 05:42:22 | [diff] [blame] | 204 | // Tells the renderer to create a FieldTrial, and by using a 100% probability |
| 205 | // for the FieldTrial, forces the FieldTrial to have assigned group name. |
| 206 | IPC_MESSAGE_CONTROL2(ViewMsg_SetFieldTrialGroup, |
| 207 | std::string /* field trial name */, |
| 208 | std::string /* group name that was assigned. */) |
| 209 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 210 | #if defined(USE_TCMALLOC) |
| 211 | // Asks the renderer to send back tcmalloc stats. |
| 212 | IPC_MESSAGE_CONTROL0(ViewMsg_GetRendererTcmalloc) |
| 213 | #endif |
| 214 | |
| 215 | // Asks the renderer to send back V8 heap stats. |
| 216 | IPC_MESSAGE_CONTROL0(ViewMsg_GetV8HeapStats) |
| 217 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 218 | // Posts a message to the renderer. |
| 219 | IPC_MESSAGE_ROUTED3(ViewMsg_HandleMessageFromExternalHost, |
| 220 | std::string /* The message */, |
| 221 | std::string /* The origin */, |
| 222 | std::string /* The target*/) |
| 223 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 224 | IPC_MESSAGE_ROUTED4(ViewMsg_SearchBoxChange, |
| 225 | string16 /* value */, |
| 226 | bool /* verbatim */, |
| 227 | int /* selection_start */, |
| 228 | int /* selection_end */) |
| 229 | IPC_MESSAGE_ROUTED2(ViewMsg_SearchBoxSubmit, |
| 230 | string16 /* value */, |
| 231 | bool /* verbatim */) |
| 232 | IPC_MESSAGE_ROUTED0(ViewMsg_SearchBoxCancel) |
| 233 | IPC_MESSAGE_ROUTED1(ViewMsg_SearchBoxResize, |
| 234 | gfx::Rect /* search_box_bounds */) |
| 235 | IPC_MESSAGE_ROUTED4(ViewMsg_DetermineIfPageSupportsInstant, |
| 236 | string16 /* value*/, |
| 237 | bool /* verbatim */, |
| 238 | int /* selection_start */, |
| 239 | int /* selection_end */) |
| 240 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 241 | // Tell the renderer which browser window it's being attached to. |
| 242 | IPC_MESSAGE_ROUTED1(ViewMsg_UpdateBrowserWindowId, |
| 243 | int /* id of browser window */) |
| 244 | |
| 245 | // Tell the renderer which type this view is. |
| 246 | IPC_MESSAGE_ROUTED1(ViewMsg_NotifyRenderViewType, |
| 247 | ViewType::Type /* view_type */) |
| 248 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 249 | // Tells the renderer to translate the page contents from one language to |
| 250 | // another. |
| 251 | IPC_MESSAGE_ROUTED4(ViewMsg_TranslatePage, |
| 252 | int /* page id */, |
| 253 | std::string, /* the script injected in the page */ |
| 254 | std::string, /* BCP 47/RFC 5646 language code the page |
| 255 | is in */ |
| 256 | std::string /* BCP 47/RFC 5646 language code to translate |
| 257 | to */) |
| 258 | |
| 259 | // Tells the renderer to revert the text of translated page to its original |
| 260 | // contents. |
| 261 | IPC_MESSAGE_ROUTED1(ViewMsg_RevertTranslation, |
| 262 | int /* page id */) |
| 263 | |
[email protected] | 16e923d | 2011-04-30 00:41:44 | [diff] [blame] | 264 | // Tells a renderer if it's currently being prerendered. Must only be set |
| 265 | // to true before any navigation occurs, and only set to false at most once |
| 266 | // after that. |
| 267 | IPC_MESSAGE_ROUTED1(ViewMsg_SetIsPrerendering, |
| 268 | bool /* whether the RenderView is prerendering */) |
| 269 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 270 | // Sent on process startup to indicate whether this process is running in |
| 271 | // incognito mode. |
| 272 | IPC_MESSAGE_CONTROL1(ViewMsg_SetIsIncognitoProcess, |
| 273 | bool /* is_incognito_processs */) |
| 274 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 275 | //----------------------------------------------------------------------------- |
| 276 | // TabContents messages |
| 277 | // These are messages sent from the renderer to the browser process. |
| 278 | |
[email protected] | 93b9d69 | 2011-04-13 00:44:31 | [diff] [blame] | 279 | // Provides the contents for the given page that was loaded recently. |
| 280 | IPC_MESSAGE_ROUTED3(ViewHostMsg_PageContents, |
| 281 | GURL /* URL of the page */, |
| 282 | int32 /* page id */, |
| 283 | string16 /* page contents */) |
| 284 | |
| 285 | // Notification that the language for the tab has been determined. |
| 286 | IPC_MESSAGE_ROUTED2(ViewHostMsg_TranslateLanguageDetermined, |
| 287 | std::string /* page ISO639_1 language code */, |
| 288 | bool /* whether the page can be translated */) |
| 289 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 290 | IPC_MESSAGE_CONTROL1(ViewHostMsg_UpdatedCacheStats, |
| 291 | WebKit::WebCache::UsageStats /* stats */) |
| 292 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 293 | // Tells the browser that content in the current page was blocked due to the |
| 294 | // user's content settings. |
| 295 | IPC_MESSAGE_ROUTED2(ViewHostMsg_ContentBlocked, |
| 296 | ContentSettingsType, /* type of blocked content */ |
| 297 | std::string /* resource identifier */) |
| 298 | |
[email protected] | 5327dfb | 2011-05-03 17:50:36 | [diff] [blame^] | 299 | // Sent by the renderer process to check whether access to web databases is |
| 300 | // granted by content settings. This may block and trigger a cookie prompt. |
| 301 | IPC_SYNC_MESSAGE_ROUTED4_1(ViewHostMsg_AllowDatabase, |
| 302 | std::string /* origin_url */, |
| 303 | string16 /* database name */, |
| 304 | string16 /* database display name */, |
| 305 | unsigned long /* estimated size */, |
| 306 | bool /* result */) |
| 307 | |
| 308 | // Tells the browser that a specific Web database in the current page was |
| 309 | // accessed. |
| 310 | IPC_MESSAGE_ROUTED5(ViewHostMsg_WebDatabaseAccessed, |
| 311 | GURL /* origin url */, |
| 312 | string16 /* database name */, |
| 313 | string16 /* database display name */, |
| 314 | unsigned long /* estimated size */, |
| 315 | bool /* blocked by policy */) |
| 316 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 317 | // Specifies the URL as the first parameter (a wstring) and thumbnail as |
| 318 | // binary data as the second parameter. |
| 319 | IPC_MESSAGE_ROUTED3(ViewHostMsg_Thumbnail, |
| 320 | GURL /* url */, |
| 321 | ThumbnailScore /* score */, |
| 322 | SkBitmap /* bitmap */) |
| 323 | |
| 324 | // Send a snapshot of the tab contents to the render host. |
| 325 | IPC_MESSAGE_ROUTED1(ViewHostMsg_Snapshot, |
| 326 | SkBitmap /* bitmap */) |
| 327 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 328 | // Following message is used to communicate the values received by the |
| 329 | // callback binding the JS to Cpp. |
| 330 | // An instance of browser that has an automation host listening to it can |
| 331 | // have a javascript send a native value (string, number, boolean) to the |
| 332 | // listener in Cpp. (DomAutomationController) |
| 333 | IPC_MESSAGE_ROUTED2(ViewHostMsg_DomOperationResponse, |
| 334 | std::string /* json_string */, |
| 335 | int /* automation_id */) |
| 336 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 337 | // A message for an external host. |
| 338 | IPC_MESSAGE_ROUTED3(ViewHostMsg_ForwardMessageToExternalHost, |
| 339 | std::string /* message */, |
| 340 | std::string /* origin */, |
| 341 | std::string /* target */) |
| 342 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 343 | // A renderer sends this to the browser process when it wants to start |
| 344 | // a new instance of the Native Client process. The browser will launch |
| 345 | // the process and return a handle to an IMC channel. |
| 346 | IPC_SYNC_MESSAGE_CONTROL2_3(ViewHostMsg_LaunchNaCl, |
| 347 | std::wstring /* url for the NaCl module */, |
| 348 | int /* socket count */, |
| 349 | std::vector<nacl::FileDescriptor> |
| 350 | /* imc channel handles */, |
| 351 | base::ProcessHandle /* NaCl process handle */, |
| 352 | base::ProcessId /* NaCl process id */) |
| 353 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 354 | // Notification that the page has an OpenSearch description document |
| 355 | // associated with it. |
| 356 | IPC_MESSAGE_ROUTED3(ViewHostMsg_PageHasOSDD, |
| 357 | int32 /* page_id */, |
| 358 | GURL /* url of OS description document */, |
[email protected] | c08e793 | 2011-03-29 04:08:14 | [diff] [blame] | 359 | search_provider::OSDDType) |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 360 | |
| 361 | // Find out if the given url's security origin is installed as a search |
| 362 | // provider. |
[email protected] | c08e793 | 2011-03-29 04:08:14 | [diff] [blame] | 363 | IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_GetSearchProviderInstallState, |
| 364 | GURL /* page url */, |
| 365 | GURL /* inquiry url */, |
| 366 | search_provider::InstallState /* install */) |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 367 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 368 | // Send back histograms as vector of pickled-histogram strings. |
| 369 | IPC_MESSAGE_CONTROL2(ViewHostMsg_RendererHistograms, |
| 370 | int, /* sequence number of Renderer Histograms. */ |
| 371 | std::vector<std::string>) |
| 372 | |
| 373 | #if defined USE_TCMALLOC |
| 374 | // Send back tcmalloc stats output. |
| 375 | IPC_MESSAGE_CONTROL2(ViewHostMsg_RendererTcmalloc, |
| 376 | int /* pid */, |
| 377 | std::string /* tcmalloc debug output */) |
| 378 | #endif |
| 379 | |
| 380 | // Sends back stats about the V8 heap. |
| 381 | IPC_MESSAGE_CONTROL2(ViewHostMsg_V8HeapStats, |
| 382 | int /* size of heap (allocated from the OS) */, |
| 383 | int /* bytes in use */) |
| 384 | |
| 385 | // Request for a DNS prefetch of the names in the array. |
| 386 | // NameList is typedef'ed std::vector<std::string> |
| 387 | IPC_MESSAGE_CONTROL1(ViewHostMsg_DnsPrefetch, |
[email protected] | 2bf2bd9 | 2011-03-31 07:12:44 | [diff] [blame] | 388 | std::vector<std::string> /* hostnames */) |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 389 | |
[email protected] | f72a12c | 2011-04-29 11:52:30 | [diff] [blame] | 390 | // Requests the plugin policies. |
| 391 | // |
| 392 | // |outdated_policy| determines what to do about outdated plugins. |
| 393 | // |authorize_policy| determines what to do about plugins that require |
| 394 | // authorization to run. |
| 395 | // |
| 396 | // Both values can be ALLOW or ASK. |outdated_policy| can also be BLOCK. |
| 397 | // Anything else is an error. |
| 398 | // ALLOW means that the plugin should just run, as a normal plugin. |
| 399 | // BLOCK means that the plugin should not run nor be allowed to run at all. |
| 400 | // ASK means that the plugin should be initially blocked and the user should |
| 401 | // be asked whether he wants to run the plugin. |
| 402 | IPC_SYNC_MESSAGE_ROUTED0_2(ViewHostMsg_GetPluginPolicies, |
| 403 | ContentSetting /* outdated_policy */, |
| 404 | ContentSetting /* authorize_policy */) |
[email protected] | 2bf2bd9 | 2011-03-31 07:12:44 | [diff] [blame] | 405 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 406 | // Notifies when a plugin couldn't be loaded because it's outdated. |
| 407 | IPC_MESSAGE_ROUTED2(ViewHostMsg_BlockedOutdatedPlugin, |
| 408 | string16, /* name */ |
| 409 | GURL /* update_url */) |
| 410 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 411 | IPC_MESSAGE_ROUTED3(ViewHostMsg_SendCurrentPageAllSavableResourceLinks, |
| 412 | std::vector<GURL> /* all savable resource links */, |
| 413 | std::vector<GURL> /* all referrers of resource links */, |
| 414 | std::vector<GURL> /* all frame links */) |
| 415 | |
| 416 | IPC_MESSAGE_ROUTED3(ViewHostMsg_SendSerializedHtmlData, |
| 417 | GURL /* frame's url */, |
| 418 | std::string /* data buffer */, |
| 419 | int32 /* complete status */) |
| 420 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 421 | // Provide the browser process with information about the WebCore resource |
| 422 | // cache. |
| 423 | IPC_MESSAGE_CONTROL1(ViewHostMsg_ResourceTypeStats, |
| 424 | WebKit::WebCache::ResourceTypeStats) |
| 425 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 426 | |
| 427 | // Notifies the browser of the language (ISO 639_1 code language, such as fr, |
| 428 | // en, zh...) of the current page. |
| 429 | IPC_MESSAGE_ROUTED1(ViewHostMsg_PageLanguageDetermined, |
| 430 | std::string /* the language */) |
| 431 | |
| 432 | // Notifies the browser that a page has been translated. |
| 433 | IPC_MESSAGE_ROUTED4(ViewHostMsg_PageTranslated, |
| 434 | int, /* page id */ |
| 435 | std::string /* the original language */, |
| 436 | std::string /* the translated language */, |
| 437 | TranslateErrors::Type /* the error type if available */) |
| 438 | |
[email protected] | 16e923d | 2011-04-30 00:41:44 | [diff] [blame] | 439 | // Message sent from the renderer to the browser to notify it of events which |
| 440 | // may lead to the cancellation of a prerender. The message is sent only when |
| 441 | // the renderer is prerendering. |
| 442 | IPC_MESSAGE_ROUTED0(ViewHostMsg_MaybeCancelPrerenderForHTML5Media) |
| 443 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 444 | // Suggest results ----------------------------------------------------------- |
| 445 | |
| 446 | IPC_MESSAGE_ROUTED3(ViewHostMsg_SetSuggestions, |
| 447 | int32 /* page_id */, |
| 448 | std::vector<std::string> /* suggestions */, |
| 449 | InstantCompleteBehavior) |
| 450 | |
| 451 | IPC_MESSAGE_ROUTED2(ViewHostMsg_InstantSupportDetermined, |
| 452 | int32 /* page_id */, |
| 453 | bool /* result */) |
| 454 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 455 | // JavaScript related messages ----------------------------------------------- |
| 456 | |
| 457 | // Notify the JavaScript engine in the render to change its parameters |
| 458 | // while performing stress testing. |
| 459 | IPC_MESSAGE_ROUTED2(ViewMsg_JavaScriptStressTestControl, |
| 460 | int /* cmd */, |
| 461 | int /* param */) |