Chromium Code Reviews| 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 13 matching lines...) Expand all Loading... | |
| 24 #include "chrome/common/search_provider.h" | 24 #include "chrome/common/search_provider.h" |
| 25 #include "chrome/common/thumbnail_score.h" | 25 #include "chrome/common/thumbnail_score.h" |
| 26 #include "chrome/common/translate_errors.h" | 26 #include "chrome/common/translate_errors.h" |
| 27 #include "content/common/common_param_traits.h" | 27 #include "content/common/common_param_traits.h" |
| 28 #include "ipc/ipc_message_macros.h" | 28 #include "ipc/ipc_message_macros.h" |
| 29 #include "ipc/ipc_platform_file.h" | 29 #include "ipc/ipc_platform_file.h" |
| 30 #include "third_party/skia/include/core/SkBitmap.h" | 30 #include "third_party/skia/include/core/SkBitmap.h" |
| 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" |
| 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" | 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" |
| 33 #include "ui/gfx/rect.h" | 33 #include "ui/gfx/rect.h" |
| 34 #include "webkit/plugins/webplugininfo.h" | |
| 34 | 35 |
| 35 // Singly-included section for enums and custom IPC traits. | 36 // Singly-included section for enums and custom IPC traits. |
| 36 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_ | 37 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_ |
| 37 #define CHROME_COMMON_RENDER_MESSAGES_H_ | 38 #define CHROME_COMMON_RENDER_MESSAGES_H_ |
| 38 | 39 |
| 39 class SkBitmap; | 40 class SkBitmap; |
| 40 | 41 |
| 41 // Command values for the cmd parameter of the | 42 // Command values for the cmd parameter of the |
| 42 // ViewHost_JavaScriptStressTestControl message. For each command the parameter | 43 // ViewHost_JavaScriptStressTestControl message. For each command the parameter |
| 43 // passed has a different meaning: | 44 // passed has a different meaning: |
| 44 // For the command kJavaScriptStressTestSetStressRunType the parameter it the | 45 // For the command kJavaScriptStressTestSetStressRunType the parameter it the |
| 45 // type taken from the enumeration v8::Testing::StressType. | 46 // type taken from the enumeration v8::Testing::StressType. |
| 46 // For the command kJavaScriptStressTestPrepareStressRun the parameter it the | 47 // For the command kJavaScriptStressTestPrepareStressRun the parameter it the |
| 47 // number of the stress run about to take place. | 48 // number of the stress run about to take place. |
| 48 enum ViewHostMsg_JavaScriptStressTestControl_Commands { | 49 enum ViewHostMsg_JavaScriptStressTestControl_Commands { |
| 49 kJavaScriptStressTestSetStressRunType = 0, | 50 kJavaScriptStressTestSetStressRunType = 0, |
| 50 kJavaScriptStressTestPrepareStressRun = 1, | 51 kJavaScriptStressTestPrepareStressRun = 1, |
| 51 }; | 52 }; |
| 52 | 53 |
| 54 struct ChromeViewHostMsg_GetPluginInfo_Status { | |
| 55 // TODO(bauerb): Add more status values (blocked, click-to-play, out of date, | |
| 56 // requires authorization). | |
| 57 enum Value { | |
| 58 kAllowed, | |
| 59 kDisabled, | |
| 60 kNotFound, | |
| 61 }; | |
| 62 }; | |
| 63 | |
| 53 namespace IPC { | 64 namespace IPC { |
| 54 | 65 |
| 55 #if defined(OS_POSIX) && !defined(USE_AURA) | 66 #if defined(OS_POSIX) && !defined(USE_AURA) |
| 56 | 67 |
| 57 // TODO(port): this shouldn't exist. However, the plugin stuff is really using | 68 // TODO(port): this shouldn't exist. However, the plugin stuff is really using |
| 58 // HWNDS (NativeView), and making Windows calls based on them. I've not figured | 69 // HWNDS (NativeView), and making Windows calls based on them. I've not figured |
| 59 // out the deal with plugins yet. | 70 // out the deal with plugins yet. |
| 60 template <> | 71 template <> |
| 61 struct ParamTraits<gfx::NativeView> { | 72 struct ParamTraits<gfx::NativeView> { |
| 62 typedef gfx::NativeView param_type; | 73 typedef gfx::NativeView param_type; |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 84 static bool Read(const Message* m, void** iter, param_type* r); | 95 static bool Read(const Message* m, void** iter, param_type* r); |
| 85 static void Log(const param_type& p, std::string* l); | 96 static void Log(const param_type& p, std::string* l); |
| 86 }; | 97 }; |
| 87 | 98 |
| 88 } // namespace IPC | 99 } // namespace IPC |
| 89 | 100 |
| 90 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ | 101 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ |
| 91 | 102 |
| 92 #define IPC_MESSAGE_START ChromeMsgStart | 103 #define IPC_MESSAGE_START ChromeMsgStart |
| 93 | 104 |
| 105 IPC_ENUM_TRAITS(ChromeViewHostMsg_GetPluginInfo_Status::Value) | |
| 94 IPC_ENUM_TRAITS(InstantCompleteBehavior) | 106 IPC_ENUM_TRAITS(InstantCompleteBehavior) |
| 95 IPC_ENUM_TRAITS(search_provider::OSDDType) | 107 IPC_ENUM_TRAITS(search_provider::OSDDType) |
| 96 IPC_ENUM_TRAITS(search_provider::InstallState) | 108 IPC_ENUM_TRAITS(search_provider::InstallState) |
| 97 IPC_ENUM_TRAITS(TranslateErrors::Type) | 109 IPC_ENUM_TRAITS(TranslateErrors::Type) |
| 98 IPC_ENUM_TRAITS(WebKit::WebConsoleMessage::Level) | 110 IPC_ENUM_TRAITS(WebKit::WebConsoleMessage::Level) |
| 99 | 111 |
| 100 IPC_STRUCT_TRAITS_BEGIN(ThumbnailScore) | 112 IPC_STRUCT_TRAITS_BEGIN(ThumbnailScore) |
| 101 IPC_STRUCT_TRAITS_MEMBER(boring_score) | 113 IPC_STRUCT_TRAITS_MEMBER(boring_score) |
| 102 IPC_STRUCT_TRAITS_MEMBER(good_clipping) | 114 IPC_STRUCT_TRAITS_MEMBER(good_clipping) |
| 103 IPC_STRUCT_TRAITS_MEMBER(at_top) | 115 IPC_STRUCT_TRAITS_MEMBER(at_top) |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 120 IPC_STRUCT_TRAITS_END() | 132 IPC_STRUCT_TRAITS_END() |
| 121 | 133 |
| 122 IPC_STRUCT_TRAITS_BEGIN(WebKit::WebCache::UsageStats) | 134 IPC_STRUCT_TRAITS_BEGIN(WebKit::WebCache::UsageStats) |
| 123 IPC_STRUCT_TRAITS_MEMBER(minDeadCapacity) | 135 IPC_STRUCT_TRAITS_MEMBER(minDeadCapacity) |
| 124 IPC_STRUCT_TRAITS_MEMBER(maxDeadCapacity) | 136 IPC_STRUCT_TRAITS_MEMBER(maxDeadCapacity) |
| 125 IPC_STRUCT_TRAITS_MEMBER(capacity) | 137 IPC_STRUCT_TRAITS_MEMBER(capacity) |
| 126 IPC_STRUCT_TRAITS_MEMBER(liveSize) | 138 IPC_STRUCT_TRAITS_MEMBER(liveSize) |
| 127 IPC_STRUCT_TRAITS_MEMBER(deadSize) | 139 IPC_STRUCT_TRAITS_MEMBER(deadSize) |
| 128 IPC_STRUCT_TRAITS_END() | 140 IPC_STRUCT_TRAITS_END() |
| 129 | 141 |
| 142 IPC_STRUCT_BEGIN(ChromeViewHostMsg_GetPluginInfo_Params) | |
|
jam
2011/09/30 17:01:21
nit: we normally don't create structs unless we ne
Bernhard Bauer
2011/09/30 17:22:21
I need to forward-declare the struct, and I can't
jam
2011/09/30 17:40:19
that's by design, since there's a lot of unnecessa
Bernhard Bauer
2011/10/05 13:34:33
I split up ChromeViewHostMsg_GetPluginInfo_Params
| |
| 143 IPC_STRUCT_MEMBER(ChromeViewHostMsg_GetPluginInfo_Status::Value, status) | |
| 144 IPC_STRUCT_MEMBER(webkit::WebPluginInfo, plugin) | |
| 145 IPC_STRUCT_MEMBER(std::string, actual_mime_type) | |
| 146 IPC_STRUCT_END() | |
| 147 | |
| 148 | |
| 130 //----------------------------------------------------------------------------- | 149 //----------------------------------------------------------------------------- |
| 131 // RenderView messages | 150 // RenderView messages |
| 132 // These are messages sent from the browser to the renderer process. | 151 // These are messages sent from the browser to the renderer process. |
| 133 | 152 |
| 134 // Tells the renderer to set its maximum cache size to the supplied value. | 153 // Tells the renderer to set its maximum cache size to the supplied value. |
| 135 IPC_MESSAGE_CONTROL3(ChromeViewMsg_SetCacheCapacities, | 154 IPC_MESSAGE_CONTROL3(ChromeViewMsg_SetCacheCapacities, |
| 136 size_t /* min_dead_capacity */, | 155 size_t /* min_dead_capacity */, |
| 137 size_t /* max_dead_capacity */, | 156 size_t /* max_dead_capacity */, |
| 138 size_t /* capacity */) | 157 size_t /* capacity */) |
| 139 | 158 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 377 // | 396 // |
| 378 // If |setting| is set to CONTENT_SETTING_DEFAULT, the plug-in is | 397 // If |setting| is set to CONTENT_SETTING_DEFAULT, the plug-in is |
| 379 // neither blocked nor white-listed, which means that it's allowed | 398 // neither blocked nor white-listed, which means that it's allowed |
| 380 // by default and can still be blocked if it's non-sandboxed. | 399 // by default and can still be blocked if it's non-sandboxed. |
| 381 // | 400 // |
| 382 IPC_SYNC_MESSAGE_CONTROL2_1(ChromeViewHostMsg_GetPluginContentSetting, | 401 IPC_SYNC_MESSAGE_CONTROL2_1(ChromeViewHostMsg_GetPluginContentSetting, |
| 383 GURL /* policy_url */, | 402 GURL /* policy_url */, |
| 384 std::string /* resource */, | 403 std::string /* resource */, |
| 385 ContentSetting /* setting */) | 404 ContentSetting /* setting */) |
| 386 | 405 |
| 406 // Return information about a plugin for the given URL and MIME type. | |
| 407 // In contrast to ViewHostMsg_GetPluginInfo in content/, this IPC call knows | |
| 408 // about specific reasons why a plug-in can't be used, for example because it's | |
| 409 // disabled. | |
| 410 IPC_SYNC_MESSAGE_CONTROL4_1(ChromeViewHostMsg_GetPluginInfo, | |
| 411 int /* render_view_id */, | |
| 412 GURL /* url */, | |
| 413 GURL /* top origin url */, | |
| 414 std::string /* mime_type */, | |
| 415 ChromeViewHostMsg_GetPluginInfo_Params /* params */) | |
| 416 | |
| 387 // Specifies the URL as the first parameter (a wstring) and thumbnail as | 417 // Specifies the URL as the first parameter (a wstring) and thumbnail as |
| 388 // binary data as the second parameter. | 418 // binary data as the second parameter. |
| 389 IPC_MESSAGE_ROUTED3(ChromeViewHostMsg_Thumbnail, | 419 IPC_MESSAGE_ROUTED3(ChromeViewHostMsg_Thumbnail, |
| 390 GURL /* url */, | 420 GURL /* url */, |
| 391 ThumbnailScore /* score */, | 421 ThumbnailScore /* score */, |
| 392 SkBitmap /* bitmap */) | 422 SkBitmap /* bitmap */) |
| 393 | 423 |
| 394 // Send a snapshot of the tab contents to the render host. | 424 // Send a snapshot of the tab contents to the render host. |
| 395 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_Snapshot, | 425 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_Snapshot, |
| 396 SkBitmap /* bitmap */) | 426 SkBitmap /* bitmap */) |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 557 // previous SetCookie message to be processed. | 587 // previous SetCookie message to be processed. |
| 558 IPC_SYNC_MESSAGE_ROUTED2_1(ChromeViewHostMsg_GetCookies, | 588 IPC_SYNC_MESSAGE_ROUTED2_1(ChromeViewHostMsg_GetCookies, |
| 559 GURL /* url */, | 589 GURL /* url */, |
| 560 GURL /* first_party_for_cookies */, | 590 GURL /* first_party_for_cookies */, |
| 561 std::string /* cookies */) | 591 std::string /* cookies */) |
| 562 | 592 |
| 563 // Provide the browser process with current renderer framerate. | 593 // Provide the browser process with current renderer framerate. |
| 564 IPC_MESSAGE_CONTROL2(ChromeViewHostMsg_FPS, | 594 IPC_MESSAGE_CONTROL2(ChromeViewHostMsg_FPS, |
| 565 int /* routing id */, | 595 int /* routing id */, |
| 566 float /* frames per second */) | 596 float /* frames per second */) |
| OLD | NEW |