| 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 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1820 #ifdef V8_INSPECTOR_ENABLED | 1820 #ifdef V8_INSPECTOR_ENABLED |
| 1821 class InspectorFrontend final : public v8_inspector::V8Inspector::Channel { | 1821 class InspectorFrontend final : public v8_inspector::V8Inspector::Channel { |
| 1822 public: | 1822 public: |
| 1823 explicit InspectorFrontend(Local<Context> context) { | 1823 explicit InspectorFrontend(Local<Context> context) { |
| 1824 isolate_ = context->GetIsolate(); | 1824 isolate_ = context->GetIsolate(); |
| 1825 context_.Reset(isolate_, context); | 1825 context_.Reset(isolate_, context); |
| 1826 } | 1826 } |
| 1827 virtual ~InspectorFrontend() = default; | 1827 virtual ~InspectorFrontend() = default; |
| 1828 | 1828 |
| 1829 private: | 1829 private: |
| 1830 void sendProtocolResponse(int callId, | 1830 void sendResponse( |
| 1831 const v8_inspector::StringView& message) override { | 1831 int callId, |
| 1832 Send(message); | 1832 std::unique_ptr<v8_inspector::StringBuffer> message) override { |
| 1833 Send(message->string()); |
| 1833 } | 1834 } |
| 1834 void sendProtocolNotification( | 1835 void sendNotification( |
| 1835 const v8_inspector::StringView& message) override { | 1836 std::unique_ptr<v8_inspector::StringBuffer> message) override { |
| 1836 Send(message); | 1837 Send(message->string()); |
| 1837 } | 1838 } |
| 1838 void flushProtocolNotifications() override {} | 1839 void flushProtocolNotifications() override {} |
| 1839 | 1840 |
| 1840 void Send(const v8_inspector::StringView& string) { | 1841 void Send(const v8_inspector::StringView& string) { |
| 1841 int length = static_cast<int>(string.length()); | 1842 int length = static_cast<int>(string.length()); |
| 1842 DCHECK(length < v8::String::kMaxLength); | 1843 DCHECK(length < v8::String::kMaxLength); |
| 1843 Local<String> message = | 1844 Local<String> message = |
| 1844 (string.is8Bit() | 1845 (string.is8Bit() |
| 1845 ? v8::String::NewFromOneByte( | 1846 ? v8::String::NewFromOneByte( |
| 1846 isolate_, | 1847 isolate_, |
| (...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3020 } | 3021 } |
| 3021 | 3022 |
| 3022 } // namespace v8 | 3023 } // namespace v8 |
| 3023 | 3024 |
| 3024 | 3025 |
| 3025 #ifndef GOOGLE3 | 3026 #ifndef GOOGLE3 |
| 3026 int main(int argc, char* argv[]) { | 3027 int main(int argc, char* argv[]) { |
| 3027 return v8::Shell::Main(argc, argv); | 3028 return v8::Shell::Main(argc, argv); |
| 3028 } | 3029 } |
| 3029 #endif | 3030 #endif |
| OLD | NEW |