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

Side by Side Diff: net/http/http_cache_transaction.cc

Issue 1135373002: Updated NetLog::ParametersCallback & all related calbacks returning value as scoped_ptr<base::Value… Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « net/ftp/ftp_ctrl_response_buffer.cc ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "net/http/http_cache_transaction.h" 5 #include "net/http/http_cache_transaction.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(OS_POSIX) 9 #if defined(OS_POSIX)
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 void RecordNoStoreHeaderHistogram(int load_flags, 176 void RecordNoStoreHeaderHistogram(int load_flags,
177 const HttpResponseInfo* response) { 177 const HttpResponseInfo* response) {
178 if (load_flags & LOAD_MAIN_FRAME) { 178 if (load_flags & LOAD_MAIN_FRAME) {
179 UMA_HISTOGRAM_BOOLEAN( 179 UMA_HISTOGRAM_BOOLEAN(
180 "Net.MainFrameNoStore", 180 "Net.MainFrameNoStore",
181 response->headers->HasHeaderValue("cache-control", "no-store")); 181 response->headers->HasHeaderValue("cache-control", "no-store"));
182 } 182 }
183 } 183 }
184 184
185 base::Value* NetLogAsyncRevalidationInfoCallback( 185 scoped_ptr<base::Value> NetLogAsyncRevalidationInfoCallback(
186 const NetLog::Source& source, 186 const NetLog::Source& source,
187 const HttpRequestInfo* request, 187 const HttpRequestInfo* request,
188 NetLogCaptureMode capture_mode) { 188 NetLogCaptureMode capture_mode) {
189 base::DictionaryValue* dict = new base::DictionaryValue(); 189 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
190 source.AddToEventParameters(dict); 190 source.AddToEventParameters(dict.get());
191 191
192 dict->SetString("url", request->url.possibly_invalid_spec()); 192 dict->SetString("url", request->url.possibly_invalid_spec());
193 dict->SetString("method", request->method); 193 dict->SetString("method", request->method);
194 return dict; 194 return dict.Pass();
195 } 195 }
196 196
197 enum ExternallyConditionalizedType { 197 enum ExternallyConditionalizedType {
198 EXTERNALLY_CONDITIONALIZED_CACHE_REQUIRES_VALIDATION, 198 EXTERNALLY_CONDITIONALIZED_CACHE_REQUIRES_VALIDATION,
199 EXTERNALLY_CONDITIONALIZED_CACHE_USABLE, 199 EXTERNALLY_CONDITIONALIZED_CACHE_USABLE,
200 EXTERNALLY_CONDITIONALIZED_MISMATCHED_VALIDATORS, 200 EXTERNALLY_CONDITIONALIZED_MISMATCHED_VALIDATORS,
201 EXTERNALLY_CONDITIONALIZED_MAX 201 EXTERNALLY_CONDITIONALIZED_MAX
202 }; 202 };
203 203
204 } // namespace 204 } // namespace
(...skipping 2399 matching lines...) Expand 10 before | Expand all | Expand 10 after
2604 2604
2605 void HttpCache::Transaction::TriggerAsyncValidation() { 2605 void HttpCache::Transaction::TriggerAsyncValidation() {
2606 DCHECK(!request_->upload_data_stream); 2606 DCHECK(!request_->upload_data_stream);
2607 BoundNetLog async_revalidation_net_log( 2607 BoundNetLog async_revalidation_net_log(
2608 BoundNetLog::Make(net_log_.net_log(), NetLog::SOURCE_ASYNC_REVALIDATION)); 2608 BoundNetLog::Make(net_log_.net_log(), NetLog::SOURCE_ASYNC_REVALIDATION));
2609 net_log_.AddEvent( 2609 net_log_.AddEvent(
2610 NetLog::TYPE_HTTP_CACHE_VALIDATE_RESOURCE_ASYNC, 2610 NetLog::TYPE_HTTP_CACHE_VALIDATE_RESOURCE_ASYNC,
2611 async_revalidation_net_log.source().ToEventParametersCallback()); 2611 async_revalidation_net_log.source().ToEventParametersCallback());
2612 async_revalidation_net_log.BeginEvent( 2612 async_revalidation_net_log.BeginEvent(
2613 NetLog::TYPE_ASYNC_REVALIDATION, 2613 NetLog::TYPE_ASYNC_REVALIDATION,
2614 base::Bind( 2614 base::Bind(NetLogAsyncRevalidationInfoCallback, net_log_.source(),
2615 &NetLogAsyncRevalidationInfoCallback, net_log_.source(), request_)); 2615 request_));
2616 base::MessageLoop::current()->PostTask( 2616 base::MessageLoop::current()->PostTask(
2617 FROM_HERE, 2617 FROM_HERE,
2618 base::Bind(&HttpCache::PerformAsyncValidation, 2618 base::Bind(&HttpCache::PerformAsyncValidation,
2619 cache_, // cache_ is a weak pointer. 2619 cache_, // cache_ is a weak pointer.
2620 *request_, 2620 *request_,
2621 async_revalidation_net_log)); 2621 async_revalidation_net_log));
2622 } 2622 }
2623 2623
2624 void HttpCache::Transaction::FailRangeRequest() { 2624 void HttpCache::Transaction::FailRangeRequest() {
2625 response_ = *new_response_; 2625 response_ = *new_response_;
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
2979 default: 2979 default:
2980 NOTREACHED(); 2980 NOTREACHED();
2981 } 2981 }
2982 } 2982 }
2983 2983
2984 void HttpCache::Transaction::OnIOComplete(int result) { 2984 void HttpCache::Transaction::OnIOComplete(int result) {
2985 DoLoop(result); 2985 DoLoop(result);
2986 } 2986 }
2987 2987
2988 } // namespace net 2988 } // namespace net
OLDNEW
« no previous file with comments | « net/ftp/ftp_ctrl_response_buffer.cc ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698