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

Issue 11022005: Converted PluginResource reply message handling to use base::Callback (Closed)

Created:
8 years, 2 months ago by raymes
Modified:
8 years, 2 months ago
Reviewers:
brettw, yzshen1
CC:
chromium-reviews
Visibility:
Public.

Description

Converted PluginResource reply message handling to use base::Callback Previously each PluginResource had to write a reply handler (|OnReplyReceived|) for any replies to resource messages. This approach had several problems including the fact that the PluginResource had to track the state of any outstanding calls. This change allows you to register a base::Callback when calling CallToBrowser/CallToRenderer. The callback will be run when a reply message is received with a sequence number matching the call. The parameters of the reply will be passed to the callback. An example of usage: CallBrowser<PpapiPluginMsg_MyResourceType_MyReplyMessage>( PpapiHostMsg_MyResourceType_MyRequestMessage(), base::Bind(&MyPluginResource::ReplyHandler, this)); If a reply message to this call is received whose type does not match the expected reply message (for example, in the case of an error), the callback will still be invoked but with the default values of the message parameters. BUG= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=160015

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : . #

Patch Set 4 : . #

Patch Set 5 : . #

Total comments: 14

Patch Set 6 : . #

Total comments: 2

Patch Set 7 : . #

Patch Set 8 : . #

Patch Set 9 : . #

Patch Set 10 : . #

Patch Set 11 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+239 lines, -120 lines) Patch
M ppapi/proxy/dispatch_reply_message.h View 1 2 3 4 5 2 chunks +65 lines, -19 lines 0 comments Download
M ppapi/proxy/file_chooser_resource.h View 1 chunk +0 lines, -4 lines 0 comments Download
M ppapi/proxy/file_chooser_resource.cc View 3 chunks +8 lines, -14 lines 0 comments Download
M ppapi/proxy/flash_device_id_resource.h View 1 chunk +0 lines, -4 lines 0 comments Download
M ppapi/proxy/flash_device_id_resource.cc View 2 chunks +4 lines, -11 lines 0 comments Download
M ppapi/proxy/gamepad_resource.h View 1 chunk +0 lines, -4 lines 0 comments Download
M ppapi/proxy/gamepad_resource.cc View 3 chunks +4 lines, -9 lines 0 comments Download
M ppapi/proxy/plugin_resource.h View 1 2 3 4 5 6 7 5 chunks +71 lines, -5 lines 0 comments Download
M ppapi/proxy/plugin_resource.cc View 1 2 3 4 5 6 7 2 chunks +21 lines, -16 lines 0 comments Download
A ppapi/proxy/plugin_resource_callback.h View 1 2 3 4 5 6 1 chunk +52 lines, -0 lines 0 comments Download
M ppapi/proxy/printing_resource.h View 1 chunk +3 lines, -9 lines 0 comments Download
M ppapi/proxy/printing_resource.cc View 3 chunks +11 lines, -25 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
raymes
8 years, 2 months ago (2012-10-01 21:44:23 UTC) #1
yzshen1
Only some nits. https://codereview.chromium.org/11022005/diff/12002/ppapi/proxy/dispatch_reply_message.h File ppapi/proxy/dispatch_reply_message.h (right): https://codereview.chromium.org/11022005/diff/12002/ppapi/proxy/dispatch_reply_message.h#newcode74 ppapi/proxy/dispatch_reply_message.h:74: // generate a reply in error ...
8 years, 2 months ago (2012-10-01 23:41:24 UTC) #2
raymes
https://codereview.chromium.org/11022005/diff/12002/ppapi/proxy/dispatch_reply_message.h File ppapi/proxy/dispatch_reply_message.h (right): https://codereview.chromium.org/11022005/diff/12002/ppapi/proxy/dispatch_reply_message.h#newcode74 ppapi/proxy/dispatch_reply_message.h:74: // generate a reply in error cases (when the ...
8 years, 2 months ago (2012-10-02 16:13:36 UTC) #3
raymes
Adding Brett
8 years, 2 months ago (2012-10-02 16:14:21 UTC) #4
yzshen1
lgtm
8 years, 2 months ago (2012-10-02 16:59:04 UTC) #5
brettw
This is great stuff. LGTM https://codereview.chromium.org/11022005/diff/14002/ppapi/proxy/plugin_resource_callback.h File ppapi/proxy/plugin_resource_callback.h (right): https://codereview.chromium.org/11022005/diff/14002/ppapi/proxy/plugin_resource_callback.h#newcode34 ppapi/proxy/plugin_resource_callback.h:34: const CallbackType& callback) : ...
8 years, 2 months ago (2012-10-02 19:40:00 UTC) #6
raymes
Thanks for the quick review. http://codereview.chromium.org/11022005/diff/14002/ppapi/proxy/plugin_resource_callback.h File ppapi/proxy/plugin_resource_callback.h (right): http://codereview.chromium.org/11022005/diff/14002/ppapi/proxy/plugin_resource_callback.h#newcode34 ppapi/proxy/plugin_resource_callback.h:34: const CallbackType& callback) : ...
8 years, 2 months ago (2012-10-03 21:43:50 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/raymes@chromium.org/11022005/22001
8 years, 2 months ago (2012-10-03 21:44:16 UTC) #8
commit-bot: I haz the power
Failed to apply patch for ppapi/proxy/plugin_resource.h: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
8 years, 2 months ago (2012-10-03 21:44:19 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/raymes@chromium.org/11022005/21005
8 years, 2 months ago (2012-10-03 21:58:22 UTC) #10
commit-bot: I haz the power
8 years, 2 months ago (2012-10-04 00:07:45 UTC) #11
Change committed as 160015

Powered by Google App Engine
This is Rietveld 408576698