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

Side by Side Diff: content/renderer/pepper/ppb_broker_impl.cc

Issue 21219002: Remove PluginDelegate completely. In a followup I'll rename PepperPluginDelegateImpl to something c… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/pepper/ppapi_unittest.cc ('k') | content/renderer/pepper/ppb_buffer_impl.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 #include "content/renderer/pepper/ppb_broker_impl.h" 5 #include "content/renderer/pepper/ppb_broker_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/renderer/pepper/common.h" 8 #include "content/renderer/pepper/common.h"
9 #include "content/renderer/pepper/pepper_broker.h" 9 #include "content/renderer/pepper/pepper_broker.h"
10 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" 10 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
11 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" 11 #include "content/renderer/pepper/pepper_plugin_instance_impl.h"
12 #include "content/renderer/pepper/plugin_module.h" 12 #include "content/renderer/pepper/plugin_module.h"
13 #include "content/renderer/pepper/resource_helper.h" 13 #include "content/renderer/pepper/resource_helper.h"
14 #include "ppapi/c/pp_errors.h"
14 #include "ppapi/shared_impl/platform_file.h" 15 #include "ppapi/shared_impl/platform_file.h"
15 #include "third_party/WebKit/public/web/WebDocument.h" 16 #include "third_party/WebKit/public/web/WebDocument.h"
16 #include "third_party/WebKit/public/web/WebElement.h" 17 #include "third_party/WebKit/public/web/WebElement.h"
17 #include "third_party/WebKit/public/web/WebPluginContainer.h" 18 #include "third_party/WebKit/public/web/WebPluginContainer.h"
18 19
19 using ppapi::PlatformFileToInt; 20 using ppapi::PlatformFileToInt;
20 using ppapi::thunk::PPB_Broker_API; 21 using ppapi::thunk::PPB_Broker_API;
21 using ppapi::TrackedCallback; 22 using ppapi::TrackedCallback;
22 23
23 namespace content { 24 namespace content {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 ResourceHelper::GetPluginInstance(this); 59 ResourceHelper::GetPluginInstance(this);
59 if (!plugin_instance) 60 if (!plugin_instance)
60 return PP_ERROR_FAILED; 61 return PP_ERROR_FAILED;
61 62
62 // The callback must be populated now in case we are connected to the broker 63 // The callback must be populated now in case we are connected to the broker
63 // and BrokerConnected is called before ConnectToBroker returns. 64 // and BrokerConnected is called before ConnectToBroker returns.
64 // Because it must be created now, it must be aborted and cleared if 65 // Because it must be created now, it must be aborted and cleared if
65 // ConnectToBroker fails. 66 // ConnectToBroker fails.
66 connect_callback_ = connect_callback; 67 connect_callback_ = connect_callback;
67 68
68 broker_ = static_cast<PepperPluginDelegateImpl*>( 69 broker_ = plugin_instance->delegate()->ConnectToBroker(this);
69 plugin_instance->delegate())->ConnectToBroker(this);
70 if (!broker_) { 70 if (!broker_) {
71 connect_callback_->Abort(); 71 connect_callback_->Abort();
72 return PP_ERROR_FAILED; 72 return PP_ERROR_FAILED;
73 } 73 }
74 74
75 return PP_OK_COMPLETIONPENDING; 75 return PP_OK_COMPLETIONPENDING;
76 } 76 }
77 77
78 int32_t PPB_Broker_Impl::GetHandle(int32_t* handle) { 78 int32_t PPB_Broker_Impl::GetHandle(int32_t* handle) {
79 if (pipe_handle_ == PlatformFileToInt(base::kInvalidPlatformFileValue)) 79 if (pipe_handle_ == PlatformFileToInt(base::kInvalidPlatformFileValue))
(...skipping 17 matching lines...) Expand all
97 97
98 pipe_handle_ = handle; 98 pipe_handle_ = handle;
99 99
100 // Synchronous calls are not supported. 100 // Synchronous calls are not supported.
101 DCHECK(TrackedCallback::IsPending(connect_callback_)); 101 DCHECK(TrackedCallback::IsPending(connect_callback_));
102 102
103 connect_callback_->Run(result); 103 connect_callback_->Run(result);
104 } 104 }
105 105
106 } // namespace content 106 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/ppapi_unittest.cc ('k') | content/renderer/pepper/ppb_buffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698