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 "net/log/net_log_util.h" | 5 #include "net/log/net_log_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 stats_dict->SetStringWithoutPathExpansion(stats[i].first, | 467 stats_dict->SetStringWithoutPathExpansion(stats[i].first, |
468 stats[i].second); | 468 stats[i].second); |
469 } | 469 } |
470 } | 470 } |
471 info_dict->Set("stats", stats_dict); | 471 info_dict->Set("stats", stats_dict); |
472 | 472 |
473 net_info_dict->Set(NetInfoSourceToString(NET_INFO_HTTP_CACHE), info_dict); | 473 net_info_dict->Set(NetInfoSourceToString(NET_INFO_HTTP_CACHE), info_dict); |
474 } | 474 } |
475 | 475 |
476 if (info_sources & NET_INFO_SDCH) { | 476 if (info_sources & NET_INFO_SDCH) { |
477 base::Value* info_dict; | 477 scoped_ptr<base::Value> info_dict; |
478 SdchManager* sdch_manager = context->sdch_manager(); | 478 SdchManager* sdch_manager = context->sdch_manager(); |
479 if (sdch_manager) { | 479 if (sdch_manager) { |
480 info_dict = sdch_manager->SdchInfoToValue(); | 480 info_dict = sdch_manager->SdchInfoToValue(); |
481 } else { | 481 } else { |
482 info_dict = new base::DictionaryValue(); | 482 info_dict.reset(new base::DictionaryValue()); |
483 } | 483 } |
484 net_info_dict->Set(NetInfoSourceToString(NET_INFO_SDCH), info_dict); | 484 net_info_dict->Set(NetInfoSourceToString(NET_INFO_SDCH), info_dict.Pass()); |
485 } | 485 } |
486 | 486 |
487 return net_info_dict.Pass(); | 487 return net_info_dict.Pass(); |
488 } | 488 } |
489 | 489 |
490 NET_EXPORT void CreateNetLogEntriesForActiveObjects( | 490 NET_EXPORT void CreateNetLogEntriesForActiveObjects( |
491 const std::set<URLRequestContext*>& contexts, | 491 const std::set<URLRequestContext*>& contexts, |
492 NetLog::ThreadSafeObserver* observer) { | 492 NetLog::ThreadSafeObserver* observer) { |
493 // Put together the list of all requests. | 493 // Put together the list of all requests. |
494 std::vector<const URLRequest*> requests; | 494 std::vector<const URLRequest*> requests; |
(...skipping 20 matching lines...) Expand all Loading... |
515 // fine, since GetRequestStateAsValue() ignores the capture mode. | 515 // fine, since GetRequestStateAsValue() ignores the capture mode. |
516 NetLog::EntryData entry_data( | 516 NetLog::EntryData entry_data( |
517 NetLog::TYPE_REQUEST_ALIVE, request->net_log().source(), | 517 NetLog::TYPE_REQUEST_ALIVE, request->net_log().source(), |
518 NetLog::PHASE_BEGIN, request->creation_time(), &callback); | 518 NetLog::PHASE_BEGIN, request->creation_time(), &callback); |
519 NetLog::Entry entry(&entry_data, NetLogCaptureMode::Default()); | 519 NetLog::Entry entry(&entry_data, NetLogCaptureMode::Default()); |
520 observer->OnAddEntry(entry); | 520 observer->OnAddEntry(entry); |
521 } | 521 } |
522 } | 522 } |
523 | 523 |
524 } // namespace net | 524 } // namespace net |
OLD | NEW |