| OLD | NEW |
| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 static const char kDevToolsActionTakenHistogram[] = "DevTools.ActionTaken"; | 81 static const char kDevToolsActionTakenHistogram[] = "DevTools.ActionTaken"; |
| 82 static const char kDevToolsPanelShownHistogram[] = "DevTools.PanelShown"; | 82 static const char kDevToolsPanelShownHistogram[] = "DevTools.PanelShown"; |
| 83 | 83 |
| 84 static const char kRemotePageActionInspect[] = "inspect"; | 84 static const char kRemotePageActionInspect[] = "inspect"; |
| 85 static const char kRemotePageActionReload[] = "reload"; | 85 static const char kRemotePageActionReload[] = "reload"; |
| 86 static const char kRemotePageActionActivate[] = "activate"; | 86 static const char kRemotePageActionActivate[] = "activate"; |
| 87 static const char kRemotePageActionClose[] = "close"; | 87 static const char kRemotePageActionClose[] = "close"; |
| 88 | 88 |
| 89 // This constant should be in sync with | 89 // This constant should be in sync with |
| 90 // the constant at shell_devtools_frontend.cc. | 90 // the constant at shell_devtools_frontend.cc. |
| 91 const size_t kMaxMessageChunkSize = IPC::Channel::kMaximumMessageSize / 4; | 91 const size_t kMaxMessageChunkSize = |
| 92 std::min(IPC::Channel::kMaximumMessageSize / 4, 20480ul); |
| 92 | 93 |
| 93 typedef std::vector<DevToolsUIBindings*> DevToolsUIBindingsList; | 94 typedef std::vector<DevToolsUIBindings*> DevToolsUIBindingsList; |
| 94 base::LazyInstance<DevToolsUIBindingsList>::Leaky g_instances = | 95 base::LazyInstance<DevToolsUIBindingsList>::Leaky g_instances = |
| 95 LAZY_INSTANCE_INITIALIZER; | 96 LAZY_INSTANCE_INITIALIZER; |
| 96 | 97 |
| 97 base::DictionaryValue* CreateFileSystemValue( | 98 base::DictionaryValue* CreateFileSystemValue( |
| 98 DevToolsFileHelper::FileSystem file_system) { | 99 DevToolsFileHelper::FileSystem file_system) { |
| 99 base::DictionaryValue* file_system_value = new base::DictionaryValue(); | 100 base::DictionaryValue* file_system_value = new base::DictionaryValue(); |
| 100 file_system_value->SetString("fileSystemName", file_system.file_system_name); | 101 file_system_value->SetString("fileSystemName", file_system.file_system_name); |
| 101 file_system_value->SetString("rootURL", file_system.root_url); | 102 file_system_value->SetString("rootURL", file_system.root_url); |
| (...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 void DevToolsUIBindings::FrontendLoaded() { | 1090 void DevToolsUIBindings::FrontendLoaded() { |
| 1090 if (frontend_loaded_) | 1091 if (frontend_loaded_) |
| 1091 return; | 1092 return; |
| 1092 frontend_loaded_ = true; | 1093 frontend_loaded_ = true; |
| 1093 | 1094 |
| 1094 // Call delegate first - it seeds importants bit of information. | 1095 // Call delegate first - it seeds importants bit of information. |
| 1095 delegate_->OnLoadCompleted(); | 1096 delegate_->OnLoadCompleted(); |
| 1096 | 1097 |
| 1097 AddDevToolsExtensionsToClient(); | 1098 AddDevToolsExtensionsToClient(); |
| 1098 } | 1099 } |
| OLD | NEW |