OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/devtools/devtools_netlog_observer.h" | 5 #include "content/browser/devtools/devtools_netlog_observer.h" |
6 | 6 |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "content/public/browser/content_browser_client.h" | 10 #include "content/public/browser/content_browser_client.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 default: | 162 default: |
163 break; | 163 break; |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 void DevToolsNetLogObserver::Attach() { | 167 void DevToolsNetLogObserver::Attach() { |
168 DCHECK(!instance_); | 168 DCHECK(!instance_); |
169 net::NetLog* net_log = GetContentClient()->browser()->GetNetLog(); | 169 net::NetLog* net_log = GetContentClient()->browser()->GetNetLog(); |
170 if (net_log) { | 170 if (net_log) { |
171 instance_ = new DevToolsNetLogObserver(); | 171 instance_ = new DevToolsNetLogObserver(); |
172 net_log->DeprecatedAddObserver(instance_, net::NetLog::LOG_ALL_BUT_BYTES); | 172 net_log->DeprecatedAddObserver( |
| 173 instance_, net::NetLogCaptureMode::IncludeCookiesAndCredentials()); |
173 } | 174 } |
174 } | 175 } |
175 | 176 |
176 void DevToolsNetLogObserver::Detach() { | 177 void DevToolsNetLogObserver::Detach() { |
177 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 178 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
178 | 179 |
179 if (instance_) { | 180 if (instance_) { |
180 // Safest not to do this in the destructor to maintain thread safety across | 181 // Safest not to do this in the destructor to maintain thread safety across |
181 // refactorings. | 182 // refactorings. |
182 instance_->net_log()->DeprecatedRemoveObserver(instance_); | 183 instance_->net_log()->DeprecatedRemoveObserver(instance_); |
(...skipping 18 matching lines...) Expand all Loading... |
201 uint32 source_id = request->net_log().source().id; | 202 uint32 source_id = request->net_log().source().id; |
202 DevToolsNetLogObserver* dev_tools_net_log_observer = | 203 DevToolsNetLogObserver* dev_tools_net_log_observer = |
203 DevToolsNetLogObserver::GetInstance(); | 204 DevToolsNetLogObserver::GetInstance(); |
204 if (dev_tools_net_log_observer == NULL) | 205 if (dev_tools_net_log_observer == NULL) |
205 return; | 206 return; |
206 response->head.devtools_info = | 207 response->head.devtools_info = |
207 dev_tools_net_log_observer->GetResourceInfo(source_id); | 208 dev_tools_net_log_observer->GetResourceInfo(source_id); |
208 } | 209 } |
209 | 210 |
210 } // namespace content | 211 } // namespace content |
OLD | NEW |