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

Side by Side Diff: chrome/renderer/searchbox/searchbox_extension.cc

Issue 12335006: Add handle scopes around executeScriptAndReturnValue callsites (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | « no previous file | content/public/test/render_view_test.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "chrome/renderer/searchbox/searchbox_extension.h" 5 #include "chrome/renderer/searchbox/searchbox_extension.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "chrome/common/extensions/extension.h" 10 #include "chrome/common/extensions/extension.h"
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 864
865 // static 865 // static
866 v8::Extension* SearchBoxExtension::Get() { 866 v8::Extension* SearchBoxExtension::Get() {
867 return new SearchBoxExtensionWrapper(ResourceBundle::GetSharedInstance(). 867 return new SearchBoxExtensionWrapper(ResourceBundle::GetSharedInstance().
868 GetRawDataResource(IDR_SEARCHBOX_API)); 868 GetRawDataResource(IDR_SEARCHBOX_API));
869 } 869 }
870 870
871 // static 871 // static
872 bool SearchBoxExtension::PageSupportsInstant(WebKit::WebFrame* frame) { 872 bool SearchBoxExtension::PageSupportsInstant(WebKit::WebFrame* frame) {
873 if (!frame) return false; 873 if (!frame) return false;
874 874 v8::HandleScope handle_scope;
875 v8::Handle<v8::Value> v = frame->executeScriptAndReturnValue( 875 v8::Handle<v8::Value> v = frame->executeScriptAndReturnValue(
876 WebKit::WebScriptSource(kSupportsInstantScript)); 876 WebKit::WebScriptSource(kSupportsInstantScript));
877 return !v.IsEmpty() && v->BooleanValue(); 877 return !v.IsEmpty() && v->BooleanValue();
878 } 878 }
879 879
880 // static 880 // static
881 void SearchBoxExtension::DispatchChange(WebKit::WebFrame* frame) { 881 void SearchBoxExtension::DispatchChange(WebKit::WebFrame* frame) {
882 Dispatch(frame, kDispatchChangeEventScript); 882 Dispatch(frame, kDispatchChangeEventScript);
883 } 883 }
884 884
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 void SearchBoxExtension::DispatchMarginChange(WebKit::WebFrame* frame) { 930 void SearchBoxExtension::DispatchMarginChange(WebKit::WebFrame* frame) {
931 Dispatch(frame, kDispatchMarginChangeEventScript); 931 Dispatch(frame, kDispatchMarginChangeEventScript);
932 } 932 }
933 933
934 // static 934 // static
935 void SearchBoxExtension::DispatchThemeChange(WebKit::WebFrame* frame) { 935 void SearchBoxExtension::DispatchThemeChange(WebKit::WebFrame* frame) {
936 Dispatch(frame, kDispatchThemeChangeEventScript); 936 Dispatch(frame, kDispatchThemeChangeEventScript);
937 } 937 }
938 938
939 } // namespace extensions_v8 939 } // namespace extensions_v8
OLDNEW
« no previous file with comments | « no previous file | content/public/test/render_view_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698