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

Side by Side Diff: content/renderer/render_view_impl.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/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 if (!opener) 532 if (!opener)
533 return true; 533 return true;
534 534
535 if (url.GetOrigin() != GURL(opener->document().url()).GetOrigin()) 535 if (url.GetOrigin() != GURL(opener->document().url()).GetOrigin())
536 return true; 536 return true;
537 } 537 }
538 return false; 538 return false;
539 } 539 }
540 540
541 static void NotifyTimezoneChange(WebKit::WebFrame* frame) { 541 static void NotifyTimezoneChange(WebKit::WebFrame* frame) {
542 v8::HandleScope handle_scope; 542 v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
543 v8::Context::Scope context_scope(frame->mainWorldScriptContext()); 543 v8::Context::Scope context_scope(frame->mainWorldScriptContext());
544 v8::Date::DateTimeConfigurationChangeNotification(); 544 v8::Date::DateTimeConfigurationChangeNotification();
545 WebKit::WebFrame* child = frame->firstChild(); 545 WebKit::WebFrame* child = frame->firstChild();
546 for (; child; child = child->nextSibling()) 546 for (; child; child = child->nextSibling())
547 NotifyTimezoneChange(child); 547 NotifyTimezoneChange(child);
548 } 548 }
549 549
550 static WindowOpenDisposition NavigationPolicyToDisposition( 550 static WindowOpenDisposition NavigationPolicyToDisposition(
551 WebNavigationPolicy policy) { 551 WebNavigationPolicy policy) {
552 switch (policy) { 552 switch (policy) {
(...skipping 3824 matching lines...) Expand 10 before | Expand all | Expand 10 after
4377 return new WebPluginImpl(frame, params, info.path, AsWeakPtr()); 4377 return new WebPluginImpl(frame, params, info.path, AsWeakPtr());
4378 #else 4378 #else
4379 return NULL; 4379 return NULL;
4380 #endif 4380 #endif
4381 } 4381 }
4382 4382
4383 void RenderViewImpl::EvaluateScript(const string16& frame_xpath, 4383 void RenderViewImpl::EvaluateScript(const string16& frame_xpath,
4384 const string16& jscript, 4384 const string16& jscript,
4385 int id, 4385 int id,
4386 bool notify_result) { 4386 bool notify_result) {
4387 v8::HandleScope handle_scope; 4387 v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
4388 v8::Handle<v8::Value> result; 4388 v8::Handle<v8::Value> result;
4389 WebFrame* web_frame = GetChildFrame(frame_xpath); 4389 WebFrame* web_frame = GetChildFrame(frame_xpath);
4390 if (web_frame) 4390 if (web_frame)
4391 result = web_frame->executeScriptAndReturnValue(WebScriptSource(jscript)); 4391 result = web_frame->executeScriptAndReturnValue(WebScriptSource(jscript));
4392 if (notify_result) { 4392 if (notify_result) {
4393 base::ListValue list; 4393 base::ListValue list;
4394 if (!result.IsEmpty() && web_frame) { 4394 if (!result.IsEmpty() && web_frame) {
4395 v8::Local<v8::Context> context = web_frame->mainWorldScriptContext(); 4395 v8::Local<v8::Context> context = web_frame->mainWorldScriptContext();
4396 v8::Context::Scope context_scope(context); 4396 v8::Context::Scope context_scope(context);
4397 V8ValueConverterImpl converter; 4397 V8ValueConverterImpl converter;
(...skipping 2122 matching lines...) Expand 10 before | Expand all | Expand 10 after
6520 for (size_t i = 0; i < icon_urls.size(); i++) { 6520 for (size_t i = 0; i < icon_urls.size(); i++) {
6521 WebURL url = icon_urls[i].iconURL(); 6521 WebURL url = icon_urls[i].iconURL();
6522 if (!url.isEmpty()) 6522 if (!url.isEmpty())
6523 urls.push_back(FaviconURL(url, 6523 urls.push_back(FaviconURL(url,
6524 ToFaviconType(icon_urls[i].iconType()))); 6524 ToFaviconType(icon_urls[i].iconType())));
6525 } 6525 }
6526 SendUpdateFaviconURL(urls); 6526 SendUpdateFaviconURL(urls);
6527 } 6527 }
6528 6528
6529 } // namespace content 6529 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/v8_var_converter.cc ('k') | content/renderer/v8_value_converter_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698