OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/renderer/pepper/pepper_extensions_common_host.h" | 5 #include "chrome/renderer/pepper/pepper_extensions_common_host.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/renderer/extensions/chrome_v8_context.h" | 10 #include "chrome/renderer/extensions/chrome_v8_context.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 return PP_ERROR_FAILED; | 69 return PP_ERROR_FAILED; |
70 } | 70 } |
71 | 71 |
72 extensions::ChromeV8Context* PepperExtensionsCommonHost::GetContext() { | 72 extensions::ChromeV8Context* PepperExtensionsCommonHost::GetContext() { |
73 WebKit::WebPluginContainer* container = | 73 WebKit::WebPluginContainer* container = |
74 renderer_ppapi_host_->GetContainerForInstance(pp_instance()); | 74 renderer_ppapi_host_->GetContainerForInstance(pp_instance()); |
75 if (!container) | 75 if (!container) |
76 return NULL; | 76 return NULL; |
77 | 77 |
78 WebKit::WebFrame* frame = container->element().document().frame(); | 78 WebKit::WebFrame* frame = container->element().document().frame(); |
79 v8::HandleScope scope; | 79 v8::HandleScope scope(v8::Isolate::GetCurrent()); |
80 return dispatcher_->v8_context_set().GetByV8Context( | 80 return dispatcher_->v8_context_set().GetByV8Context( |
81 frame->mainWorldScriptContext()); | 81 frame->mainWorldScriptContext()); |
82 } | 82 } |
83 | 83 |
84 void PepperExtensionsCommonHost::OnResponseReceived( | 84 void PepperExtensionsCommonHost::OnResponseReceived( |
85 const std::string& /* name */, | 85 const std::string& /* name */, |
86 int request_id, | 86 int request_id, |
87 bool success, | 87 bool success, |
88 const base::ListValue& response, | 88 const base::ListValue& response, |
89 const std::string& /* error */) { | 89 const std::string& /* error */) { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 linked_ptr<ppapi::host::ReplyMessageContext>( | 125 linked_ptr<ppapi::host::ReplyMessageContext>( |
126 new ppapi::host::ReplyMessageContext( | 126 new ppapi::host::ReplyMessageContext( |
127 context->MakeReplyMessageContext())); | 127 context->MakeReplyMessageContext())); |
128 | 128 |
129 dispatcher_->request_sender()->StartRequest(this, request_name, request_id, | 129 dispatcher_->request_sender()->StartRequest(this, request_name, request_id, |
130 true, false, &args); | 130 true, false, &args); |
131 return PP_OK_COMPLETIONPENDING; | 131 return PP_OK_COMPLETIONPENDING; |
132 } | 132 } |
133 | 133 |
134 } // namespace chrome | 134 } // namespace chrome |
135 | |
OLD | NEW |