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

Side by Side Diff: webkit/browser/fileapi/file_system_dir_url_request_job_unittest.cc

Issue 16155009: Update webkit/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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) 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 "webkit/browser/fileapi/file_system_dir_url_request_job.h" 5 #include "webkit/browser/fileapi/file_system_dir_url_request_job.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 99 }
100 100
101 FileSystemURL CreateURL(const base::FilePath& file_path) { 101 FileSystemURL CreateURL(const base::FilePath& file_path) {
102 return file_system_context_->CreateCrackedFileSystemURL( 102 return file_system_context_->CreateCrackedFileSystemURL(
103 GURL("http://remote"), 103 GURL("http://remote"),
104 fileapi::kFileSystemTypeTemporary, 104 fileapi::kFileSystemTypeTemporary,
105 file_path); 105 file_path);
106 } 106 }
107 107
108 FileSystemOperationContext* NewOperationContext() { 108 FileSystemOperationContext* NewOperationContext() {
109 FileSystemOperationContext* context(new FileSystemOperationContext( 109 FileSystemOperationContext* context(
110 file_system_context_)); 110 new FileSystemOperationContext(file_system_context_.get()));
111 context->set_allowed_bytes_growth(1024); 111 context->set_allowed_bytes_growth(1024);
112 return context; 112 return context;
113 } 113 }
114 114
115 void CreateDirectory(const base::StringPiece& dir_name) { 115 void CreateDirectory(const base::StringPiece& dir_name) {
116 base::FilePath path = base::FilePath().AppendASCII(dir_name); 116 base::FilePath path = base::FilePath().AppendASCII(dir_name);
117 scoped_ptr<FileSystemOperationContext> context(NewOperationContext()); 117 scoped_ptr<FileSystemOperationContext> context(NewOperationContext());
118 ASSERT_EQ(base::PLATFORM_FILE_OK, file_util()->CreateDirectory( 118 ASSERT_EQ(base::PLATFORM_FILE_OK, file_util()->CreateDirectory(
119 context.get(), 119 context.get(),
120 CreateURL(path), 120 CreateURL(path),
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 CreateDirectory("foo"); 281 CreateDirectory("foo");
282 TestRequestNoRun(CreateFileSystemURL("foo/")); 282 TestRequestNoRun(CreateFileSystemURL("foo/"));
283 // Run StartAsync() and only StartAsync(). 283 // Run StartAsync() and only StartAsync().
284 base::MessageLoop::current()->DeleteSoon(FROM_HERE, request_.release()); 284 base::MessageLoop::current()->DeleteSoon(FROM_HERE, request_.release());
285 base::MessageLoop::current()->RunUntilIdle(); 285 base::MessageLoop::current()->RunUntilIdle();
286 // If we get here, success! we didn't crash! 286 // If we get here, success! we didn't crash!
287 } 287 }
288 288
289 } // namespace (anonymous) 289 } // namespace (anonymous)
290 } // namespace fileapi 290 } // namespace fileapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698