Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: Source/core/inspector/InspectorDOMAgent.cpp

Issue 614323003: DevTools: enable by default disableAgentsWhenProfile experiment (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: unnecessary line was removed Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 m_instrumentingAgents->setInspectorDOMAgent(0); 283 m_instrumentingAgents->setInspectorDOMAgent(0);
284 disable(0); 284 disable(0);
285 reset(); 285 reset();
286 } 286 }
287 287
288 void InspectorDOMAgent::restore() 288 void InspectorDOMAgent::restore()
289 { 289 {
290 if (!enabled()) 290 if (!enabled())
291 return; 291 return;
292 innerEnable(); 292 innerEnable();
293 notifyDocumentUpdated();
294 } 293 }
295 294
296 WillBeHeapVector<RawPtrWillBeMember<Document> > InspectorDOMAgent::documents() 295 WillBeHeapVector<RawPtrWillBeMember<Document> > InspectorDOMAgent::documents()
297 { 296 {
298 WillBeHeapVector<RawPtrWillBeMember<Document> > result; 297 WillBeHeapVector<RawPtrWillBeMember<Document> > result;
299 for (Frame* frame = m_document->frame(); frame; frame = frame->tree().traver seNext()) { 298 for (Frame* frame = m_document->frame(); frame; frame = frame->tree().traver seNext()) {
300 if (!frame->isLocalFrame()) 299 if (!frame->isLocalFrame())
301 continue; 300 continue;
302 Document* document = toLocalFrame(frame)->document(); 301 Document* document = toLocalFrame(frame)->document();
303 if (!document) 302 if (!document)
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 *errorString = "Cannot edit pseudo elements"; 505 *errorString = "Cannot edit pseudo elements";
507 return 0; 506 return 0;
508 } 507 }
509 508
510 return element; 509 return element;
511 } 510 }
512 511
513 void InspectorDOMAgent::innerEnable() 512 void InspectorDOMAgent::innerEnable()
514 { 513 {
515 m_state->setBoolean(DOMAgentState::domAgentEnabled, true); 514 m_state->setBoolean(DOMAgentState::domAgentEnabled, true);
515 m_document = nullptr;
516 setDocument(m_pageAgent->mainFrame()->document());
516 if (m_listener) 517 if (m_listener)
517 m_listener->domAgentWasEnabled(); 518 m_listener->domAgentWasEnabled();
518 } 519 }
519 520
520 void InspectorDOMAgent::enable(ErrorString*) 521 void InspectorDOMAgent::enable(ErrorString*)
521 { 522 {
522 if (enabled()) 523 if (enabled())
523 return; 524 return;
524 innerEnable(); 525 innerEnable();
525 notifyDocumentUpdated();
526 }
527
528 void InspectorDOMAgent::notifyDocumentUpdated()
529 {
530 m_document = nullptr;
531 setDocument(m_pageAgent->mainFrame()->document());
532 } 526 }
533 527
534 bool InspectorDOMAgent::enabled() const 528 bool InspectorDOMAgent::enabled() const
535 { 529 {
536 return m_state->getBoolean(DOMAgentState::domAgentEnabled); 530 return m_state->getBoolean(DOMAgentState::domAgentEnabled);
537 } 531 }
538 532
539 void InspectorDOMAgent::disable(ErrorString* errorString) 533 void InspectorDOMAgent::disable(ErrorString* errorString)
540 { 534 {
541 if (!enabled()) { 535 if (!enabled()) {
(...skipping 1655 matching lines...) Expand 10 before | Expand all | Expand 10 after
2197 visitor->trace(m_searchResults); 2191 visitor->trace(m_searchResults);
2198 #endif 2192 #endif
2199 visitor->trace(m_history); 2193 visitor->trace(m_history);
2200 visitor->trace(m_domEditor); 2194 visitor->trace(m_domEditor);
2201 visitor->trace(m_listener); 2195 visitor->trace(m_listener);
2202 InspectorBaseAgent::trace(visitor); 2196 InspectorBaseAgent::trace(visitor);
2203 } 2197 }
2204 2198
2205 } // namespace blink 2199 } // namespace blink
2206 2200
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698