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

Side by Side Diff: mojo/fetcher/network_fetcher.cc

Issue 1342093002: Mandoline: let html_viewer handle more contents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « mojo/fetcher/about_fetcher_unittest.cc ('k') | mojo/fetcher/network_fetcher_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "mojo/fetcher/network_fetcher.h" 5 #include "mojo/fetcher/network_fetcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file.h" 9 #include "base/files/file.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 TRACE_EVENT_ASYNC_END0("mojo_shell", "NetworkFetcher::NetworkRequest", this); 235 TRACE_EVENT_ASYNC_END0("mojo_shell", "NetworkFetcher::NetworkRequest", this);
236 scoped_ptr<Fetcher> owner(this); 236 scoped_ptr<Fetcher> owner(this);
237 if (response->error) { 237 if (response->error) {
238 LOG(ERROR) << "Error (" << response->error->code << ": " 238 LOG(ERROR) << "Error (" << response->error->code << ": "
239 << response->error->description << ") while fetching " 239 << response->error->description << ") while fetching "
240 << response->url; 240 << response->url;
241 loader_callback_.Run(nullptr); 241 loader_callback_.Run(nullptr);
242 return; 242 return;
243 } 243 }
244 244
245 if (response->status_code >= 400 && response->status_code < 600) {
246 LOG(ERROR) << "Error (" << response->status_code << ": "
247 << response->status_line << "): "
248 << "while fetching " << response->url;
249 loader_callback_.Run(nullptr);
250 return;
251 }
252
253 response_ = response.Pass(); 245 response_ = response.Pass();
254 loader_callback_.Run(owner.Pass()); 246 loader_callback_.Run(owner.Pass());
255 } 247 }
256 248
257 } // namespace fetcher 249 } // namespace fetcher
258 } // namespace mojo 250 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/fetcher/about_fetcher_unittest.cc ('k') | mojo/fetcher/network_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698