| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 "test/inspector/inspector-impl.h" | 5 #include "test/inspector/inspector-impl.h" |
| 6 | 6 |
| 7 #include "include/v8.h" | 7 #include "include/v8.h" |
| 8 | 8 |
| 9 #include "src/vector.h" | 9 #include "src/vector.h" |
| 10 | 10 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 inspector_->contextCreated( | 131 inspector_->contextCreated( |
| 132 v8_inspector::V8ContextInfo(context, 1, v8_inspector::StringView())); | 132 v8_inspector::V8ContextInfo(context, 1, v8_inspector::StringView())); |
| 133 context_.Reset(isolate_, context); | 133 context_.Reset(isolate_, context); |
| 134 } | 134 } |
| 135 | 135 |
| 136 v8::Local<v8::Context> InspectorClientImpl::ensureDefaultContextInGroup(int) { | 136 v8::Local<v8::Context> InspectorClientImpl::ensureDefaultContextInGroup(int) { |
| 137 CHECK(isolate_); | 137 CHECK(isolate_); |
| 138 return context_.Get(isolate_); | 138 return context_.Get(isolate_); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void InspectorClientImpl::setCurrentTimeMSForTest(double time) { |
| 142 current_time_ = time; |
| 143 current_time_set_for_test_ = true; |
| 144 } |
| 145 |
| 141 double InspectorClientImpl::currentTimeMS() { | 146 double InspectorClientImpl::currentTimeMS() { |
| 147 if (current_time_set_for_test_) return current_time_; |
| 142 return v8::base::OS::TimeCurrentMillis(); | 148 return v8::base::OS::TimeCurrentMillis(); |
| 143 } | 149 } |
| 144 | 150 |
| 145 void InspectorClientImpl::runMessageLoopOnPause(int) { | 151 void InspectorClientImpl::runMessageLoopOnPause(int) { |
| 146 task_runner_->RunMessageLoop(true); | 152 task_runner_->RunMessageLoop(true); |
| 147 } | 153 } |
| 148 | 154 |
| 149 void InspectorClientImpl::quitMessageLoopOnPause() { | 155 void InspectorClientImpl::quitMessageLoopOnPause() { |
| 150 task_runner_->QuitMessageLoop(); | 156 task_runner_->QuitMessageLoop(); |
| 151 } | 157 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 isolate, SendMessageToBackendExtension::SendMessageToBackend); | 200 isolate, SendMessageToBackendExtension::SendMessageToBackend); |
| 195 } | 201 } |
| 196 | 202 |
| 197 void SendMessageToBackendExtension::SendMessageToBackend( | 203 void SendMessageToBackendExtension::SendMessageToBackend( |
| 198 const v8::FunctionCallbackInfo<v8::Value>& args) { | 204 const v8::FunctionCallbackInfo<v8::Value>& args) { |
| 199 CHECK(backend_task_runner_); | 205 CHECK(backend_task_runner_); |
| 200 CHECK(args.Length() == 1 && args[0]->IsString()); | 206 CHECK(args.Length() == 1 && args[0]->IsString()); |
| 201 v8::Local<v8::String> message = args[0].As<v8::String>(); | 207 v8::Local<v8::String> message = args[0].As<v8::String>(); |
| 202 backend_task_runner_->Append(new SendMessageToBackendTask(ToVector(message))); | 208 backend_task_runner_->Append(new SendMessageToBackendTask(ToVector(message))); |
| 203 } | 209 } |
| OLD | NEW |