| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/debugger/devtools_netlog_observer.h" | 5 #include "content/browser/debugger/devtools_netlog_observer.h" |
| 6 | 6 |
| 7 #include "base/string_tokenizer.h" | 7 #include "base/string_tokenizer.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "content/common/resource_response.h" | 10 #include "content/common/resource_response.h" |
| 11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 #include "content/public/browser/content_browser_client.h" | 12 #include "content/public/browser/content_browser_client.h" |
| 13 #include "net/base/load_flags.h" | 13 #include "net/base/load_flags.h" |
| 14 #include "net/http/http_net_log_params.h" | 14 #include "net/http/http_net_log_params.h" |
| 15 #include "net/http/http_response_headers.h" | 15 #include "net/http/http_response_headers.h" |
| 16 #include "net/http/http_util.h" | 16 #include "net/http/http_util.h" |
| 17 #include "net/url_request/url_request.h" | 17 #include "net/url_request/url_request.h" |
| 18 #include "net/url_request/url_request_netlog_params.h" | 18 #include "net/url_request/url_request_netlog_params.h" |
| 19 #include "webkit/glue/resource_loader_bridge.h" | 19 #include "webkit/glue/resource_loader_bridge.h" |
| 20 | 20 |
| 21 using content::BrowserThread; |
| 22 |
| 21 const size_t kMaxNumEntries = 1000; | 23 const size_t kMaxNumEntries = 1000; |
| 22 | 24 |
| 23 DevToolsNetLogObserver* DevToolsNetLogObserver::instance_ = NULL; | 25 DevToolsNetLogObserver* DevToolsNetLogObserver::instance_ = NULL; |
| 24 | 26 |
| 25 DevToolsNetLogObserver::DevToolsNetLogObserver(net::NetLog* net_log) | 27 DevToolsNetLogObserver::DevToolsNetLogObserver(net::NetLog* net_log) |
| 26 : net::NetLog::ThreadSafeObserver(net::NetLog::LOG_ALL_BUT_BYTES), | 28 : net::NetLog::ThreadSafeObserver(net::NetLog::LOG_ALL_BUT_BYTES), |
| 27 net_log_(net_log) { | 29 net_log_(net_log) { |
| 28 net_log_->AddThreadSafeObserver(this); | 30 net_log_->AddThreadSafeObserver(this); |
| 29 } | 31 } |
| 30 | 32 |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 | 288 |
| 287 RequestToEncodedDataLengthMap::iterator it = | 289 RequestToEncodedDataLengthMap::iterator it = |
| 288 dev_tools_net_log_observer->request_to_encoded_data_length_.find( | 290 dev_tools_net_log_observer->request_to_encoded_data_length_.find( |
| 289 source_id); | 291 source_id); |
| 290 if (it == dev_tools_net_log_observer->request_to_encoded_data_length_.end()) | 292 if (it == dev_tools_net_log_observer->request_to_encoded_data_length_.end()) |
| 291 return -1; | 293 return -1; |
| 292 int encoded_data_length = it->second; | 294 int encoded_data_length = it->second; |
| 293 it->second = 0; | 295 it->second = 0; |
| 294 return encoded_data_length; | 296 return encoded_data_length; |
| 295 } | 297 } |
| OLD | NEW |