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

Unified Diff: sky/engine/tonic/dart_exception_factory.cc

Issue 1237973004: Port more String and HashMap usages (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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 | « sky/engine/tonic/dart_exception_factory.h ('k') | sky/engine/tonic/dart_library_loader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/tonic/dart_exception_factory.cc
diff --git a/sky/engine/tonic/dart_exception_factory.cc b/sky/engine/tonic/dart_exception_factory.cc
index e439a45393cad0e5d3af5b42fedb5ecc60d850fa..e8c348588ca768bc7b770f9ff3e4ae7f80ff0dd6 100644
--- a/sky/engine/tonic/dart_exception_factory.cc
+++ b/sky/engine/tonic/dart_exception_factory.cc
@@ -6,7 +6,6 @@
#include "sky/engine/tonic/dart_converter.h"
#include "sky/engine/tonic/dart_builtin.h"
-#include "sky/engine/wtf/text/StringBuilder.h"
namespace blink {
@@ -18,23 +17,23 @@ DartExceptionFactory::~DartExceptionFactory() {
}
Dart_Handle DartExceptionFactory::CreateNullArgumentException(int index) {
- StringBuilder message;
- message.appendLiteral("Argument ");
- message.appendNumber(index);
- message.appendLiteral(" cannot be null.");
- return CreateException("ArgumentError", message.toString());
+ std::string message;
+ message.append("Argument ");
+ message.append(std::to_string(index));
+ message.append(" cannot be null.");
abarth-chromium 2015/07/15 20:42:52 This is super inefficient. Is there no StringBuil
+ return CreateException("ArgumentError", message);
}
-Dart_Handle DartExceptionFactory::CreateException(const String& class_name,
- const String& message) {
+Dart_Handle DartExceptionFactory::CreateException(const std::string& class_name,
+ const std::string& message) {
if (core_library_.is_empty()) {
Dart_Handle library = DartBuiltin::LookupLibrary("dart:core");
core_library_.Set(dart_state_, library);
}
Dart_Handle exception_class = Dart_GetType(
- core_library_.value(), StringToDart(dart_state_, class_name), 0, 0);
- Dart_Handle message_handle = StringToDart(dart_state_, message);
+ core_library_.value(), StdStringToDart(class_name), 0, 0);
+ Dart_Handle message_handle = StdStringToDart(message);
return Dart_New(exception_class, Dart_EmptyString(), 1, &message_handle);
}
« no previous file with comments | « sky/engine/tonic/dart_exception_factory.h ('k') | sky/engine/tonic/dart_library_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698