From 2ca01e54e2a4b4aa3996dc6a5eb83def3dd4cab1 Mon Sep 17 00:00:00 2001 From: "akalin@chromium.org" Date: Thu, 31 Oct 2013 22:05:19 +0000 Subject: [Net] Add a priority parameter to URLRequest's constructor This is so that it is clearer what the intended initial priority of a URLRequest is. It is also needed so that we can later enforce that if a URLRequest is set to ignore limits, it has MAXIMUM_PRIORITY; otherwise, we'd have to mandate that SetPriority() is called before set_load_flags(), which is fiddly. Also standardize on a single URLRequest constructor. BUG=166689 R=jam@chromium.org, jamesr@chromium.org, joth@chromium.org, mmenke@chromium.org, scottbyer@chromium.org, sky@chromium.org, tommi@chromium.org Review URL: https://codereview.chromium.org/51953002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232219 0039d316-1c4b-4281-b951-d872f2087c98 --- content/browser/fileapi/file_writer_delegate_unittest.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'content/browser/fileapi/file_writer_delegate_unittest.cc') diff --git a/content/browser/fileapi/file_writer_delegate_unittest.cc b/content/browser/fileapi/file_writer_delegate_unittest.cc index db0dba6..c18877f 100644 --- a/content/browser/fileapi/file_writer_delegate_unittest.cc +++ b/content/browser/fileapi/file_writer_delegate_unittest.cc @@ -13,6 +13,7 @@ #include "base/run_loop.h" #include "content/public/test/test_file_system_context.h" #include "net/base/io_buffer.h" +#include "net/base/request_priority.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_job.h" @@ -129,8 +130,8 @@ class FileWriterDelegateTest : public PlatformTest { int64 allowed_growth) { file_writer_delegate_.reset( CreateWriterDelegate(test_file_path, offset, allowed_growth)); - request_.reset(empty_context_.CreateRequest( - blob_url, file_writer_delegate_.get())); + request_ = empty_context_.CreateRequest( + blob_url, net::DEFAULT_PRIORITY, file_writer_delegate_.get()); } static net::URLRequest::ProtocolFactory Factory; @@ -326,8 +327,8 @@ TEST_F(FileWriterDelegateTest, WriteSuccessWithoutQuotaLimitConcurrent) { // Credate another FileWriterDelegate for concurrent write. file_writer_delegate2.reset(CreateWriterDelegate("test2", 0, kint64max)); - request2.reset(empty_context_.CreateRequest( - kBlobURL2, file_writer_delegate2.get())); + request2 = empty_context_.CreateRequest( + kBlobURL2, net::DEFAULT_PRIORITY, file_writer_delegate2.get()); Result result, result2; ASSERT_EQ(0, usage()); -- cgit v1.1