OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // IPC messages for injected Java objects (Gin-based implementation). | 5 // IPC messages for injected Java objects (Gin-based implementation). |
6 | 6 |
7 // Multiply-included message file, hence no include guard. | 7 // Multiply-included message file, hence no include guard. |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 IPC_SYNC_MESSAGE_ROUTED2_1(GinJavaBridgeHostMsg_HasMethod, | 38 IPC_SYNC_MESSAGE_ROUTED2_1(GinJavaBridgeHostMsg_HasMethod, |
39 int32 /* object_id */, | 39 int32 /* object_id */, |
40 std::string /* method_name */, | 40 std::string /* method_name */, |
41 bool /* result */) | 41 bool /* result */) |
42 | 42 |
43 // Sent from renderer to browser to invoke a method. Method arguments | 43 // Sent from renderer to browser to invoke a method. Method arguments |
44 // are chained into |arguments| list. base::ListValue is used for |result| as | 44 // are chained into |arguments| list. base::ListValue is used for |result| as |
45 // a container to work around immutability of base::Value. | 45 // a container to work around immutability of base::Value. |
46 // Empty result list indicates that an error has happened on the Java side | 46 // Empty result list indicates that an error has happened on the Java side |
47 // (either bridge-induced error or an unhandled Java exception) and an exception | 47 // (either bridge-induced error or an unhandled Java exception) and an exception |
48 // must be thrown into JavaScript. | 48 // must be thrown into JavaScript with the text from |error_message|. |
49 // Some special value types that are not supported by base::Value are encoded | 49 // Some special value types that are not supported by base::Value are encoded |
50 // as BinaryValues via GinJavaBridgeValue. | 50 // as BinaryValues via GinJavaBridgeValue. |
51 IPC_SYNC_MESSAGE_ROUTED3_1(GinJavaBridgeHostMsg_InvokeMethod, | 51 IPC_SYNC_MESSAGE_ROUTED3_2(GinJavaBridgeHostMsg_InvokeMethod, |
52 int32 /* object_id */, | 52 int32 /* object_id */, |
53 std::string /* method_name */, | 53 std::string /* method_name */, |
54 base::ListValue /* arguments */, | 54 base::ListValue /* arguments */, |
55 base::ListValue /* result */) | 55 base::ListValue /* result */, |
| 56 std::string /* error_message */) |
56 | 57 |
57 // Sent from renderer to browser in two cases: | 58 // Sent from renderer to browser in two cases: |
58 // | 59 // |
59 // 1. (Main usage) To inform that the JS wrapper of the object has | 60 // 1. (Main usage) To inform that the JS wrapper of the object has |
60 // been completely dereferenced and garbage-collected. | 61 // been completely dereferenced and garbage-collected. |
61 // | 62 // |
62 // 2. To notify the browser that wrapper creation has failed. The browser side | 63 // 2. To notify the browser that wrapper creation has failed. The browser side |
63 // assumes optimistically that every time an object is returned from a | 64 // assumes optimistically that every time an object is returned from a |
64 // method, the corresponding wrapper object will be successfully created on | 65 // method, the corresponding wrapper object will be successfully created on |
65 // the renderer side. Sending of this message informs the browser whether | 66 // the renderer side. Sending of this message informs the browser whether |
66 // this expectation has failed. | 67 // this expectation has failed. |
67 IPC_MESSAGE_ROUTED1(GinJavaBridgeHostMsg_ObjectWrapperDeleted, | 68 IPC_MESSAGE_ROUTED1(GinJavaBridgeHostMsg_ObjectWrapperDeleted, |
68 int32 /* object_id */) | 69 int32 /* object_id */) |
OLD | NEW |