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

Side by Side Diff: chrome/browser/extensions/blob_reader.cc

Issue 2549143003: Cleaned up the API of HttpUtil::ParseContentRangeHeader(). (Closed)
Patch Set: Fixed unittest Created 4 years 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 | content/browser/appcache/appcache_url_request_job_unittest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/extensions/blob_reader.h" 5 #include "chrome/browser/extensions/blob_reader.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 56 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
57 fetcher_->Start(); 57 fetcher_->Start();
58 } 58 }
59 59
60 // Overridden from net::URLFetcherDelegate. 60 // Overridden from net::URLFetcherDelegate.
61 void BlobReader::OnURLFetchComplete(const net::URLFetcher* source) { 61 void BlobReader::OnURLFetchComplete(const net::URLFetcher* source) {
62 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 62 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
63 std::unique_ptr<std::string> response(new std::string); 63 std::unique_ptr<std::string> response(new std::string);
64 int64_t first = 0, last = 0, length = 0; 64 int64_t first = 0, last = 0, length = 0;
65 source->GetResponseAsString(response.get()); 65 source->GetResponseAsString(response.get());
66 source->GetResponseHeaders()->GetContentRange(&first, &last, &length); 66 source->GetResponseHeaders()->GetContentRangeFor206(&first, &last, &length);
67 callback_.Run(std::move(response), length); 67 callback_.Run(std::move(response), length);
68 68
69 delete this; 69 delete this;
70 } 70 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/appcache/appcache_url_request_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698