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

Side by Side Diff: storage/browser/blob/local_file_stream_reader.cc

Issue 641223004: Adding instrumentation to locate the source of jankiness. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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 "storage/browser/blob/local_file_stream_reader.h" 5 #include "storage/browser/blob/local_file_stream_reader.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/files/file_util_proxy.h" 8 #include "base/files/file_util_proxy.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/profiler/scoped_profile.h"
11 #include "base/task_runner.h" 12 #include "base/task_runner.h"
12 #include "net/base/file_stream.h" 13 #include "net/base/file_stream.h"
13 #include "net/base/io_buffer.h" 14 #include "net/base/io_buffer.h"
14 #include "net/base/net_errors.h" 15 #include "net/base/net_errors.h"
15 16
16 namespace storage { 17 namespace storage {
17 18
18 namespace { 19 namespace {
19 20
20 const int kOpenFlagsForRead = base::File::FLAG_OPEN | 21 const int kOpenFlagsForRead = base::File::FLAG_OPEN |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 base::Bind(&LocalFileStreamReader::DidOpenFileStream, 95 base::Bind(&LocalFileStreamReader::DidOpenFileStream,
95 weak_factory_.GetWeakPtr(), 96 weak_factory_.GetWeakPtr(),
96 callback)); 97 callback));
97 if (result != net::ERR_IO_PENDING) 98 if (result != net::ERR_IO_PENDING)
98 callback.Run(result); 99 callback.Run(result);
99 } 100 }
100 101
101 void LocalFileStreamReader::DidOpenFileStream( 102 void LocalFileStreamReader::DidOpenFileStream(
102 const net::CompletionCallback& callback, 103 const net::CompletionCallback& callback,
103 int result) { 104 int result) {
105 // TODO(vadimt): Remove ScopedProfile below once crbug.com/423948 is fixed.
106 tracked_objects::ScopedProfile tracking_profile(
107 FROM_HERE_WITH_EXPLICIT_FUNCTION(
108 "423948 LocalFileStreamReader::DidOpenFileStream"));
109
104 if (result != net::OK) { 110 if (result != net::OK) {
105 callback.Run(result); 111 callback.Run(result);
106 return; 112 return;
107 } 113 }
108 result = stream_impl_->Seek( 114 result = stream_impl_->Seek(
109 base::File::FROM_BEGIN, initial_offset_, 115 base::File::FROM_BEGIN, initial_offset_,
110 base::Bind(&LocalFileStreamReader::DidSeekFileStream, 116 base::Bind(&LocalFileStreamReader::DidSeekFileStream,
111 weak_factory_.GetWeakPtr(), 117 weak_factory_.GetWeakPtr(),
112 callback)); 118 callback));
113 if (result != net::ERR_IO_PENDING) { 119 if (result != net::ERR_IO_PENDING) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 return; 166 return;
161 } 167 }
162 if (!VerifySnapshotTime(expected_modification_time_, file_info)) { 168 if (!VerifySnapshotTime(expected_modification_time_, file_info)) {
163 callback.Run(net::ERR_UPLOAD_FILE_CHANGED); 169 callback.Run(net::ERR_UPLOAD_FILE_CHANGED);
164 return; 170 return;
165 } 171 }
166 callback.Run(file_info.size); 172 callback.Run(file_info.size);
167 } 173 }
168 174
169 } // namespace storage 175 } // namespace storage
OLDNEW
« no previous file with comments | « net/url_request/url_request_file_job.cc ('k') | storage/browser/fileapi/local_file_stream_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698