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

Side by Side Diff: Source/bindings/core/v8/ScriptDebugServer.cpp

Issue 1027593003: bindings: Use Maybe version of v8::String::NewFromUtf8() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 /* 1 /*
2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. 2 * Copyright (c) 2010-2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 m_debuggerScript.Reset(); 660 m_debuggerScript.Reset();
661 } 661 }
662 662
663 v8::Local<v8::Object> ScriptDebugServer::debuggerScriptLocal() const 663 v8::Local<v8::Object> ScriptDebugServer::debuggerScriptLocal() const
664 { 664 {
665 return v8::Local<v8::Object>::New(m_isolate, m_debuggerScript); 665 return v8::Local<v8::Object>::New(m_isolate, m_debuggerScript);
666 } 666 }
667 667
668 v8::Local<v8::String> ScriptDebugServer::v8InternalizedString(const char* str) c onst 668 v8::Local<v8::String> ScriptDebugServer::v8InternalizedString(const char* str) c onst
669 { 669 {
670 return v8::String::NewFromUtf8(m_isolate, str, v8::String::kInternalizedStri ng); 670 return v8AtomicString(m_isolate, str);
671 } 671 }
672 672
673 v8::Local<v8::Value> ScriptDebugServer::functionScopes(v8::Handle<v8::Function> function) 673 v8::Local<v8::Value> ScriptDebugServer::functionScopes(v8::Handle<v8::Function> function)
674 { 674 {
675 ensureDebuggerScriptCompiled(); 675 ensureDebuggerScriptCompiled();
676 676
677 v8::Handle<v8::Value> argv[] = { function }; 677 v8::Handle<v8::Value> argv[] = { function };
678 return callDebuggerMethod("getFunctionScopes", 1, argv); 678 return callDebuggerMethod("getFunctionScopes", 1, argv);
679 } 679 }
680 680
(...skipping 18 matching lines...) Expand all
699 if (m_debuggerScript.IsEmpty()) 699 if (m_debuggerScript.IsEmpty())
700 return v8::Local<v8::Value>::New(m_isolate, v8::Undefined(m_isolate)); 700 return v8::Local<v8::Value>::New(m_isolate, v8::Undefined(m_isolate));
701 701
702 v8::Handle<v8::Value> argv[] = { object }; 702 v8::Handle<v8::Value> argv[] = { object };
703 return callDebuggerMethod("getInternalProperties", 1, argv); 703 return callDebuggerMethod("getInternalProperties", 1, argv);
704 } 704 }
705 705
706 v8::Handle<v8::Value> ScriptDebugServer::setFunctionVariableValue(v8::Handle<v8: :Value> functionValue, int scopeNumber, const String& variableName, v8::Handle<v 8::Value> newValue) 706 v8::Handle<v8::Value> ScriptDebugServer::setFunctionVariableValue(v8::Handle<v8: :Value> functionValue, int scopeNumber, const String& variableName, v8::Handle<v 8::Value> newValue)
707 { 707 {
708 if (m_debuggerScript.IsEmpty()) 708 if (m_debuggerScript.IsEmpty())
709 return m_isolate->ThrowException(v8::String::NewFromUtf8(m_isolate, "Deb ugging is not enabled.")); 709 return m_isolate->ThrowException(v8NormalString(m_isolate, "Debugging is not enabled."));
710 710
711 v8::Handle<v8::Value> argv[] = { 711 v8::Handle<v8::Value> argv[] = {
712 functionValue, 712 functionValue,
713 v8::Handle<v8::Value>(v8::Integer::New(m_isolate, scopeNumber)), 713 v8::Handle<v8::Value>(v8::Integer::New(m_isolate, scopeNumber)),
714 v8String(m_isolate, variableName), 714 v8String(m_isolate, variableName),
715 newValue 715 newValue
716 }; 716 };
717 return callDebuggerMethod("setFunctionVariableValue", 4, argv); 717 return callDebuggerMethod("setFunctionVariableValue", 4, argv);
718 } 718 }
719 719
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 *lineNumber = message->GetLineNumber(); 782 *lineNumber = message->GetLineNumber();
783 *columnNumber = message->GetStartColumn(); 783 *columnNumber = message->GetStartColumn();
784 v8::Handle<v8::StackTrace> messageStackTrace = message->GetStackTrac e(); 784 v8::Handle<v8::StackTrace> messageStackTrace = message->GetStackTrac e();
785 if (!messageStackTrace.IsEmpty() && messageStackTrace->GetFrameCount () > 0) 785 if (!messageStackTrace.IsEmpty() && messageStackTrace->GetFrameCount () > 0)
786 *stackTrace = createScriptCallStack(m_isolate, messageStackTrace , messageStackTrace->GetFrameCount()); 786 *stackTrace = createScriptCallStack(m_isolate, messageStackTrace , messageStackTrace->GetFrameCount());
787 } 787 }
788 } 788 }
789 } 789 }
790 790
791 } // namespace blink 791 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/core/v8/ScriptValueSerializer.cpp » ('j') | Source/bindings/core/v8/V8Binding.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698