OLD | NEW |
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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 | 471 |
472 base::TaskRunner* GetTaskRunner() const override { | 472 base::TaskRunner* GetTaskRunner() const override { |
473 return base::ThreadTaskRunnerHandle::Get().get(); | 473 return base::ThreadTaskRunnerHandle::Get().get(); |
474 } | 474 } |
475 | 475 |
476 private: | 476 private: |
477 ~URLRequestBigJob() override {} | 477 ~URLRequestBigJob() override {} |
478 | 478 |
479 // big-job:substring,N | 479 // big-job:substring,N |
480 static bool ParseURL(const GURL& url, std::string* text, int* count) { | 480 static bool ParseURL(const GURL& url, std::string* text, int* count) { |
481 std::vector<std::string> parts; | 481 std::vector<std::string> parts = base::SplitString( |
482 base::SplitString(url.path(), ',', &parts); | 482 url.path(), ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
483 | 483 |
484 if (parts.size() != 2) | 484 if (parts.size() != 2) |
485 return false; | 485 return false; |
486 | 486 |
487 *text = parts[0]; | 487 *text = parts[0]; |
488 return base::StringToInt(parts[1], count); | 488 return base::StringToInt(parts[1], count); |
489 } | 489 } |
490 }; | 490 }; |
491 | 491 |
492 // URLRequestJob used to test GetLoadInfoForAllRoutes. The LoadState and | 492 // URLRequestJob used to test GetLoadInfoForAllRoutes. The LoadState and |
(...skipping 14 matching lines...) Expand all Loading... |
507 net::LoadState GetLoadState() const override { return load_state_; } | 507 net::LoadState GetLoadState() const override { return load_state_; } |
508 net::UploadProgress GetUploadProgress() const override { | 508 net::UploadProgress GetUploadProgress() const override { |
509 return upload_progress_; | 509 return upload_progress_; |
510 } | 510 } |
511 | 511 |
512 private: | 512 private: |
513 ~URLRequestLoadInfoJob() override {} | 513 ~URLRequestLoadInfoJob() override {} |
514 | 514 |
515 // big-job:substring,N | 515 // big-job:substring,N |
516 static bool ParseURL(const GURL& url, std::string* text, int* count) { | 516 static bool ParseURL(const GURL& url, std::string* text, int* count) { |
517 std::vector<std::string> parts; | 517 std::vector<std::string> parts = base::SplitString( |
518 base::SplitString(url.path(), ',', &parts); | 518 url.path(), ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
519 | 519 |
520 if (parts.size() != 2) | 520 if (parts.size() != 2) |
521 return false; | 521 return false; |
522 | 522 |
523 *text = parts[0]; | 523 *text = parts[0]; |
524 return base::StringToInt(parts[1], count); | 524 return base::StringToInt(parts[1], count); |
525 } | 525 } |
526 | 526 |
527 const net::LoadState load_state_; | 527 const net::LoadState load_state_; |
528 const net::UploadProgress upload_progress_; | 528 const net::UploadProgress upload_progress_; |
(...skipping 2854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3383 return nullptr; | 3383 return nullptr; |
3384 } | 3384 } |
3385 | 3385 |
3386 net::URLRequestJob* TestURLRequestJobFactory::MaybeInterceptResponse( | 3386 net::URLRequestJob* TestURLRequestJobFactory::MaybeInterceptResponse( |
3387 net::URLRequest* request, | 3387 net::URLRequest* request, |
3388 net::NetworkDelegate* network_delegate) const { | 3388 net::NetworkDelegate* network_delegate) const { |
3389 return nullptr; | 3389 return nullptr; |
3390 } | 3390 } |
3391 | 3391 |
3392 } // namespace content | 3392 } // namespace content |
OLD | NEW |