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

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

Issue 2882193002: [devtools] Add DOMSnapshot domain for dom+layout+style snapshots. (Closed)
Patch Set: move aux properties back to node type Created 3 years, 6 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
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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 pierce.fromMaybe(false), 469 pierce.fromMaybe(false),
470 document_node_to_id_map_.Get()); 470 document_node_to_id_map_.Get());
471 return Response::OK(); 471 return Response::OK();
472 } 472 }
473 473
474 Response InspectorDOMAgent::getFlattenedDocument( 474 Response InspectorDOMAgent::getFlattenedDocument(
475 Maybe<int> depth, 475 Maybe<int> depth,
476 Maybe<bool> pierce, 476 Maybe<bool> pierce,
477 std::unique_ptr<protocol::Array<protocol::DOM::Node>>* nodes) { 477 std::unique_ptr<protocol::Array<protocol::DOM::Node>>* nodes) {
478 if (!Enabled()) 478 if (!Enabled())
479 return Response::Error("Document not enabled"); 479 return Response::Error("DOM agent hasn't been enabled");
480 480
481 if (!document_) 481 if (!document_)
482 return Response::Error("Document is not available"); 482 return Response::Error("Document is not available");
483 483
484 DiscardFrontendBindings(); 484 DiscardFrontendBindings();
485 485
486 int sanitized_depth = depth.fromMaybe(-1); 486 int sanitized_depth = depth.fromMaybe(-1);
487 if (sanitized_depth == -1) 487 if (sanitized_depth == -1)
488 sanitized_depth = INT_MAX; 488 sanitized_depth = INT_MAX;
489 489
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 return Response::OK(); 1322 return Response::OK();
1323 } 1323 }
1324 1324
1325 // static 1325 // static
1326 String InspectorDOMAgent::DocumentURLString(Document* document) { 1326 String InspectorDOMAgent::DocumentURLString(Document* document) {
1327 if (!document || document->Url().IsNull()) 1327 if (!document || document->Url().IsNull())
1328 return ""; 1328 return "";
1329 return document->Url().GetString(); 1329 return document->Url().GetString();
1330 } 1330 }
1331 1331
1332 static String DocumentBaseURLString(Document* document) { 1332 // static
1333 String InspectorDOMAgent::DocumentBaseURLString(Document* document) {
1333 return document->BaseURLForOverride(document->BaseURL()).GetString(); 1334 return document->BaseURLForOverride(document->BaseURL()).GetString();
1334 } 1335 }
1335 1336
1336 static protocol::DOM::ShadowRootType GetShadowRootType( 1337 static protocol::DOM::ShadowRootType GetShadowRootType(
1337 ShadowRoot* shadow_root) { 1338 ShadowRoot* shadow_root) {
1338 switch (shadow_root->GetType()) { 1339 switch (shadow_root->GetType()) {
1339 case ShadowRootType::kUserAgent: 1340 case ShadowRootType::kUserAgent:
1340 return protocol::DOM::ShadowRootTypeEnum::UserAgent; 1341 return protocol::DOM::ShadowRootTypeEnum::UserAgent;
1341 case ShadowRootType::V0: 1342 case ShadowRootType::V0:
1342 case ShadowRootType::kOpen: 1343 case ShadowRootType::kOpen:
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
2164 visitor->Trace(id_to_nodes_map_); 2165 visitor->Trace(id_to_nodes_map_);
2165 visitor->Trace(document_); 2166 visitor->Trace(document_);
2166 visitor->Trace(revalidate_task_); 2167 visitor->Trace(revalidate_task_);
2167 visitor->Trace(search_results_); 2168 visitor->Trace(search_results_);
2168 visitor->Trace(history_); 2169 visitor->Trace(history_);
2169 visitor->Trace(dom_editor_); 2170 visitor->Trace(dom_editor_);
2170 InspectorBaseAgent::Trace(visitor); 2171 InspectorBaseAgent::Trace(visitor);
2171 } 2172 }
2172 2173
2173 } // namespace blink 2174 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698