OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "device/test/usb_test_gadget.h" | 5 #include "device/test/usb_test_gadget.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 file_path = file_path.AppendASCII("usb_gadget.zip"); | 116 file_path = file_path.AppendASCII("usb_gadget.zip"); |
117 | 117 |
118 return ReadFile(file_path, package); | 118 return ReadFile(file_path, package); |
119 } | 119 } |
120 | 120 |
121 scoped_ptr<net::URLFetcher> CreateURLFetcher( | 121 scoped_ptr<net::URLFetcher> CreateURLFetcher( |
122 scoped_refptr<net::URLRequestContextGetter> request_context_getter, | 122 scoped_refptr<net::URLRequestContextGetter> request_context_getter, |
123 const GURL& url, | 123 const GURL& url, |
124 net::URLFetcher::RequestType request_type, | 124 net::URLFetcher::RequestType request_type, |
125 net::URLFetcherDelegate* delegate) { | 125 net::URLFetcherDelegate* delegate) { |
126 scoped_ptr<net::URLFetcher> url_fetcher( | 126 scoped_ptr<net::URLFetcher> url_fetcher = |
127 net::URLFetcher::Create(url, request_type, delegate)); | 127 net::URLFetcher::Create(url, request_type, delegate); |
128 | 128 |
129 url_fetcher->SetRequestContext(request_context_getter.get()); | 129 url_fetcher->SetRequestContext(request_context_getter.get()); |
130 | 130 |
131 return url_fetcher; | 131 return url_fetcher; |
132 } | 132 } |
133 | 133 |
134 class URLRequestContextGetter : public net::URLRequestContextGetter { | 134 class URLRequestContextGetter : public net::URLRequestContextGetter { |
135 public: | 135 public: |
136 URLRequestContextGetter( | 136 URLRequestContextGetter( |
137 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner) | 137 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner) |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 return false; | 602 return false; |
603 } | 603 } |
604 | 604 |
605 DeviceAddListener add_listener(usb_service_, device_address_, -1); | 605 DeviceAddListener add_listener(usb_service_, device_address_, -1); |
606 device_ = add_listener.WaitForAdd(); | 606 device_ = add_listener.WaitForAdd(); |
607 DCHECK(device_.get()); | 607 DCHECK(device_.get()); |
608 return true; | 608 return true; |
609 } | 609 } |
610 | 610 |
611 } // namespace device | 611 } // namespace device |
OLD | NEW |