| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Multiply-included file, no traditional include guard. | 5 // Multiply-included file, no traditional include guard. |
| 6 #include <map> | 6 #include <map> |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #include "ipc/ipc_message_macros.h" | 47 #include "ipc/ipc_message_macros.h" |
| 48 #include "ipc/ipc_message_utils.h" | 48 #include "ipc/ipc_message_utils.h" |
| 49 #include "ipc/ipc_platform_file.h" // ifdefed typedef. | 49 #include "ipc/ipc_platform_file.h" // ifdefed typedef. |
| 50 #include "media/audio/audio_buffers_state.h" | 50 #include "media/audio/audio_buffers_state.h" |
| 51 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" | 51 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" |
| 52 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" | 52 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" |
| 53 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction.
h" | 53 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction.
h" |
| 54 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" | 54 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
| 55 #include "third_party/skia/include/core/SkBitmap.h" | 55 #include "third_party/skia/include/core/SkBitmap.h" |
| 56 #include "ui/gfx/rect.h" | 56 #include "ui/gfx/rect.h" |
| 57 #include "webkit/appcache/appcache_interfaces.h" // enum appcache::Status | |
| 58 #include "webkit/blob/blob_data.h" | 57 #include "webkit/blob/blob_data.h" |
| 59 #include "webkit/glue/context_menu.h" | 58 #include "webkit/glue/context_menu.h" |
| 60 #include "webkit/glue/webaccessibility.h" | 59 #include "webkit/glue/webaccessibility.h" |
| 61 #include "webkit/glue/webcookie.h" | 60 #include "webkit/glue/webcookie.h" |
| 62 #include "webkit/glue/webcursor.h" | 61 #include "webkit/glue/webcursor.h" |
| 63 #include "webkit/glue/webdropdata.h" | 62 #include "webkit/glue/webdropdata.h" |
| 64 #include "webkit/glue/webmenuitem.h" | 63 #include "webkit/glue/webmenuitem.h" |
| 65 #include "webkit/plugins/npapi/webplugin.h" | 64 #include "webkit/plugins/npapi/webplugin.h" |
| 66 #include "webkit/plugins/npapi/webplugininfo.h" | 65 #include "webkit/plugins/npapi/webplugininfo.h" |
| 67 | 66 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 return true; | 219 return true; |
| 221 } | 220 } |
| 222 | 221 |
| 223 static void Log(const param_type& p, std::string* l) { | 222 static void Log(const param_type& p, std::string* l) { |
| 224 l->append(base::StringPrintf("<gfx::NativeView>")); | 223 l->append(base::StringPrintf("<gfx::NativeView>")); |
| 225 } | 224 } |
| 226 }; | 225 }; |
| 227 | 226 |
| 228 #endif // defined(OS_POSIX) | 227 #endif // defined(OS_POSIX) |
| 229 | 228 |
| 230 template <> | |
| 231 struct ParamTraits<appcache::Status> { | |
| 232 typedef appcache::Status param_type; | |
| 233 static void Write(Message* m, const param_type& p) { | |
| 234 m->WriteInt(static_cast<int>(p)); | |
| 235 } | |
| 236 static bool Read(const Message* m, void** iter, param_type* p) { | |
| 237 int type; | |
| 238 if (!m->ReadInt(iter, &type)) | |
| 239 return false; | |
| 240 *p = static_cast<param_type>(type); | |
| 241 return true; | |
| 242 } | |
| 243 static void Log(const param_type& p, std::string* l) { | |
| 244 std::string state; | |
| 245 switch (p) { | |
| 246 case appcache::UNCACHED: | |
| 247 state = "UNCACHED"; | |
| 248 break; | |
| 249 case appcache::IDLE: | |
| 250 state = "IDLE"; | |
| 251 break; | |
| 252 case appcache::CHECKING: | |
| 253 state = "CHECKING"; | |
| 254 break; | |
| 255 case appcache::DOWNLOADING: | |
| 256 state = "DOWNLOADING"; | |
| 257 break; | |
| 258 case appcache::UPDATE_READY: | |
| 259 state = "UPDATE_READY"; | |
| 260 break; | |
| 261 case appcache::OBSOLETE: | |
| 262 state = "OBSOLETE"; | |
| 263 break; | |
| 264 default: | |
| 265 state = "InvalidStatusValue"; | |
| 266 break; | |
| 267 } | |
| 268 | |
| 269 LogParam(state, l); | |
| 270 } | |
| 271 }; | |
| 272 | |
| 273 template <> | |
| 274 struct ParamTraits<appcache::EventID> { | |
| 275 typedef appcache::EventID param_type; | |
| 276 static void Write(Message* m, const param_type& p) { | |
| 277 m->WriteInt(static_cast<int>(p)); | |
| 278 } | |
| 279 static bool Read(const Message* m, void** iter, param_type* p) { | |
| 280 int type; | |
| 281 if (!m->ReadInt(iter, &type)) | |
| 282 return false; | |
| 283 *p = static_cast<param_type>(type); | |
| 284 return true; | |
| 285 } | |
| 286 static void Log(const param_type& p, std::string* l) { | |
| 287 std::string state; | |
| 288 switch (p) { | |
| 289 case appcache::CHECKING_EVENT: | |
| 290 state = "CHECKING_EVENT"; | |
| 291 break; | |
| 292 case appcache::ERROR_EVENT: | |
| 293 state = "ERROR_EVENT"; | |
| 294 break; | |
| 295 case appcache::NO_UPDATE_EVENT: | |
| 296 state = "NO_UPDATE_EVENT"; | |
| 297 break; | |
| 298 case appcache::DOWNLOADING_EVENT: | |
| 299 state = "DOWNLOADING_EVENT"; | |
| 300 break; | |
| 301 case appcache::PROGRESS_EVENT: | |
| 302 state = "PROGRESS_EVENT"; | |
| 303 break; | |
| 304 case appcache::UPDATE_READY_EVENT: | |
| 305 state = "UPDATE_READY_EVENT"; | |
| 306 break; | |
| 307 case appcache::CACHED_EVENT: | |
| 308 state = "CACHED_EVENT"; | |
| 309 break; | |
| 310 case appcache::OBSOLETE_EVENT: | |
| 311 state = "OBSOLETE_EVENT"; | |
| 312 break; | |
| 313 default: | |
| 314 state = "InvalidEventValue"; | |
| 315 break; | |
| 316 } | |
| 317 | |
| 318 LogParam(state, l); | |
| 319 } | |
| 320 }; | |
| 321 | |
| 322 template<> | 229 template<> |
| 323 struct ParamTraits<WebMenuItem> { | 230 struct ParamTraits<WebMenuItem> { |
| 324 typedef WebMenuItem param_type; | 231 typedef WebMenuItem param_type; |
| 325 static void Write(Message* m, const param_type& p); | 232 static void Write(Message* m, const param_type& p); |
| 326 static bool Read(const Message* m, void** iter, param_type* p); | 233 static bool Read(const Message* m, void** iter, param_type* p); |
| 327 static void Log(const param_type& p, std::string* l); | 234 static void Log(const param_type& p, std::string* l); |
| 328 }; | 235 }; |
| 329 | 236 |
| 330 template <> | 237 template <> |
| 331 struct SimilarTypeTraits<ViewType::Type> { | 238 struct SimilarTypeTraits<ViewType::Type> { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 }; | 277 }; |
| 371 | 278 |
| 372 template <> | 279 template <> |
| 373 struct ParamTraits<ExtensionExtent> { | 280 struct ParamTraits<ExtensionExtent> { |
| 374 typedef ExtensionExtent param_type; | 281 typedef ExtensionExtent param_type; |
| 375 static void Write(Message* m, const param_type& p); | 282 static void Write(Message* m, const param_type& p); |
| 376 static bool Read(const Message* m, void** iter, param_type* p); | 283 static bool Read(const Message* m, void** iter, param_type* p); |
| 377 static void Log(const param_type& p, std::string* l); | 284 static void Log(const param_type& p, std::string* l); |
| 378 }; | 285 }; |
| 379 | 286 |
| 380 | |
| 381 template<> | |
| 382 struct ParamTraits<appcache::AppCacheResourceInfo> { | |
| 383 typedef appcache::AppCacheResourceInfo param_type; | |
| 384 static void Write(Message* m, const param_type& p); | |
| 385 static bool Read(const Message* m, void** iter, param_type* p); | |
| 386 static void Log(const param_type& p, std::string* l); | |
| 387 }; | |
| 388 | |
| 389 template <> | |
| 390 struct ParamTraits<appcache::AppCacheInfo> { | |
| 391 typedef appcache::AppCacheInfo param_type; | |
| 392 static void Write(Message* m, const param_type& p); | |
| 393 static bool Read(const Message* m, void** iter, param_type* p); | |
| 394 static void Log(const param_type& p, std::string* l); | |
| 395 }; | |
| 396 | |
| 397 template <> | 287 template <> |
| 398 struct ParamTraits<webkit_glue::WebAccessibility> { | 288 struct ParamTraits<webkit_glue::WebAccessibility> { |
| 399 typedef webkit_glue::WebAccessibility param_type; | 289 typedef webkit_glue::WebAccessibility param_type; |
| 400 static void Write(Message* m, const param_type& p); | 290 static void Write(Message* m, const param_type& p); |
| 401 static bool Read(const Message* m, void** iter, param_type* p); | 291 static bool Read(const Message* m, void** iter, param_type* p); |
| 402 static void Log(const param_type& p, std::string* l); | 292 static void Log(const param_type& p, std::string* l); |
| 403 }; | 293 }; |
| 404 | 294 |
| 405 template <> | 295 template <> |
| 406 struct ParamTraits<scoped_refptr<webkit_blob::BlobData> > { | 296 struct ParamTraits<scoped_refptr<webkit_blob::BlobData> > { |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 std::string /* The message */, | 843 std::string /* The message */, |
| 954 std::string /* The origin */, | 844 std::string /* The origin */, |
| 955 std::string /* The target*/) | 845 std::string /* The target*/) |
| 956 | 846 |
| 957 // Sent to the renderer when a popup window should no longer count against | 847 // Sent to the renderer when a popup window should no longer count against |
| 958 // the current popup count (either because it's not a popup or because it was | 848 // the current popup count (either because it's not a popup or because it was |
| 959 // a generated by a user action or because a constrained popup got turned | 849 // a generated by a user action or because a constrained popup got turned |
| 960 // into a full window). | 850 // into a full window). |
| 961 IPC_MESSAGE_ROUTED0(ViewMsg_DisassociateFromPopupCount) | 851 IPC_MESSAGE_ROUTED0(ViewMsg_DisassociateFromPopupCount) |
| 962 | 852 |
| 963 // Notifies the renderer of the appcache that has been selected for a | |
| 964 // a particular host. This is sent in reply to AppCacheMsg_SelectCache. | |
| 965 IPC_MESSAGE_CONTROL2(AppCacheMsg_CacheSelected, | |
| 966 int /* host_id */, | |
| 967 appcache::AppCacheInfo) | |
| 968 | |
| 969 // Notifies the renderer of an AppCache status change. | |
| 970 IPC_MESSAGE_CONTROL2(AppCacheMsg_StatusChanged, | |
| 971 std::vector<int> /* host_ids */, | |
| 972 appcache::Status) | |
| 973 | |
| 974 // Notifies the renderer of an AppCache event other than the | |
| 975 // progress event which has a seperate message. | |
| 976 IPC_MESSAGE_CONTROL2(AppCacheMsg_EventRaised, | |
| 977 std::vector<int> /* host_ids */, | |
| 978 appcache::EventID) | |
| 979 | |
| 980 // Notifies the renderer of an AppCache progress event. | |
| 981 IPC_MESSAGE_CONTROL4(AppCacheMsg_ProgressEventRaised, | |
| 982 std::vector<int> /* host_ids */, | |
| 983 GURL /* url being processed */, | |
| 984 int /* total */, | |
| 985 int /* complete */) | |
| 986 | |
| 987 // Notifies the renderer of an AppCache error event. | |
| 988 IPC_MESSAGE_CONTROL2(AppCacheMsg_ErrorEventRaised, | |
| 989 std::vector<int> /* host_ids */, | |
| 990 std::string /* error_message */) | |
| 991 | |
| 992 // Notifies the renderer of an AppCache logging message. | |
| 993 IPC_MESSAGE_CONTROL3(AppCacheMsg_LogMessage, | |
| 994 int /* host_id */, | |
| 995 int /* log_level */, | |
| 996 std::string /* message */) | |
| 997 | |
| 998 // Notifies the renderer of the fact that AppCache access was blocked. | |
| 999 IPC_MESSAGE_CONTROL2(AppCacheMsg_ContentBlocked, | |
| 1000 int /* host_id */, | |
| 1001 GURL /* manifest_url */) | |
| 1002 | |
| 1003 // Sent by the Browser process to alert a window about whether a it should | 853 // Sent by the Browser process to alert a window about whether a it should |
| 1004 // allow a scripted window.close(). The renderer assumes every new window is a | 854 // allow a scripted window.close(). The renderer assumes every new window is a |
| 1005 // blocked popup until notified otherwise. | 855 // blocked popup until notified otherwise. |
| 1006 IPC_MESSAGE_ROUTED1(ViewMsg_AllowScriptToClose, | 856 IPC_MESSAGE_ROUTED1(ViewMsg_AllowScriptToClose, |
| 1007 bool /* script_can_close */) | 857 bool /* script_can_close */) |
| 1008 | 858 |
| 1009 // Sent by AudioRendererHost to renderer to request an audio packet. | 859 // Sent by AudioRendererHost to renderer to request an audio packet. |
| 1010 IPC_MESSAGE_ROUTED2(ViewMsg_RequestAudioPacket, | 860 IPC_MESSAGE_ROUTED2(ViewMsg_RequestAudioPacket, |
| 1011 int /* stream id */, | 861 int /* stream id */, |
| 1012 AudioBuffersState) | 862 AudioBuffersState) |
| (...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2090 IPC_MESSAGE_CONTROL1(ViewHostMsg_SuddenTerminationChanged, | 1940 IPC_MESSAGE_CONTROL1(ViewHostMsg_SuddenTerminationChanged, |
| 2091 bool /* enabled */) | 1941 bool /* enabled */) |
| 2092 | 1942 |
| 2093 // Returns the window location of the window this widget is embeded. | 1943 // Returns the window location of the window this widget is embeded. |
| 2094 // TODO(shess): Provide a mapping from reply_msg->routing_id() to | 1944 // TODO(shess): Provide a mapping from reply_msg->routing_id() to |
| 2095 // HWND so that we can eliminate the NativeViewId parameter. | 1945 // HWND so that we can eliminate the NativeViewId parameter. |
| 2096 IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_GetRootWindowRect, | 1946 IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_GetRootWindowRect, |
| 2097 gfx::NativeViewId /* window */, | 1947 gfx::NativeViewId /* window */, |
| 2098 gfx::Rect /* Out: Window location */) | 1948 gfx::Rect /* Out: Window location */) |
| 2099 | 1949 |
| 2100 // Informs the browser of a new appcache host. | |
| 2101 IPC_MESSAGE_CONTROL1(AppCacheMsg_RegisterHost, | |
| 2102 int /* host_id */) | |
| 2103 | |
| 2104 // Informs the browser of an appcache host being destroyed. | |
| 2105 IPC_MESSAGE_CONTROL1(AppCacheMsg_UnregisterHost, | |
| 2106 int /* host_id */) | |
| 2107 | |
| 2108 // Initiates the cache selection algorithm for the given host. | |
| 2109 // This is sent prior to any subresource loads. An AppCacheMsg_CacheSelected | |
| 2110 // message will be sent in response. | |
| 2111 // 'host_id' indentifies a specific document or worker | |
| 2112 // 'document_url' the url of the main resource | |
| 2113 // 'appcache_document_was_loaded_from' the id of the appcache the main | |
| 2114 // resource was loaded from or kNoCacheId | |
| 2115 // 'opt_manifest_url' the manifest url specified in the <html> tag if any | |
| 2116 IPC_MESSAGE_CONTROL4(AppCacheMsg_SelectCache, | |
| 2117 int /* host_id */, | |
| 2118 GURL /* document_url */, | |
| 2119 int64 /* appcache_document_was_loaded_from */, | |
| 2120 GURL /* opt_manifest_url */) | |
| 2121 | |
| 2122 // Initiates worker specific cache selection algorithm for the given host. | |
| 2123 IPC_MESSAGE_CONTROL3(AppCacheMsg_SelectCacheForWorker, | |
| 2124 int /* host_id */, | |
| 2125 int /* parent_process_id */, | |
| 2126 int /* parent_host_id */) | |
| 2127 IPC_MESSAGE_CONTROL2(AppCacheMsg_SelectCacheForSharedWorker, | |
| 2128 int /* host_id */, | |
| 2129 int64 /* appcache_id */) | |
| 2130 | |
| 2131 // Informs the browser of a 'foreign' entry in an appcache. | |
| 2132 IPC_MESSAGE_CONTROL3(AppCacheMsg_MarkAsForeignEntry, | |
| 2133 int /* host_id */, | |
| 2134 GURL /* document_url */, | |
| 2135 int64 /* appcache_document_was_loaded_from */) | |
| 2136 | |
| 2137 // Returns the status of the appcache associated with host_id. | |
| 2138 IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheMsg_GetStatus, | |
| 2139 int /* host_id */, | |
| 2140 appcache::Status) | |
| 2141 | |
| 2142 // Initiates an update of the appcache associated with host_id. | |
| 2143 IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheMsg_StartUpdate, | |
| 2144 int /* host_id */, | |
| 2145 bool /* success */) | |
| 2146 | |
| 2147 // Swaps a new pending appcache, if there is one, into use for host_id. | |
| 2148 IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheMsg_SwapCache, | |
| 2149 int /* host_id */, | |
| 2150 bool /* success */) | |
| 2151 | |
| 2152 // Gets resource list from appcache synchronously. | |
| 2153 IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheMsg_GetResourceList, | |
| 2154 int /* host_id in*/, | |
| 2155 std::vector<appcache::AppCacheResourceInfo> | |
| 2156 /* resources out */) | |
| 2157 | |
| 2158 // Get the list of proxies to use for |url|, as a semicolon delimited list | 1950 // Get the list of proxies to use for |url|, as a semicolon delimited list |
| 2159 // of "<TYPE> <HOST>:<PORT>" | "DIRECT". See also | 1951 // of "<TYPE> <HOST>:<PORT>" | "DIRECT". See also |
| 2160 // PluginProcessHostMsg_ResolveProxy which does the same thing. | 1952 // PluginProcessHostMsg_ResolveProxy which does the same thing. |
| 2161 IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_ResolveProxy, | 1953 IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_ResolveProxy, |
| 2162 GURL /* url */, | 1954 GURL /* url */, |
| 2163 int /* network error */, | 1955 int /* network error */, |
| 2164 std::string /* proxy list */) | 1956 std::string /* proxy list */) |
| 2165 | 1957 |
| 2166 // Request that got sent to browser for creating an audio output stream | 1958 // Request that got sent to browser for creating an audio output stream |
| 2167 IPC_MESSAGE_ROUTED3(ViewHostMsg_CreateAudioStream, | 1959 IPC_MESSAGE_ROUTED3(ViewHostMsg_CreateAudioStream, |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2594 IPC_MESSAGE_ROUTED2(ViewMsg_JavaScriptStressTestControl, | 2386 IPC_MESSAGE_ROUTED2(ViewMsg_JavaScriptStressTestControl, |
| 2595 int /* cmd */, | 2387 int /* cmd */, |
| 2596 int /* param */) | 2388 int /* param */) |
| 2597 | 2389 |
| 2598 // Register a new handler for URL requests with the given scheme. | 2390 // Register a new handler for URL requests with the given scheme. |
| 2599 IPC_MESSAGE_ROUTED3(ViewHostMsg_RegisterProtocolHandler, | 2391 IPC_MESSAGE_ROUTED3(ViewHostMsg_RegisterProtocolHandler, |
| 2600 std::string /* scheme */, | 2392 std::string /* scheme */, |
| 2601 GURL /* url */, | 2393 GURL /* url */, |
| 2602 string16 /* title */) | 2394 string16 /* title */) |
| 2603 | 2395 |
| OLD | NEW |