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

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

Issue 1337523002: DevTools: issue detach notification when frontend api connection is kicked out. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | no next file » | 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/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/prefs/scoped_user_pref_update.h" 10 #include "base/prefs/scoped_user_pref_update.h"
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 bindings_->open_api_channel_ = nullptr; 394 bindings_->open_api_channel_ = nullptr;
395 } 395 }
396 396
397 void DevToolsUIBindings::WebSocketAPIChannel::DispatchOnClientHost( 397 void DevToolsUIBindings::WebSocketAPIChannel::DispatchOnClientHost(
398 const std::string& message) { 398 const std::string& message) {
399 if (attached_proxy_) 399 if (attached_proxy_)
400 attached_proxy_->DispatchOnClientHost(message); 400 attached_proxy_->DispatchOnClientHost(message);
401 } 401 }
402 402
403 void DevToolsUIBindings::WebSocketAPIChannel::ConnectionClosed() { 403 void DevToolsUIBindings::WebSocketAPIChannel::ConnectionClosed() {
404 if (bindings_) {
405 bindings_->CallClientFunction("DevToolsAPI.frontendAPIDetached",
406 nullptr, nullptr, nullptr);
407 }
404 if (attached_proxy_) 408 if (attached_proxy_)
405 attached_proxy_->ConnectionClosed(); 409 attached_proxy_->ConnectionClosed();
406 } 410 }
407 411
408 void DevToolsUIBindings::WebSocketAPIChannel::Attach( 412 void DevToolsUIBindings::WebSocketAPIChannel::Attach(
409 content::DevToolsExternalAgentProxy* proxy) { 413 content::DevToolsExternalAgentProxy* proxy) {
410 attached_proxy_ = proxy; 414 attached_proxy_ = proxy;
411 if (bindings_) { 415 if (bindings_) {
412 bindings_->CallClientFunction("DevToolsAPI.frontendAPIAttached", 416 bindings_->CallClientFunction("DevToolsAPI.frontendAPIAttached",
413 nullptr, nullptr, nullptr); 417 nullptr, nullptr, nullptr);
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 void DevToolsUIBindings::FrontendLoaded() { 1080 void DevToolsUIBindings::FrontendLoaded() {
1077 if (frontend_loaded_) 1081 if (frontend_loaded_)
1078 return; 1082 return;
1079 frontend_loaded_ = true; 1083 frontend_loaded_ = true;
1080 1084
1081 // Call delegate first - it seeds importants bit of information. 1085 // Call delegate first - it seeds importants bit of information.
1082 delegate_->OnLoadCompleted(); 1086 delegate_->OnLoadCompleted();
1083 1087
1084 AddDevToolsExtensionsToClient(); 1088 AddDevToolsExtensionsToClient();
1085 } 1089 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698