| 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 "content/browser/loader/async_resource_handler.h" | 5 #include "content/browser/loader/async_resource_handler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 namespace content { | 35 namespace content { |
| 36 namespace { | 36 namespace { |
| 37 | 37 |
| 38 static int kBufferSize = 1024 * 512; | 38 static int kBufferSize = 1024 * 512; |
| 39 static int kMinAllocationSize = 1024 * 4; | 39 static int kMinAllocationSize = 1024 * 4; |
| 40 static int kMaxAllocationSize = 1024 * 32; | 40 static int kMaxAllocationSize = 1024 * 32; |
| 41 | 41 |
| 42 void GetNumericArg(const std::string& name, int* result) { | 42 void GetNumericArg(const std::string& name, int* result) { |
| 43 const std::string& value = | 43 const std::string& value = |
| 44 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(name); | 44 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(name); |
| 45 if (!value.empty()) | 45 if (!value.empty()) |
| 46 base::StringToInt(value, result); | 46 base::StringToInt(value, result); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void InitializeResourceBufferConstants() { | 49 void InitializeResourceBufferConstants() { |
| 50 static bool did_init = false; | 50 static bool did_init = false; |
| 51 if (did_init) | 51 if (did_init) |
| 52 return; | 52 return; |
| 53 did_init = true; | 53 did_init = true; |
| 54 | 54 |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 request()->LogUnblocked(); | 390 request()->LogUnblocked(); |
| 391 controller()->Resume(); | 391 controller()->Resume(); |
| 392 } | 392 } |
| 393 } | 393 } |
| 394 | 394 |
| 395 void AsyncResourceHandler::OnDefer() { | 395 void AsyncResourceHandler::OnDefer() { |
| 396 request()->LogBlockedBy("AsyncResourceHandler"); | 396 request()->LogBlockedBy("AsyncResourceHandler"); |
| 397 } | 397 } |
| 398 | 398 |
| 399 } // namespace content | 399 } // namespace content |
| OLD | NEW |