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

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

Issue 23861002: Remove calls to HandleScope default ctor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 3 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
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/message_channel.h" 5 #include "content/renderer/pepper/message_channel.h"
6 6
7 #include <cstdlib> 7 #include <cstdlib>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 base::Bind(&MessageChannel::NPVariantToPPVarComplete, 359 base::Bind(&MessageChannel::NPVariantToPPVarComplete,
360 weak_ptr_factory_.GetWeakPtr(), result_iterator)); 360 weak_ptr_factory_.GetWeakPtr(), result_iterator));
361 return; 361 return;
362 } 362 }
363 } 363 }
364 NPVariantToPPVarComplete(result_iterator, 364 NPVariantToPPVarComplete(result_iterator,
365 ppapi::ScopedPPVar(PP_MakeUndefined()), false); 365 ppapi::ScopedPPVar(PP_MakeUndefined()), false);
366 } 366 }
367 367
368 void MessageChannel::PostMessageToJavaScript(PP_Var message_data) { 368 void MessageChannel::PostMessageToJavaScript(PP_Var message_data) {
369 v8::HandleScope scope; 369 v8::HandleScope scope(v8::Isolate::GetCurrent());
370 370
371 // Because V8 is probably not on the stack for Native->JS calls, we need to 371 // Because V8 is probably not on the stack for Native->JS calls, we need to
372 // enter the appropriate context for the plugin. 372 // enter the appropriate context for the plugin.
373 WebPluginContainer* container = instance_->container(); 373 WebPluginContainer* container = instance_->container();
374 // It's possible that container() is NULL if the plugin has been removed from 374 // It's possible that container() is NULL if the plugin has been removed from
375 // the DOM (but the PluginInstance is not destroyed yet). 375 // the DOM (but the PluginInstance is not destroyed yet).
376 if (!container) 376 if (!container)
377 return; 377 return;
378 378
379 v8::Local<v8::Context> context = 379 v8::Local<v8::Context> context =
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 // incoming passthrough object first, so that we behave correctly if anyone 551 // incoming passthrough object first, so that we behave correctly if anyone
552 // invokes: 552 // invokes:
553 // SetPassthroughObject(passthrough_object()); 553 // SetPassthroughObject(passthrough_object());
554 if (passthrough_object_) 554 if (passthrough_object_)
555 WebBindings::releaseObject(passthrough_object_); 555 WebBindings::releaseObject(passthrough_object_);
556 556
557 passthrough_object_ = passthrough; 557 passthrough_object_ = passthrough;
558 } 558 }
559 559
560 } // namespace content 560 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin.cc ('k') | content/renderer/pepper/v8_var_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698