OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "fake_pepper_interface_url_loader.h" | 5 #include "fake_pepper_interface_url_loader.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 #include <strings.h> | 8 #include <strings.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 224 |
225 FakeURLLoaderEntity* FakeURLLoaderServer::GetEntity(const std::string& url) { | 225 FakeURLLoaderEntity* FakeURLLoaderServer::GetEntity(const std::string& url) { |
226 EntityMap::iterator iter = entity_map_.find(url); | 226 EntityMap::iterator iter = entity_map_.find(url); |
227 if (iter == entity_map_.end()) | 227 if (iter == entity_map_.end()) |
228 return NULL; | 228 return NULL; |
229 return &iter->second; | 229 return &iter->second; |
230 } | 230 } |
231 | 231 |
232 int FakeURLLoaderServer::GetError(const std::string& url) { | 232 int FakeURLLoaderServer::GetError(const std::string& url) { |
233 ErrorMap::iterator iter = error_map_.find(url); | 233 ErrorMap::iterator iter = error_map_.find(url); |
234 if (iter != error_map_.end()) | 234 if (iter == error_map_.end()) |
235 return 0; | 235 return 0; |
236 return iter->second; | 236 return iter->second; |
237 } | 237 } |
238 | 238 |
239 FakeURLLoaderInterface::FakeURLLoaderInterface( | 239 FakeURLLoaderInterface::FakeURLLoaderInterface( |
240 FakeCoreInterface* core_interface) | 240 FakeCoreInterface* core_interface) |
241 : core_interface_(core_interface) {} | 241 : core_interface_(core_interface) {} |
242 | 242 |
243 PP_Resource FakeURLLoaderInterface::Create(PP_Instance instance) { | 243 PP_Resource FakeURLLoaderInterface::Create(PP_Instance instance) { |
244 FakeInstanceResource* instance_resource = | 244 FakeInstanceResource* instance_resource = |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 | 526 |
527 nacl_io::URLRequestInfoInterface* | 527 nacl_io::URLRequestInfoInterface* |
528 FakePepperInterfaceURLLoader::GetURLRequestInfoInterface() { | 528 FakePepperInterfaceURLLoader::GetURLRequestInfoInterface() { |
529 return &url_request_info_interface_; | 529 return &url_request_info_interface_; |
530 } | 530 } |
531 | 531 |
532 nacl_io::URLResponseInfoInterface* | 532 nacl_io::URLResponseInfoInterface* |
533 FakePepperInterfaceURLLoader::GetURLResponseInfoInterface() { | 533 FakePepperInterfaceURLLoader::GetURLResponseInfoInterface() { |
534 return &url_response_info_interface_; | 534 return &url_response_info_interface_; |
535 } | 535 } |
OLD | NEW |