| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
| 7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.h" |
| 8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 FILE_PATH_LITERAL("chrome/test/data"); | 27 FILE_PATH_LITERAL("chrome/test/data"); |
| 28 | 28 |
| 29 int g_request_context_getter_instances = 0; | 29 int g_request_context_getter_instances = 0; |
| 30 class TrackingTestURLRequestContextGetter | 30 class TrackingTestURLRequestContextGetter |
| 31 : public net::TestURLRequestContextGetter { | 31 : public net::TestURLRequestContextGetter { |
| 32 public: | 32 public: |
| 33 explicit TrackingTestURLRequestContextGetter( | 33 explicit TrackingTestURLRequestContextGetter( |
| 34 base::MessageLoopProxy* io_message_loop_proxy, | 34 base::MessageLoopProxy* io_message_loop_proxy, |
| 35 net::URLRequestThrottlerManager* throttler_manager) | 35 net::URLRequestThrottlerManager* throttler_manager) |
| 36 : TestURLRequestContextGetter(io_message_loop_proxy), | 36 : TestURLRequestContextGetter(io_message_loop_proxy), |
| 37 throttler_manager_(throttler_manager), | 37 throttler_manager_(throttler_manager) { |
| 38 context_(NULL) { | |
| 39 g_request_context_getter_instances++; | 38 g_request_context_getter_instances++; |
| 40 } | 39 } |
| 41 | 40 |
| 42 virtual net::TestURLRequestContext* GetURLRequestContext() OVERRIDE { | 41 virtual net::TestURLRequestContext* GetURLRequestContext() OVERRIDE { |
| 43 if (!context_.get()) { | 42 if (!context_.get()) { |
| 44 context_.reset(new net::TestURLRequestContext(true)); | 43 context_.reset(new net::TestURLRequestContext(true)); |
| 45 context_->set_throttler_manager(throttler_manager_); | 44 context_->set_throttler_manager(throttler_manager_); |
| 46 context_->Init(); | 45 context_->Init(); |
| 47 } | 46 } |
| 48 return context_.get(); | 47 return context_.get(); |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 base::FilePath(kDocRoot)); | 371 base::FilePath(kDocRoot)); |
| 373 ASSERT_TRUE(test_server.Start()); | 372 ASSERT_TRUE(test_server.Start()); |
| 374 | 373 |
| 375 GURL url(test_server.GetURL("defaultresponse")); | 374 GURL url(test_server.GetURL("defaultresponse")); |
| 376 CreateFetcher(url, 11); | 375 CreateFetcher(url, 11); |
| 377 | 376 |
| 378 base::MessageLoop::current()->Run(); | 377 base::MessageLoop::current()->Run(); |
| 379 } | 378 } |
| 380 | 379 |
| 381 } // namespace cloud_print | 380 } // namespace cloud_print |
| OLD | NEW |