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

Side by Side Diff: chrome/browser/extensions/api/downloads/downloads_api_unittest.cc

Issue 10920087: Update callers of CreateFileSystemOperation so more detailed error codes can be returned. Where app… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/fileapi/fileapi_message_filter.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 (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 <algorithm> 5 #include <algorithm>
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 base::PlatformFileError result, 715 base::PlatformFileError result,
716 const std::string& fs_name, 716 const std::string& fs_name,
717 const GURL& root) { 717 const GURL& root) {
718 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 718 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
719 root_ = root.spec(); 719 root_ = root.spec();
720 CHECK(BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( 720 CHECK(BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind(
721 &HTML5FileWriter::CreateFile, base::Unretained(this)))); 721 &HTML5FileWriter::CreateFile, base::Unretained(this))));
722 } 722 }
723 723
724 fileapi::FileSystemOperation* operation() { 724 fileapi::FileSystemOperation* operation() {
725 return fs_->CreateFileSystemOperation(fileapi::FileSystemURL(GURL(root_))); 725 return fs_->CreateFileSystemOperation(
726 fileapi::FileSystemURL(GURL(root_)), NULL);
726 } 727 }
727 728
728 void CreateFile() { 729 void CreateFile() {
729 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 730 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
730 operation()->CreateFile(fileapi::FileSystemURL(GURL(root_ + filename_)), 731 operation()->CreateFile(fileapi::FileSystemURL(GURL(root_ + filename_)),
731 kExclusive, base::Bind( 732 kExclusive, base::Bind(
732 &HTML5FileWriter::CreateFileCallback, base::Unretained(this))); 733 &HTML5FileWriter::CreateFileCallback, base::Unretained(this)));
733 } 734 }
734 735
735 void CreateFileCallback(base::PlatformFileError result) { 736 void CreateFileCallback(base::PlatformFileError result) {
(...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after
2084 " \"state\": {" 2085 " \"state\": {"
2085 " \"previous\": \"in_progress\"," 2086 " \"previous\": \"in_progress\","
2086 " \"current\": \"complete\"}}]", 2087 " \"current\": \"complete\"}}]",
2087 result_id, 2088 result_id,
2088 GetFilename("on_record.txt.crdownload").c_str(), 2089 GetFilename("on_record.txt.crdownload").c_str(),
2089 GetFilename("on_record.txt").c_str()))); 2090 GetFilename("on_record.txt").c_str())));
2090 std::string disk_data; 2091 std::string disk_data;
2091 EXPECT_TRUE(file_util::ReadFileToString(item->GetFullPath(), &disk_data)); 2092 EXPECT_TRUE(file_util::ReadFileToString(item->GetFullPath(), &disk_data));
2092 EXPECT_STREQ(kPayloadData, disk_data.c_str()); 2093 EXPECT_STREQ(kPayloadData, disk_data.c_str());
2093 } 2094 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/fileapi/fileapi_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698