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

Side by Side Diff: ppapi/proxy/flash_menu_resource.cc

Issue 2828913003: Replace "nested message loop" with "nested run loop" in comments. (Closed)
Patch Set: rebase Created 3 years, 7 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/cpp/message_loop.h ('k') | ppapi/tests/test_case.h » ('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 #include "ppapi/proxy/flash_menu_resource.h" 5 #include "ppapi/proxy/flash_menu_resource.h"
6 6
7 #include "ppapi/c/pp_errors.h" 7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/proxy/ppapi_messages.h" 8 #include "ppapi/proxy/ppapi_messages.h"
9 #include "ppapi/proxy/serialized_flash_menu.h" 9 #include "ppapi/proxy/serialized_flash_menu.h"
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 selected_id_dest_ = selected_id; 42 selected_id_dest_ = selected_id;
43 callback_ = callback; 43 callback_ = callback;
44 44
45 // This must be a sync message even though we don't care about the result. 45 // This must be a sync message even though we don't care about the result.
46 // The actual reply will be sent asynchronously in the future. This sync 46 // The actual reply will be sent asynchronously in the future. This sync
47 // request is due to the following deadlock: 47 // request is due to the following deadlock:
48 // 48 //
49 // 1. Flash sends a show request to the renderer. 49 // 1. Flash sends a show request to the renderer.
50 // 2. The show handler in the renderer (in the case of full screen) requests 50 // 2. The show handler in the renderer (in the case of full screen) requests
51 // the window rect which is a sync message to the browser. This causes 51 // the window rect which is a sync message to the browser. This causes
52 // a nested message loop to be spun up in the renderer. 52 // a nested run loop to be spun up in the renderer.
53 // 3. Flash expects context menus to be synchronous so it starts a nested 53 // 3. Flash expects context menus to be synchronous so it starts a nested
54 // message loop. This creates a second nested message loop in both the 54 // message loop. This creates a second nested run loop in both the
55 // plugin and renderer process. 55 // plugin and renderer process.
56 // 4. The browser sends the window rect reply to unblock the renderer, but 56 // 4. The browser sends the window rect reply to unblock the renderer, but
57 // it's in the second nested message loop and the reply will *not* 57 // it's in the second nested run loop and the reply will *not*
58 // unblock this loop. 58 // unblock this loop.
59 // 5. The second loop won't exit until the message loop is complete, but 59 // 5. The second loop won't exit until the message loop is complete, but
60 // that can't start until the first one exits. 60 // that can't start until the first one exits.
61 // 61 //
62 // Having this message sync forces the sync request from the renderer to the 62 // Having this message sync forces the sync request from the renderer to the
63 // browser for the window rect will complete before Flash can run a nested 63 // browser for the window rect will complete before Flash can run a nested
64 // message loop to wait for the result of the menu. 64 // message loop to wait for the result of the menu.
65 SyncCall<IPC::Message>(RENDERER, PpapiHostMsg_FlashMenu_Show(*location)); 65 SyncCall<IPC::Message>(RENDERER, PpapiHostMsg_FlashMenu_Show(*location));
66 return PP_OK_COMPLETIONPENDING; 66 return PP_OK_COMPLETIONPENDING;
67 } 67 }
(...skipping 20 matching lines...) Expand all
88 if (!TrackedCallback::IsPending(callback_)) 88 if (!TrackedCallback::IsPending(callback_))
89 return; 89 return;
90 90
91 *selected_id_dest_ = selected_id; 91 *selected_id_dest_ = selected_id;
92 selected_id_dest_ = NULL; 92 selected_id_dest_ = NULL;
93 callback_->Run(params.result()); 93 callback_->Run(params.result());
94 } 94 }
95 95
96 } // namespace proxy 96 } // namespace proxy
97 } // namespace ppapi 97 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/cpp/message_loop.h ('k') | ppapi/tests/test_case.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698