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: chrome/browser/dom_ui/chrome_url_data_manager.cc

Issue 6166010: net: Remove typedef net::URLRequestStatus URLRequestStatus; (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/dom_ui/chrome_url_data_manager.h" 5 #include "chrome/browser/dom_ui/chrome_url_data_manager.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 368
369 bool URLRequestChromeJob::GetMimeType(std::string* mime_type) const { 369 bool URLRequestChromeJob::GetMimeType(std::string* mime_type) const {
370 *mime_type = mime_type_; 370 *mime_type = mime_type_;
371 return !mime_type_.empty(); 371 return !mime_type_.empty();
372 } 372 }
373 373
374 void URLRequestChromeJob::DataAvailable(RefCountedMemory* bytes) { 374 void URLRequestChromeJob::DataAvailable(RefCountedMemory* bytes) {
375 if (bytes) { 375 if (bytes) {
376 // The request completed, and we have all the data. 376 // The request completed, and we have all the data.
377 // Clear any IO pending status. 377 // Clear any IO pending status.
378 SetStatus(URLRequestStatus()); 378 SetStatus(net::URLRequestStatus());
379 379
380 data_ = bytes; 380 data_ = bytes;
381 int bytes_read; 381 int bytes_read;
382 if (pending_buf_.get()) { 382 if (pending_buf_.get()) {
383 CHECK(pending_buf_->data()); 383 CHECK(pending_buf_->data());
384 CompleteRead(pending_buf_, pending_buf_size_, &bytes_read); 384 CompleteRead(pending_buf_, pending_buf_size_, &bytes_read);
385 pending_buf_ = NULL; 385 pending_buf_ = NULL;
386 NotifyReadComplete(bytes_read); 386 NotifyReadComplete(bytes_read);
387 } 387 }
388 } else { 388 } else {
389 // The request failed. 389 // The request failed.
390 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, net::ERR_FAILED)); 390 NotifyDone(net::URLRequestStatus(net::URLRequestStatus::FAILED,
391 net::ERR_FAILED));
391 } 392 }
392 } 393 }
393 394
394 bool URLRequestChromeJob::ReadRawData(net::IOBuffer* buf, int buf_size, 395 bool URLRequestChromeJob::ReadRawData(net::IOBuffer* buf, int buf_size,
395 int* bytes_read) { 396 int* bytes_read) {
396 if (!data_.get()) { 397 if (!data_.get()) {
397 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); 398 SetStatus(net::URLRequestStatus(net::URLRequestStatus::IO_PENDING, 0));
398 DCHECK(!pending_buf_.get()); 399 DCHECK(!pending_buf_.get());
399 CHECK(buf->data()); 400 CHECK(buf->data());
400 pending_buf_ = buf; 401 pending_buf_ = buf;
401 pending_buf_size_ = buf_size; 402 pending_buf_size_ = buf_size;
402 return false; // Tell the caller we're still waiting for data. 403 return false; // Tell the caller we're still waiting for data.
403 } 404 }
404 405
405 // Otherwise, the data is available. 406 // Otherwise, the data is available.
406 CompleteRead(buf, buf_size, bytes_read); 407 CompleteRead(buf, buf_size, bytes_read);
407 return true; 408 return true;
(...skipping 12 matching lines...) Expand all
420 } 421 }
421 422
422 void URLRequestChromeJob::StartAsync() { 423 void URLRequestChromeJob::StartAsync() {
423 if (!request_) 424 if (!request_)
424 return; 425 return;
425 426
426 if (ChromeURLDataManager::GetInstance()->StartRequest(request_->url(), 427 if (ChromeURLDataManager::GetInstance()->StartRequest(request_->url(),
427 this)) { 428 this)) {
428 NotifyHeadersComplete(); 429 NotifyHeadersComplete();
429 } else { 430 } else {
430 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, 431 NotifyStartError(net::URLRequestStatus(net::URLRequestStatus::FAILED,
431 net::ERR_INVALID_URL)); 432 net::ERR_INVALID_URL));
432 } 433 }
433 } 434 }
434 435
435 URLRequestChromeFileJob::URLRequestChromeFileJob(net::URLRequest* request, 436 URLRequestChromeFileJob::URLRequestChromeFileJob(net::URLRequest* request,
436 const FilePath& path) 437 const FilePath& path)
437 : net::URLRequestFileJob(request, path) { 438 : net::URLRequestFileJob(request, path) {
438 } 439 }
439 440
440 URLRequestChromeFileJob::~URLRequestChromeFileJob() { } 441 URLRequestChromeFileJob::~URLRequestChromeFileJob() { }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/mock_url_fetchers.cc ('k') | chrome/browser/dom_ui/filebrowse_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698