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

Side by Side Diff: chrome/browser/net/load_timing_observer_unittest.cc

Issue 11276050: Add upload identifier to URLRequest::Start net log event. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix unit test Created 8 years, 1 month 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 | « no previous file | net/base/net_log_event_type_list.h » ('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 "chrome/browser/net/load_timing_observer.h" 5 #include "chrome/browser/net/load_timing_observer.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/format_macros.h" 8 #include "base/format_macros.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 GURL url(base::StringPrintf("http://req%d", id)); 96 GURL url(base::StringPrintf("http://req%d", id));
97 std::string method = "GET"; 97 std::string method = "GET";
98 AddStartEntry( 98 AddStartEntry(
99 observer, 99 observer,
100 source, 100 source,
101 NetLog::TYPE_URL_REQUEST_START_JOB, 101 NetLog::TYPE_URL_REQUEST_START_JOB,
102 base::Bind(&net::NetLogURLRequestStartCallback, 102 base::Bind(&net::NetLogURLRequestStartCallback,
103 &url, 103 &url,
104 &method, 104 &method,
105 request_timing ? net::LOAD_ENABLE_LOAD_TIMING : 0, 105 request_timing ? net::LOAD_ENABLE_LOAD_TIMING : 0,
106 net::LOW)); 106 net::LOW,
107 -1));
107 } 108 }
108 109
109 void AddEndURLRequestEntries(LoadTimingObserver& observer, uint32 id) { 110 void AddEndURLRequestEntries(LoadTimingObserver& observer, uint32 id) {
110 NetLog::Source source(NetLog::SOURCE_URL_REQUEST, id); 111 NetLog::Source source(NetLog::SOURCE_URL_REQUEST, id);
111 AddEndEntry(observer, source, NetLog::TYPE_REQUEST_ALIVE); 112 AddEndEntry(observer, source, NetLog::TYPE_REQUEST_ALIVE);
112 AddEndEntry(observer, source, NetLog::TYPE_URL_REQUEST_START_JOB); 113 AddEndEntry(observer, source, NetLog::TYPE_URL_REQUEST_START_JOB);
113 } 114 }
114 115
115 void AddStartHTTPStreamJobEntries(LoadTimingObserver& observer, uint32 id) { 116 void AddStartHTTPStreamJobEntries(LoadTimingObserver& observer, uint32 id) {
116 NetLog::Source source(NetLog::SOURCE_HTTP_STREAM_JOB, id); 117 NetLog::Source source(NetLog::SOURCE_HTTP_STREAM_JOB, id);
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 AddStartHTTPStreamJobEntries(observer_, 2); 390 AddStartHTTPStreamJobEntries(observer_, 2);
390 391
391 BindHTTPStreamJobToSocket(observer_, http_stream_job_source, socket_source); 392 BindHTTPStreamJobToSocket(observer_, http_stream_job_source, socket_source);
392 BindURLRequestToHTTPStreamJob(observer_, source, http_stream_job_source); 393 BindURLRequestToHTTPStreamJob(observer_, source, http_stream_job_source);
393 394
394 LoadTimingObserver::URLRequestRecord* record = 395 LoadTimingObserver::URLRequestRecord* record =
395 observer_.GetURLRequestRecord(0); 396 observer_.GetURLRequestRecord(0);
396 ASSERT_EQ(1000, record->timing.ssl_start); 397 ASSERT_EQ(1000, record->timing.ssl_start);
397 ASSERT_EQ(3000, record->timing.ssl_end); 398 ASSERT_EQ(3000, record->timing.ssl_end);
398 } 399 }
OLDNEW
« no previous file with comments | « no previous file | net/base/net_log_event_type_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698