| OLD | NEW | 
|---|
| 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_helper_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/c/pp_errors.h" | 
| 15 #include "ppapi/shared_impl/platform_file.h" | 15 #include "ppapi/shared_impl/platform_file.h" | 
| 16 #include "third_party/WebKit/public/web/WebDocument.h" | 16 #include "third_party/WebKit/public/web/WebDocument.h" | 
| 17 #include "third_party/WebKit/public/web/WebElement.h" | 17 #include "third_party/WebKit/public/web/WebElement.h" | 
| 18 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 18 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 
| 19 | 19 | 
| 20 using ppapi::PlatformFileToInt; | 20 using ppapi::PlatformFileToInt; | 
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 59       ResourceHelper::GetPluginInstance(this); | 59       ResourceHelper::GetPluginInstance(this); | 
| 60   if (!plugin_instance) | 60   if (!plugin_instance) | 
| 61     return PP_ERROR_FAILED; | 61     return PP_ERROR_FAILED; | 
| 62 | 62 | 
| 63   // 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 | 
| 64   // and BrokerConnected is called before ConnectToBroker returns. | 64   // and BrokerConnected is called before ConnectToBroker returns. | 
| 65   // 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 | 
| 66   // ConnectToBroker fails. | 66   // ConnectToBroker fails. | 
| 67   connect_callback_ = connect_callback; | 67   connect_callback_ = connect_callback; | 
| 68 | 68 | 
| 69   broker_ = plugin_instance->delegate()->ConnectToBroker(this); | 69   broker_ = plugin_instance->helper()->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  Loading... | 
| 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 | 
| OLD | NEW | 
|---|