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

Side by Side Diff: content/browser/loader/sync_resource_handler.cc

Issue 1569673002: [NOT FOR LANDING] Detailed loading traces Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 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 "content/browser/loader/sync_resource_handler.h" 5 #include "content/browser/loader/sync_resource_handler.h"
6 6
7 #include "base/trace_event/trace_event.h"
7 #include "base/logging.h" 8 #include "base/logging.h"
8 #include "content/browser/devtools/devtools_netlog_observer.h" 9 #include "content/browser/devtools/devtools_netlog_observer.h"
9 #include "content/browser/loader/resource_dispatcher_host_impl.h" 10 #include "content/browser/loader/resource_dispatcher_host_impl.h"
10 #include "content/browser/loader/resource_message_filter.h" 11 #include "content/browser/loader/resource_message_filter.h"
11 #include "content/browser/loader/resource_request_info_impl.h" 12 #include "content/browser/loader/resource_request_info_impl.h"
12 #include "content/common/resource_messages.h" 13 #include "content/common/resource_messages.h"
13 #include "content/public/browser/resource_dispatcher_host_delegate.h" 14 #include "content/public/browser/resource_dispatcher_host_delegate.h"
14 #include "content/public/browser/resource_request_info.h" 15 #include "content/public/browser/resource_request_info.h"
15 #include "net/base/io_buffer.h" 16 #include "net/base/io_buffer.h"
16 #include "net/http/http_response_headers.h" 17 #include "net/http/http_response_headers.h"
17 #include "net/url_request/redirect_info.h" 18 #include "net/url_request/redirect_info.h"
18 19
19 namespace content { 20 namespace content {
20 21
21 SyncResourceHandler::SyncResourceHandler( 22 SyncResourceHandler::SyncResourceHandler(
22 net::URLRequest* request, 23 net::URLRequest* request,
23 IPC::Message* result_message, 24 IPC::Message* result_message,
24 ResourceDispatcherHostImpl* resource_dispatcher_host) 25 ResourceDispatcherHostImpl* resource_dispatcher_host)
25 : ResourceHandler(request), 26 : ResourceHandler(request),
26 read_buffer_(new net::IOBuffer(kReadBufSize)), 27 read_buffer_(new net::IOBuffer(kReadBufSize)),
27 result_message_(result_message), 28 result_message_(result_message),
28 rdh_(resource_dispatcher_host), 29 rdh_(resource_dispatcher_host),
29 total_transfer_size_(0) { 30 total_transfer_size_(0) {
30 result_.final_url = request->url(); 31 result_.final_url = request->url();
31 } 32 }
32 33
33 SyncResourceHandler::~SyncResourceHandler() { 34 SyncResourceHandler::~SyncResourceHandler() {
35 TRACE_EVENT0("toplevel", "SyncResourceHandler::~SyncResourceHandler");
36
34 if (result_message_) { 37 if (result_message_) {
35 result_message_->set_reply_error(); 38 result_message_->set_reply_error();
36 ResourceMessageFilter* filter = GetFilter(); 39 ResourceMessageFilter* filter = GetFilter();
37 // If the filter doesn't exist at this point, the process has died and isn't 40 // If the filter doesn't exist at this point, the process has died and isn't
38 // waiting for the result message anymore. 41 // waiting for the result message anymore.
39 if (filter) 42 if (filter)
40 filter->Send(result_message_); 43 filter->Send(result_message_);
41 } 44 }
42 } 45 }
43 46
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 result_message_ = NULL; 136 result_message_ = NULL;
134 return; 137 return;
135 } 138 }
136 139
137 void SyncResourceHandler::OnDataDownloaded(int bytes_downloaded) { 140 void SyncResourceHandler::OnDataDownloaded(int bytes_downloaded) {
138 // Sync requests don't involve ResourceMsg_DataDownloaded messages 141 // Sync requests don't involve ResourceMsg_DataDownloaded messages
139 // being sent back to renderers as progress is made. 142 // being sent back to renderers as progress is made.
140 } 143 }
141 144
142 } // namespace content 145 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/stream_resource_handler.cc ('k') | content/browser/loader/throttling_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698