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

Side by Side Diff: content/browser/histogram_internals_request_job.cc

Issue 10855209: Refactoring: ProtocolHandler::MaybeCreateJob takes NetworkDelegate as argument (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest merge Created 8 years, 4 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 | Annotate | Revision Log
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 "content/browser/histogram_internals_request_job.h" 5 #include "content/browser/histogram_internals_request_job.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/metrics/statistics_recorder.h" 8 #include "base/metrics/statistics_recorder.h"
9 #include "content/browser/histogram_synchronizer.h" 9 #include "content/browser/histogram_synchronizer.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
11 #include "net/base/escape.h" 11 #include "net/base/escape.h"
12 #include "net/base/net_errors.h" 12 #include "net/base/net_errors.h"
13 #include "net/url_request/url_request.h" 13 #include "net/url_request/url_request.h"
14 14
15 namespace content { 15 namespace content {
16 16
17 HistogramInternalsRequestJob::HistogramInternalsRequestJob( 17 HistogramInternalsRequestJob::HistogramInternalsRequestJob(
18 net::URLRequest* request) : net::URLRequestSimpleJob(request) { 18 net::URLRequest* request, net::NetworkDelegate* network_delegate)
19 : net::URLRequestSimpleJob(request, network_delegate) {
19 const std::string& spec = request->url().possibly_invalid_spec(); 20 const std::string& spec = request->url().possibly_invalid_spec();
20 const url_parse::Parsed& parsed = 21 const url_parse::Parsed& parsed =
21 request->url().parsed_for_possibly_invalid_spec(); 22 request->url().parsed_for_possibly_invalid_spec();
22 // + 1 to skip the slash at the beginning of the path. 23 // + 1 to skip the slash at the beginning of the path.
23 int offset = parsed.CountCharactersBefore(url_parse::Parsed::PATH, false) + 1; 24 int offset = parsed.CountCharactersBefore(url_parse::Parsed::PATH, false) + 1;
24 25
25 if (offset < static_cast<int>(spec.size())) 26 if (offset < static_cast<int>(spec.size()))
26 path_.assign(spec.substr(offset)); 27 path_.assign(spec.substr(offset));
27 } 28 }
28 29
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 const net::CompletionCallback& callback) const { 68 const net::CompletionCallback& callback) const {
68 mime_type->assign("text/html"); 69 mime_type->assign("text/html");
69 charset->assign("UTF8"); 70 charset->assign("UTF8");
70 71
71 data->clear(); 72 data->clear();
72 AboutHistogram(data, path_); 73 AboutHistogram(data, path_);
73 return net::OK; 74 return net::OK;
74 } 75 }
75 76
76 } // namespace content 77 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/histogram_internals_request_job.h ('k') | content/browser/net/view_blob_internals_job_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698