| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/drive/drive_url_request_job.h" | 5 #include "chrome/browser/chromeos/drive/drive_url_request_job.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } | 53 } |
| 54 | 54 |
| 55 virtual bool IsHandledProtocol(const std::string& scheme) const OVERRIDE { | 55 virtual bool IsHandledProtocol(const std::string& scheme) const OVERRIDE { |
| 56 return scheme == chrome::kDriveScheme; | 56 return scheme == chrome::kDriveScheme; |
| 57 } | 57 } |
| 58 | 58 |
| 59 virtual bool IsHandledURL(const GURL& url) const OVERRIDE { | 59 virtual bool IsHandledURL(const GURL& url) const OVERRIDE { |
| 60 return url.is_valid() && IsHandledProtocol(url.scheme()); | 60 return url.is_valid() && IsHandledProtocol(url.scheme()); |
| 61 } | 61 } |
| 62 | 62 |
| 63 virtual bool IsSafeRedirectTarget(const GURL& location) const OVERRIDE { |
| 64 return true; |
| 65 } |
| 66 |
| 63 private: | 67 private: |
| 64 const DriveURLRequestJob::FileSystemGetter file_system_getter_; | 68 const DriveURLRequestJob::FileSystemGetter file_system_getter_; |
| 65 scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner_; | 69 scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner_; |
| 66 | 70 |
| 67 DISALLOW_COPY_AND_ASSIGN(TestURLRequestJobFactory); | 71 DISALLOW_COPY_AND_ASSIGN(TestURLRequestJobFactory); |
| 68 }; | 72 }; |
| 69 | 73 |
| 70 class TestDelegate : public net::TestDelegate { | 74 class TestDelegate : public net::TestDelegate { |
| 71 public: | 75 public: |
| 72 TestDelegate() {} | 76 TestDelegate() {} |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 // Start the request, and cancel it immediately after it. | 352 // Start the request, and cancel it immediately after it. |
| 349 request.Start(); | 353 request.Start(); |
| 350 request.Cancel(); | 354 request.Cancel(); |
| 351 | 355 |
| 352 MessageLoop::current()->Run(); | 356 MessageLoop::current()->Run(); |
| 353 | 357 |
| 354 EXPECT_EQ(net::URLRequestStatus::CANCELED, request.status().status()); | 358 EXPECT_EQ(net::URLRequestStatus::CANCELED, request.status().status()); |
| 355 } | 359 } |
| 356 | 360 |
| 357 } // namespace drive | 361 } // namespace drive |
| OLD | NEW |