Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: ppapi/proxy/resource_message_test_sink.h

Issue 1864293002: Convert //ppapi to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more nullptr Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ppapi/proxy/raw_var_data_unittest.cc ('k') | ppapi/proxy/resource_message_test_sink.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef PPAPI_PROXY_RESOURCE_MESSAGE_TEST_SINK_H_ 5 #ifndef PPAPI_PROXY_RESOURCE_MESSAGE_TEST_SINK_H_
6 #define PPAPI_PROXY_RESOURCE_MESSAGE_TEST_SINK_H_ 6 #define PPAPI_PROXY_RESOURCE_MESSAGE_TEST_SINK_H_
7 7
8 #include "ipc/ipc_listener.h" 8 #include "ipc/ipc_listener.h"
9 #include "ipc/ipc_test_sink.h" 9 #include "ipc/ipc_test_sink.h"
10 #include "ppapi/c/pp_stdint.h" 10 #include "ppapi/c/pp_stdint.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 typedef std::pair<ResourceMessageCallParams, IPC::Message> ResourceCall; 48 typedef std::pair<ResourceMessageCallParams, IPC::Message> ResourceCall;
49 typedef std::vector<ResourceCall> ResourceCallVector; 49 typedef std::vector<ResourceCall> ResourceCallVector;
50 ResourceCallVector GetAllResourceCallsMatching(uint32_t id); 50 ResourceCallVector GetAllResourceCallsMatching(uint32_t id);
51 51
52 // Like GetAllResourceCallsMatching except for replies. 52 // Like GetAllResourceCallsMatching except for replies.
53 typedef std::pair<ResourceMessageReplyParams, IPC::Message> ResourceReply; 53 typedef std::pair<ResourceMessageReplyParams, IPC::Message> ResourceReply;
54 typedef std::vector<ResourceReply> ResourceReplyVector; 54 typedef std::vector<ResourceReply> ResourceReplyVector;
55 ResourceReplyVector GetAllResourceRepliesMatching(uint32_t id); 55 ResourceReplyVector GetAllResourceRepliesMatching(uint32_t id);
56 56
57 private: 57 private:
58 scoped_ptr<IPC::Message> sync_reply_msg_; 58 std::unique_ptr<IPC::Message> sync_reply_msg_;
59 }; 59 };
60 60
61 // This is a message handler which generates reply messages for synchronous 61 // This is a message handler which generates reply messages for synchronous
62 // resource calls. This allows unit testing of the plugin side of resources 62 // resource calls. This allows unit testing of the plugin side of resources
63 // which send sync messages. If you want to reply to a sync message type named 63 // which send sync messages. If you want to reply to a sync message type named
64 // |PpapiHostMsg_X_Y| with |PpapiPluginMsg_X_YReply| then usage would be as 64 // |PpapiHostMsg_X_Y| with |PpapiPluginMsg_X_YReply| then usage would be as
65 // follows (from within |PluginProxyTest|s): 65 // follows (from within |PluginProxyTest|s):
66 // 66 //
67 // PpapiHostMsg_X_YReply my_reply; 67 // PpapiHostMsg_X_YReply my_reply;
68 // ResourceSyncCallHandler handler(&sink(), 68 // ResourceSyncCallHandler handler(&sink(),
(...skipping 30 matching lines...) Expand all
99 int32_t result_; 99 int32_t result_;
100 const SerializedHandle* serialized_handle_; // Non-owning pointer. 100 const SerializedHandle* serialized_handle_; // Non-owning pointer.
101 IPC::Message reply_msg_; 101 IPC::Message reply_msg_;
102 IPC::Message last_handled_msg_; 102 IPC::Message last_handled_msg_;
103 }; 103 };
104 104
105 } // namespace proxy 105 } // namespace proxy
106 } // namespace ppapi 106 } // namespace ppapi
107 107
108 #endif // PPAPI_PROXY_RESOURCE_MESSAGE_TEST_SINK_H_ 108 #endif // PPAPI_PROXY_RESOURCE_MESSAGE_TEST_SINK_H_
OLDNEW
« no previous file with comments | « ppapi/proxy/raw_var_data_unittest.cc ('k') | ppapi/proxy/resource_message_test_sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698