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

Side by Side Diff: net/base/upload_data.cc

Issue 9288084: Added Net logging to FileStream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed copyright issue. Created 8 years, 10 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
« no previous file with comments | « net/base/net_log_source_type_list.h ('k') | net/net.gyp » ('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/base/upload_data.h" 5 #include "net/base/upload_data.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 FileStream* file = file_stream_; 94 FileStream* file = file_stream_;
95 file_stream_ = NULL; 95 file_stream_ = NULL;
96 return file; 96 return file;
97 } 97 }
98 98
99 // TODO(tzik): 99 // TODO(tzik):
100 // FileStream::Open and FileStream::Seek may cause blocking IO. 100 // FileStream::Open and FileStream::Seek may cause blocking IO.
101 // Temporary allow until fix: http://crbug.com/72001. 101 // Temporary allow until fix: http://crbug.com/72001.
102 base::ThreadRestrictions::ScopedAllowIO allow_io; 102 base::ThreadRestrictions::ScopedAllowIO allow_io;
103 103
104 scoped_ptr<FileStream> file(new FileStream()); 104 scoped_ptr<FileStream> file(new FileStream(NULL));
105 int64 rv = file->Open(file_path_, 105 int64 rv = file->Open(file_path_,
106 base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ); 106 base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ);
107 if (rv != OK) { 107 if (rv != OK) {
108 // If the file can't be opened, we'll just upload an empty file. 108 // If the file can't be opened, we'll just upload an empty file.
109 DLOG(WARNING) << "Failed to open \"" << file_path_.value() 109 DLOG(WARNING) << "Failed to open \"" << file_path_.value()
110 << "\" for reading: " << rv; 110 << "\" for reading: " << rv;
111 return NULL; 111 return NULL;
112 } 112 }
113 if (file_range_offset_) { 113 if (file_range_offset_) {
114 rv = file->Seek(FROM_BEGIN, file_range_offset_); 114 rv = file->Seek(FROM_BEGIN, file_range_offset_);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 } 194 }
195 195
196 void UploadData::SetElements(const std::vector<Element>& elements) { 196 void UploadData::SetElements(const std::vector<Element>& elements) {
197 elements_ = elements; 197 elements_ = elements;
198 } 198 }
199 199
200 UploadData::~UploadData() { 200 UploadData::~UploadData() {
201 } 201 }
202 202
203 } // namespace net 203 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_log_source_type_list.h ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698