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

Side by Side Diff: chrome/browser/devtools/devtools_ui_bindings.cc

Issue 744653002: Ignore DevTools messages from the old inspected RVH after navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comment Created 6 years 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
« no previous file with comments | « no previous file | content/browser/devtools/devtools_frontend_host_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium 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 "chrome/browser/devtools/devtools_ui_bindings.h" 5 #include "chrome/browser/devtools/devtools_ui_bindings.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 break; 274 break;
275 default: 275 default:
276 crashed = false; 276 crashed = false;
277 break; 277 break;
278 } 278 }
279 devtools_bindings_->delegate_->RenderProcessGone(crashed); 279 devtools_bindings_->delegate_->RenderProcessGone(crashed);
280 } 280 }
281 281
282 void DevToolsUIBindings::FrontendWebContentsObserver:: 282 void DevToolsUIBindings::FrontendWebContentsObserver::
283 AboutToNavigateRenderFrame(content::RenderFrameHost* render_frame_host) { 283 AboutToNavigateRenderFrame(content::RenderFrameHost* render_frame_host) {
284 // TODO(creis): Create should be refactored to operate on RenderFrameHosts. 284 if (render_frame_host->GetParent())
285 return;
285 devtools_bindings_->frontend_host_.reset( 286 devtools_bindings_->frontend_host_.reset(
286 content::DevToolsFrontendHost::Create( 287 content::DevToolsFrontendHost::Create(devtools_bindings_->web_contents(),
287 render_frame_host->GetRenderViewHost(), devtools_bindings_)); 288 devtools_bindings_));
288 } 289 }
289 290
290 void DevToolsUIBindings::FrontendWebContentsObserver:: 291 void DevToolsUIBindings::FrontendWebContentsObserver::
291 DocumentOnLoadCompletedInMainFrame() { 292 DocumentOnLoadCompletedInMainFrame() {
292 devtools_bindings_->DocumentOnLoadCompletedInMainFrame(); 293 devtools_bindings_->DocumentOnLoadCompletedInMainFrame();
293 } 294 }
294 295
295 void DevToolsUIBindings::FrontendWebContentsObserver:: 296 void DevToolsUIBindings::FrontendWebContentsObserver::
296 DidNavigateMainFrame(const content::LoadCommittedDetails& details, 297 DidNavigateMainFrame(const content::LoadCommittedDetails& details,
297 const content::FrameNavigateParams& params) { 298 const content::FrameNavigateParams& params) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 // Register on-load actions. 363 // Register on-load actions.
363 registrar_.Add( 364 registrar_.Add(
364 this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, 365 this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
365 content::Source<ThemeService>( 366 content::Source<ThemeService>(
366 ThemeServiceFactory::GetForProfile(profile_))); 367 ThemeServiceFactory::GetForProfile(profile_)));
367 368
368 embedder_message_dispatcher_.reset( 369 embedder_message_dispatcher_.reset(
369 DevToolsEmbedderMessageDispatcher::createForDevToolsFrontend(this)); 370 DevToolsEmbedderMessageDispatcher::createForDevToolsFrontend(this));
370 371
371 frontend_host_.reset( 372 frontend_host_.reset(
372 content::DevToolsFrontendHost::Create( 373 content::DevToolsFrontendHost::Create(web_contents_, this));
373 web_contents_->GetRenderViewHost(), this));
374 } 374 }
375 375
376 DevToolsUIBindings::~DevToolsUIBindings() { 376 DevToolsUIBindings::~DevToolsUIBindings() {
377 if (agent_host_.get()) 377 if (agent_host_.get())
378 agent_host_->DetachClient(); 378 agent_host_->DetachClient();
379 379
380 for (IndexingJobsMap::const_iterator jobs_it(indexing_jobs_.begin()); 380 for (IndexingJobsMap::const_iterator jobs_it(indexing_jobs_.begin());
381 jobs_it != indexing_jobs_.end(); ++jobs_it) { 381 jobs_it != indexing_jobs_.end(); ++jobs_it) {
382 jobs_it->second->Stop(); 382 jobs_it->second->Stop();
383 } 383 }
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 if (frontend_loaded_) 893 if (frontend_loaded_)
894 return; 894 return;
895 frontend_loaded_ = true; 895 frontend_loaded_ = true;
896 896
897 // Call delegate first - it seeds importants bit of information. 897 // Call delegate first - it seeds importants bit of information.
898 delegate_->OnLoadCompleted(); 898 delegate_->OnLoadCompleted();
899 899
900 UpdateTheme(); 900 UpdateTheme();
901 AddDevToolsExtensionsToClient(); 901 AddDevToolsExtensionsToClient();
902 } 902 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/devtools/devtools_frontend_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698