| OLD | NEW |
| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 visitor->Trace(trace_events_agent_); | 290 visitor->Trace(trace_events_agent_); |
| 291 visitor->Trace(overlay_agent_); | 291 visitor->Trace(overlay_agent_); |
| 292 visitor->Trace(session_); | 292 visitor->Trace(session_); |
| 293 } | 293 } |
| 294 | 294 |
| 295 void WebDevToolsAgentImpl::WillBeDestroyed() { | 295 void WebDevToolsAgentImpl::WillBeDestroyed() { |
| 296 DCHECK(web_local_frame_impl_->GetFrame()); | 296 DCHECK(web_local_frame_impl_->GetFrame()); |
| 297 DCHECK(inspected_frames_->Root()->View()); | 297 DCHECK(inspected_frames_->Root()->View()); |
| 298 instrumenting_agents_->removeInspectorTraceEvents(trace_events_agent_); | 298 instrumenting_agents_->removeInspectorTraceEvents(trace_events_agent_); |
| 299 trace_events_agent_ = nullptr; | 299 trace_events_agent_ = nullptr; |
| 300 Detach(); | 300 if (session_) |
| 301 Detach(session_->SessionId()); |
| 301 resource_content_loader_->Dispose(); | 302 resource_content_loader_->Dispose(); |
| 302 client_ = nullptr; | 303 client_ = nullptr; |
| 303 } | 304 } |
| 304 | 305 |
| 305 void WebDevToolsAgentImpl::InitializeSession(int session_id, | 306 void WebDevToolsAgentImpl::InitializeSession(int session_id, |
| 306 const String& host_id, | 307 const String& host_id, |
| 307 String* state) { | 308 String* state) { |
| 308 DCHECK(client_); | 309 DCHECK(client_); |
| 309 ClientMessageLoopAdapter::EnsureMainThreadDebuggerCreated(client_); | 310 ClientMessageLoopAdapter::EnsureMainThreadDebuggerCreated(client_); |
| 310 MainThreadDebugger* main_thread_debugger = MainThreadDebugger::Instance(); | 311 MainThreadDebugger* main_thread_debugger = MainThreadDebugger::Instance(); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 void WebDevToolsAgentImpl::Reattach(const WebString& host_id, | 422 void WebDevToolsAgentImpl::Reattach(const WebString& host_id, |
| 422 int session_id, | 423 int session_id, |
| 423 const WebString& saved_state) { | 424 const WebString& saved_state) { |
| 424 if (Attached()) | 425 if (Attached()) |
| 425 return; | 426 return; |
| 426 String state = saved_state; | 427 String state = saved_state; |
| 427 InitializeSession(session_id, host_id, &state); | 428 InitializeSession(session_id, host_id, &state); |
| 428 session_->Restore(); | 429 session_->Restore(); |
| 429 } | 430 } |
| 430 | 431 |
| 431 void WebDevToolsAgentImpl::Detach() { | 432 void WebDevToolsAgentImpl::Detach(int session_id) { |
| 432 if (!Attached()) | 433 if (!Attached() || session_id != session_->SessionId()) |
| 433 return; | 434 return; |
| 434 DestroySession(); | 435 DestroySession(); |
| 435 } | 436 } |
| 436 | 437 |
| 437 void WebDevToolsAgentImpl::ContinueProgram() { | 438 void WebDevToolsAgentImpl::ContinueProgram() { |
| 438 ClientMessageLoopAdapter::ContinueProgram(); | 439 ClientMessageLoopAdapter::ContinueProgram(); |
| 439 } | 440 } |
| 440 | 441 |
| 441 void WebDevToolsAgentImpl::DidCommitLoadForLocalFrame(LocalFrame* frame) { | 442 void WebDevToolsAgentImpl::DidCommitLoadForLocalFrame(LocalFrame* frame) { |
| 442 resource_container_->DidCommitLoadForLocalFrame(frame); | 443 resource_container_->DidCommitLoadForLocalFrame(frame); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 } | 633 } |
| 633 | 634 |
| 634 bool WebDevToolsAgent::ShouldInterruptForMethod(const WebString& method) { | 635 bool WebDevToolsAgent::ShouldInterruptForMethod(const WebString& method) { |
| 635 return method == "Debugger.pause" || method == "Debugger.setBreakpoint" || | 636 return method == "Debugger.pause" || method == "Debugger.setBreakpoint" || |
| 636 method == "Debugger.setBreakpointByUrl" || | 637 method == "Debugger.setBreakpointByUrl" || |
| 637 method == "Debugger.removeBreakpoint" || | 638 method == "Debugger.removeBreakpoint" || |
| 638 method == "Debugger.setBreakpointsActive"; | 639 method == "Debugger.setBreakpointsActive"; |
| 639 } | 640 } |
| 640 | 641 |
| 641 } // namespace blink | 642 } // namespace blink |
| OLD | NEW |