| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 Google Inc. All rights reserved. | 2 * Copyright (c) 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 : ThreadDebugger(isolate), | 99 : ThreadDebugger(isolate), |
| 100 task_runner_(WTF::MakeUnique<InspectorTaskRunner>()), | 100 task_runner_(WTF::MakeUnique<InspectorTaskRunner>()), |
| 101 paused_(false) { | 101 paused_(false) { |
| 102 MutexLocker locker(CreationMutex()); | 102 MutexLocker locker(CreationMutex()); |
| 103 DCHECK(!instance_); | 103 DCHECK(!instance_); |
| 104 instance_ = this; | 104 instance_ = this; |
| 105 } | 105 } |
| 106 | 106 |
| 107 MainThreadDebugger::~MainThreadDebugger() { | 107 MainThreadDebugger::~MainThreadDebugger() { |
| 108 MutexLocker locker(CreationMutex()); | 108 MutexLocker locker(CreationMutex()); |
| 109 ASSERT(instance_ == this); | 109 DCHECK_EQ(instance_, this); |
| 110 instance_ = nullptr; | 110 instance_ = nullptr; |
| 111 } | 111 } |
| 112 | 112 |
| 113 void MainThreadDebugger::ReportConsoleMessage(ExecutionContext* context, | 113 void MainThreadDebugger::ReportConsoleMessage(ExecutionContext* context, |
| 114 MessageSource source, | 114 MessageSource source, |
| 115 MessageLevel level, | 115 MessageLevel level, |
| 116 const String& message, | 116 const String& message, |
| 117 SourceLocation* location) { | 117 SourceLocation* location) { |
| 118 if (LocalFrame* frame = ToFrame(context)) | 118 if (LocalFrame* frame = ToFrame(context)) |
| 119 frame->Console().ReportMessageToClient(source, level, message, location); | 119 frame->Console().ReportMessageToClient(source, level, message, location); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 instance_->isolate_); | 235 instance_->isolate_); |
| 236 } | 236 } |
| 237 } | 237 } |
| 238 | 238 |
| 239 void MainThreadDebugger::runMessageLoopOnPause(int context_group_id) { | 239 void MainThreadDebugger::runMessageLoopOnPause(int context_group_id) { |
| 240 LocalFrame* paused_frame = | 240 LocalFrame* paused_frame = |
| 241 WeakIdentifierMap<LocalFrame>::Lookup(context_group_id); | 241 WeakIdentifierMap<LocalFrame>::Lookup(context_group_id); |
| 242 // Do not pause in Context of detached frame. | 242 // Do not pause in Context of detached frame. |
| 243 if (!paused_frame) | 243 if (!paused_frame) |
| 244 return; | 244 return; |
| 245 ASSERT(paused_frame == paused_frame->LocalFrameRoot()); | 245 DCHECK(paused_frame == paused_frame->LocalFrameRoot()); |
| 246 paused_ = true; | 246 paused_ = true; |
| 247 | 247 |
| 248 if (UserGestureToken* token = UserGestureIndicator::CurrentToken()) | 248 if (UserGestureToken* token = UserGestureIndicator::CurrentToken()) |
| 249 token->SetTimeoutPolicy(UserGestureToken::kHasPaused); | 249 token->SetTimeoutPolicy(UserGestureToken::kHasPaused); |
| 250 // Wait for continue or step command. | 250 // Wait for continue or step command. |
| 251 if (client_message_loop_) | 251 if (client_message_loop_) |
| 252 client_message_loop_->Run(paused_frame); | 252 client_message_loop_->Run(paused_frame); |
| 253 } | 253 } |
| 254 | 254 |
| 255 void MainThreadDebugger::quitMessageLoopOnPause() { | 255 void MainThreadDebugger::quitMessageLoopOnPause() { |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 context, nodes, index++, | 464 context, nodes, index++, |
| 465 ToV8(node, info.Holder(), info.GetIsolate())) | 465 ToV8(node, info.Holder(), info.GetIsolate())) |
| 466 .FromMaybe(false)) | 466 .FromMaybe(false)) |
| 467 return; | 467 return; |
| 468 } | 468 } |
| 469 info.GetReturnValue().Set(nodes); | 469 info.GetReturnValue().Set(nodes); |
| 470 } | 470 } |
| 471 } | 471 } |
| 472 | 472 |
| 473 } // namespace blink | 473 } // namespace blink |
| OLD | NEW |