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

Side by Side Diff: chrome/renderer/extensions/console.cc

Issue 23679004: Remove more calls to HandleScope default ctor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/extensions/console.h" 5 #include "chrome/renderer/extensions/console.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/debug/alias.h" 8 #include "base/debug/alias.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 } 165 }
166 content::RenderView* render_view = ByContextFinder::Find(context); 166 content::RenderView* render_view = ByContextFinder::Find(context);
167 if (!render_view) { 167 if (!render_view) {
168 LOG(WARNING) << "Could not log \"" << message << "\": no render view found"; 168 LOG(WARNING) << "Could not log \"" << message << "\": no render view found";
169 return; 169 return;
170 } 170 }
171 AddMessage(render_view, level, message); 171 AddMessage(render_view, level, message);
172 } 172 }
173 173
174 v8::Local<v8::Object> AsV8Object() { 174 v8::Local<v8::Object> AsV8Object() {
175 v8::HandleScope handle_scope; 175 v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
176 v8::Local<v8::Object> console_object = v8::Object::New(); 176 v8::Local<v8::Object> console_object = v8::Object::New();
177 BindLogMethod(console_object, "debug", &Debug); 177 BindLogMethod(console_object, "debug", &Debug);
178 BindLogMethod(console_object, "log", &Log); 178 BindLogMethod(console_object, "log", &Log);
179 BindLogMethod(console_object, "warn", &Warn); 179 BindLogMethod(console_object, "warn", &Warn);
180 BindLogMethod(console_object, "error", &Error); 180 BindLogMethod(console_object, "error", &Error);
181 return handle_scope.Close(console_object); 181 return handle_scope.Close(console_object);
182 } 182 }
183 183
184 } // namespace console 184 } // namespace console
185 } // namespace extensions 185 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698