OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project 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 <errno.h> | 5 #include <errno.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 #include <string.h> | 7 #include <string.h> |
8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 1849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1860 static void SendInspectorMessage( | 1860 static void SendInspectorMessage( |
1861 const v8::FunctionCallbackInfo<v8::Value>& args) { | 1861 const v8::FunctionCallbackInfo<v8::Value>& args) { |
1862 Isolate* isolate = args.GetIsolate(); | 1862 Isolate* isolate = args.GetIsolate(); |
1863 v8::HandleScope handle_scope(isolate); | 1863 v8::HandleScope handle_scope(isolate); |
1864 Local<Context> context = isolate->GetCurrentContext(); | 1864 Local<Context> context = isolate->GetCurrentContext(); |
1865 args.GetReturnValue().Set(Undefined(isolate)); | 1865 args.GetReturnValue().Set(Undefined(isolate)); |
1866 Local<String> message = args[0]->ToString(context).ToLocalChecked(); | 1866 Local<String> message = args[0]->ToString(context).ToLocalChecked(); |
1867 v8_inspector::V8InspectorSession* session = | 1867 v8_inspector::V8InspectorSession* session = |
1868 InspectorClient::GetSession(context); | 1868 InspectorClient::GetSession(context); |
1869 int length = message->Length(); | 1869 int length = message->Length(); |
1870 std::unique_ptr<uint16_t> buffer(new uint16_t[length]); | 1870 std::unique_ptr<uint16_t[]> buffer(new uint16_t[length]); |
1871 message->Write(buffer.get(), 0, length); | 1871 message->Write(buffer.get(), 0, length); |
1872 v8_inspector::StringView message_view(buffer.get(), length); | 1872 v8_inspector::StringView message_view(buffer.get(), length); |
1873 session->dispatchProtocolMessage(message_view); | 1873 session->dispatchProtocolMessage(message_view); |
1874 args.GetReturnValue().Set(True(isolate)); | 1874 args.GetReturnValue().Set(True(isolate)); |
1875 } | 1875 } |
1876 | 1876 |
1877 static const int kContextGroupId = 1; | 1877 static const int kContextGroupId = 1; |
1878 | 1878 |
1879 std::unique_ptr<v8_inspector::V8Inspector> inspector_; | 1879 std::unique_ptr<v8_inspector::V8Inspector> inspector_; |
1880 std::unique_ptr<v8_inspector::V8InspectorSession> session_; | 1880 std::unique_ptr<v8_inspector::V8InspectorSession> session_; |
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2948 } | 2948 } |
2949 | 2949 |
2950 } // namespace v8 | 2950 } // namespace v8 |
2951 | 2951 |
2952 | 2952 |
2953 #ifndef GOOGLE3 | 2953 #ifndef GOOGLE3 |
2954 int main(int argc, char* argv[]) { | 2954 int main(int argc, char* argv[]) { |
2955 return v8::Shell::Main(argc, argv); | 2955 return v8::Shell::Main(argc, argv); |
2956 } | 2956 } |
2957 #endif | 2957 #endif |
OLD | NEW |