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

Unified Diff: extensions/renderer/logging_native_handler.cc

Issue 1155183006: Reimplement automation API on top of C++-backed AXTree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@automation_faster_2
Patch Set: Copy observers Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/renderer/logging_native_handler.h ('k') | extensions/renderer/script_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/logging_native_handler.cc
diff --git a/extensions/renderer/logging_native_handler.cc b/extensions/renderer/logging_native_handler.cc
index 8a913a15f258af3340ea46d167300e564a5539c1..86fbc9c9fbe4d1cb62f4910b2f195b06b5c20c7d 100644
--- a/extensions/renderer/logging_native_handler.cc
+++ b/extensions/renderer/logging_native_handler.cc
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "extensions/renderer/logging_native_handler.h"
-
#include "base/logging.h"
#include "base/strings/stringprintf.h"
+#include "extensions/renderer/logging_native_handler.h"
+#include "extensions/renderer/script_context.h"
namespace extensions {
@@ -72,31 +72,7 @@ void LoggingNativeHandler::ParseArgs(
*error_message = "Error: " + std::string(*v8::String::Utf8Value(args[1]));
}
- v8::Local<v8::StackTrace> stack_trace =
- v8::StackTrace::CurrentStackTrace(args.GetIsolate(), 10);
- if (stack_trace.IsEmpty() || stack_trace->GetFrameCount() <= 0) {
- *error_message += "\n <no stack trace>";
- } else {
- for (size_t i = 0; i < (size_t)stack_trace->GetFrameCount(); ++i) {
- v8::Local<v8::StackFrame> frame = stack_trace->GetFrame(i);
- CHECK(!frame.IsEmpty());
- *error_message += base::StringPrintf(
- "\n at %s (%s:%d:%d)",
- ToStringOrDefault(frame->GetFunctionName(), "<anonymous>").c_str(),
- ToStringOrDefault(frame->GetScriptName(), "<anonymous>").c_str(),
- frame->GetLineNumber(),
- frame->GetColumn());
- }
- }
-}
-
-std::string LoggingNativeHandler::ToStringOrDefault(
- const v8::Local<v8::String>& v8_string,
- const std::string& dflt) {
- if (v8_string.IsEmpty())
- return dflt;
- std::string ascii_value = *v8::String::Utf8Value(v8_string);
- return ascii_value.empty() ? dflt : ascii_value;
+ *error_message += "\n" + context()->GetStackTraceAsString();
}
} // namespace extensions
« no previous file with comments | « extensions/renderer/logging_native_handler.h ('k') | extensions/renderer/script_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698