| 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 "chrome/browser/net/chrome_url_request_context.h" | 5 #include "chrome/browser/net/chrome_url_request_context.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // Factory that creates the main ChromeURLRequestContext. | 40 // Factory that creates the main ChromeURLRequestContext. |
| 41 class FactoryForMain : public ChromeURLRequestContextFactory { | 41 class FactoryForMain : public ChromeURLRequestContextFactory { |
| 42 public: | 42 public: |
| 43 FactoryForMain( | 43 FactoryForMain( |
| 44 const ProfileIOData* profile_io_data, | 44 const ProfileIOData* profile_io_data, |
| 45 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 45 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 46 blob_protocol_handler, | 46 blob_protocol_handler, |
| 47 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 47 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 48 file_system_protocol_handler, | 48 file_system_protocol_handler, |
| 49 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 49 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 50 developer_protocol_handler, | |
| 51 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 52 chrome_protocol_handler, | 50 chrome_protocol_handler, |
| 53 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 51 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 54 chrome_devtools_protocol_handler) | 52 chrome_devtools_protocol_handler) |
| 55 : profile_io_data_(profile_io_data), | 53 : profile_io_data_(profile_io_data), |
| 56 blob_protocol_handler_(blob_protocol_handler.Pass()), | 54 blob_protocol_handler_(blob_protocol_handler.Pass()), |
| 57 file_system_protocol_handler_(file_system_protocol_handler.Pass()), | 55 file_system_protocol_handler_(file_system_protocol_handler.Pass()), |
| 58 developer_protocol_handler_(developer_protocol_handler.Pass()), | |
| 59 chrome_protocol_handler_(chrome_protocol_handler.Pass()), | 56 chrome_protocol_handler_(chrome_protocol_handler.Pass()), |
| 60 chrome_devtools_protocol_handler_( | 57 chrome_devtools_protocol_handler_( |
| 61 chrome_devtools_protocol_handler.Pass()) {} | 58 chrome_devtools_protocol_handler.Pass()) {} |
| 62 | 59 |
| 63 virtual ChromeURLRequestContext* Create() OVERRIDE { | 60 virtual ChromeURLRequestContext* Create() OVERRIDE { |
| 64 profile_io_data_->Init(blob_protocol_handler_.Pass(), | 61 profile_io_data_->Init(blob_protocol_handler_.Pass(), |
| 65 file_system_protocol_handler_.Pass(), | 62 file_system_protocol_handler_.Pass(), |
| 66 developer_protocol_handler_.Pass(), | |
| 67 chrome_protocol_handler_.Pass(), | 63 chrome_protocol_handler_.Pass(), |
| 68 chrome_devtools_protocol_handler_.Pass()); | 64 chrome_devtools_protocol_handler_.Pass()); |
| 69 return profile_io_data_->GetMainRequestContext(); | 65 return profile_io_data_->GetMainRequestContext(); |
| 70 } | 66 } |
| 71 | 67 |
| 72 private: | 68 private: |
| 73 const ProfileIOData* const profile_io_data_; | 69 const ProfileIOData* const profile_io_data_; |
| 74 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> blob_protocol_handler_; | 70 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> blob_protocol_handler_; |
| 75 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 71 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 76 file_system_protocol_handler_; | 72 file_system_protocol_handler_; |
| 77 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 73 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 78 developer_protocol_handler_; | |
| 79 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 80 chrome_protocol_handler_; | 74 chrome_protocol_handler_; |
| 81 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 75 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 82 chrome_devtools_protocol_handler_; | 76 chrome_devtools_protocol_handler_; |
| 83 }; | 77 }; |
| 84 | 78 |
| 85 // Factory that creates the ChromeURLRequestContext for extensions. | 79 // Factory that creates the ChromeURLRequestContext for extensions. |
| 86 class FactoryForExtensions : public ChromeURLRequestContextFactory { | 80 class FactoryForExtensions : public ChromeURLRequestContextFactory { |
| 87 public: | 81 public: |
| 88 explicit FactoryForExtensions(const ProfileIOData* profile_io_data) | 82 explicit FactoryForExtensions(const ProfileIOData* profile_io_data) |
| 89 : profile_io_data_(profile_io_data) {} | 83 : profile_io_data_(profile_io_data) {} |
| (...skipping 13 matching lines...) Expand all Loading... |
| 103 const ProfileIOData* profile_io_data, | 97 const ProfileIOData* profile_io_data, |
| 104 const StoragePartitionDescriptor& partition_descriptor, | 98 const StoragePartitionDescriptor& partition_descriptor, |
| 105 ChromeURLRequestContextGetter* main_context, | 99 ChromeURLRequestContextGetter* main_context, |
| 106 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 100 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
| 107 protocol_handler_interceptor, | 101 protocol_handler_interceptor, |
| 108 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 102 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 109 blob_protocol_handler, | 103 blob_protocol_handler, |
| 110 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 104 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 111 file_system_protocol_handler, | 105 file_system_protocol_handler, |
| 112 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 106 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 113 developer_protocol_handler, | |
| 114 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 115 chrome_protocol_handler, | 107 chrome_protocol_handler, |
| 116 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 108 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 117 chrome_devtools_protocol_handler) | 109 chrome_devtools_protocol_handler) |
| 118 : profile_io_data_(profile_io_data), | 110 : profile_io_data_(profile_io_data), |
| 119 partition_descriptor_(partition_descriptor), | 111 partition_descriptor_(partition_descriptor), |
| 120 main_request_context_getter_(main_context), | 112 main_request_context_getter_(main_context), |
| 121 protocol_handler_interceptor_(protocol_handler_interceptor.Pass()), | 113 protocol_handler_interceptor_(protocol_handler_interceptor.Pass()), |
| 122 blob_protocol_handler_(blob_protocol_handler.Pass()), | 114 blob_protocol_handler_(blob_protocol_handler.Pass()), |
| 123 file_system_protocol_handler_(file_system_protocol_handler.Pass()), | 115 file_system_protocol_handler_(file_system_protocol_handler.Pass()), |
| 124 developer_protocol_handler_(developer_protocol_handler.Pass()), | |
| 125 chrome_protocol_handler_(chrome_protocol_handler.Pass()), | 116 chrome_protocol_handler_(chrome_protocol_handler.Pass()), |
| 126 chrome_devtools_protocol_handler_( | 117 chrome_devtools_protocol_handler_( |
| 127 chrome_devtools_protocol_handler.Pass()) {} | 118 chrome_devtools_protocol_handler.Pass()) {} |
| 128 | 119 |
| 129 virtual ChromeURLRequestContext* Create() OVERRIDE { | 120 virtual ChromeURLRequestContext* Create() OVERRIDE { |
| 130 // We will copy most of the state from the main request context. | 121 // We will copy most of the state from the main request context. |
| 131 // | 122 // |
| 132 // Note that this factory is one-shot. After Create() is called once, the | 123 // Note that this factory is one-shot. After Create() is called once, the |
| 133 // factory is actually destroyed. Thus it is safe to destructively pass | 124 // factory is actually destroyed. Thus it is safe to destructively pass |
| 134 // state onwards. | 125 // state onwards. |
| 135 return profile_io_data_->GetIsolatedAppRequestContext( | 126 return profile_io_data_->GetIsolatedAppRequestContext( |
| 136 main_request_context_getter_->GetIOContext(), partition_descriptor_, | 127 main_request_context_getter_->GetIOContext(), partition_descriptor_, |
| 137 protocol_handler_interceptor_.Pass(), blob_protocol_handler_.Pass(), | 128 protocol_handler_interceptor_.Pass(), blob_protocol_handler_.Pass(), |
| 138 file_system_protocol_handler_.Pass(), | 129 file_system_protocol_handler_.Pass(), |
| 139 developer_protocol_handler_.Pass(), | |
| 140 chrome_protocol_handler_.Pass(), | 130 chrome_protocol_handler_.Pass(), |
| 141 chrome_devtools_protocol_handler_.Pass()); | 131 chrome_devtools_protocol_handler_.Pass()); |
| 142 } | 132 } |
| 143 | 133 |
| 144 private: | 134 private: |
| 145 const ProfileIOData* const profile_io_data_; | 135 const ProfileIOData* const profile_io_data_; |
| 146 const StoragePartitionDescriptor partition_descriptor_; | 136 const StoragePartitionDescriptor partition_descriptor_; |
| 147 scoped_refptr<ChromeURLRequestContextGetter> | 137 scoped_refptr<ChromeURLRequestContextGetter> |
| 148 main_request_context_getter_; | 138 main_request_context_getter_; |
| 149 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 139 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
| 150 protocol_handler_interceptor_; | 140 protocol_handler_interceptor_; |
| 151 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 141 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 152 blob_protocol_handler_; | 142 blob_protocol_handler_; |
| 153 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 143 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 154 file_system_protocol_handler_; | 144 file_system_protocol_handler_; |
| 155 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 145 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 156 developer_protocol_handler_; | |
| 157 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 158 chrome_protocol_handler_; | 146 chrome_protocol_handler_; |
| 159 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 147 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 160 chrome_devtools_protocol_handler_; | 148 chrome_devtools_protocol_handler_; |
| 161 }; | 149 }; |
| 162 | 150 |
| 163 // Factory that creates the media ChromeURLRequestContext for a given isolated | 151 // Factory that creates the media ChromeURLRequestContext for a given isolated |
| 164 // app. The media context is based on the corresponding isolated app's context. | 152 // app. The media context is based on the corresponding isolated app's context. |
| 165 class FactoryForIsolatedMedia : public ChromeURLRequestContextFactory { | 153 class FactoryForIsolatedMedia : public ChromeURLRequestContextFactory { |
| 166 public: | 154 public: |
| 167 FactoryForIsolatedMedia( | 155 FactoryForIsolatedMedia( |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 230 |
| 243 // static | 231 // static |
| 244 ChromeURLRequestContextGetter* ChromeURLRequestContextGetter::CreateOriginal( | 232 ChromeURLRequestContextGetter* ChromeURLRequestContextGetter::CreateOriginal( |
| 245 Profile* profile, | 233 Profile* profile, |
| 246 const ProfileIOData* profile_io_data, | 234 const ProfileIOData* profile_io_data, |
| 247 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 235 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 248 blob_protocol_handler, | 236 blob_protocol_handler, |
| 249 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 237 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 250 file_system_protocol_handler, | 238 file_system_protocol_handler, |
| 251 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 239 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 252 developer_protocol_handler, | |
| 253 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 254 chrome_protocol_handler, | 240 chrome_protocol_handler, |
| 255 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 241 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 256 chrome_devtools_protocol_handler) { | 242 chrome_devtools_protocol_handler) { |
| 257 DCHECK(!profile->IsOffTheRecord()); | 243 DCHECK(!profile->IsOffTheRecord()); |
| 258 return new ChromeURLRequestContextGetter( | 244 return new ChromeURLRequestContextGetter( |
| 259 new FactoryForMain(profile_io_data, | 245 new FactoryForMain(profile_io_data, |
| 260 blob_protocol_handler.Pass(), | 246 blob_protocol_handler.Pass(), |
| 261 file_system_protocol_handler.Pass(), | 247 file_system_protocol_handler.Pass(), |
| 262 developer_protocol_handler.Pass(), | |
| 263 chrome_protocol_handler.Pass(), | 248 chrome_protocol_handler.Pass(), |
| 264 chrome_devtools_protocol_handler.Pass())); | 249 chrome_devtools_protocol_handler.Pass())); |
| 265 } | 250 } |
| 266 | 251 |
| 267 // static | 252 // static |
| 268 ChromeURLRequestContextGetter* | 253 ChromeURLRequestContextGetter* |
| 269 ChromeURLRequestContextGetter::CreateOriginalForMedia( | 254 ChromeURLRequestContextGetter::CreateOriginalForMedia( |
| 270 Profile* profile, const ProfileIOData* profile_io_data) { | 255 Profile* profile, const ProfileIOData* profile_io_data) { |
| 271 DCHECK(!profile->IsOffTheRecord()); | 256 DCHECK(!profile->IsOffTheRecord()); |
| 272 return new ChromeURLRequestContextGetter( | 257 return new ChromeURLRequestContextGetter( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 288 Profile* profile, | 273 Profile* profile, |
| 289 const ProfileIOData* profile_io_data, | 274 const ProfileIOData* profile_io_data, |
| 290 const StoragePartitionDescriptor& partition_descriptor, | 275 const StoragePartitionDescriptor& partition_descriptor, |
| 291 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 276 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
| 292 protocol_handler_interceptor, | 277 protocol_handler_interceptor, |
| 293 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 278 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 294 blob_protocol_handler, | 279 blob_protocol_handler, |
| 295 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 280 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 296 file_system_protocol_handler, | 281 file_system_protocol_handler, |
| 297 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 282 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 298 developer_protocol_handler, | |
| 299 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 300 chrome_protocol_handler, | 283 chrome_protocol_handler, |
| 301 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 284 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 302 chrome_devtools_protocol_handler) { | 285 chrome_devtools_protocol_handler) { |
| 303 DCHECK(!profile->IsOffTheRecord()); | 286 DCHECK(!profile->IsOffTheRecord()); |
| 304 ChromeURLRequestContextGetter* main_context = | 287 ChromeURLRequestContextGetter* main_context = |
| 305 static_cast<ChromeURLRequestContextGetter*>(profile->GetRequestContext()); | 288 static_cast<ChromeURLRequestContextGetter*>(profile->GetRequestContext()); |
| 306 return new ChromeURLRequestContextGetter( | 289 return new ChromeURLRequestContextGetter( |
| 307 new FactoryForIsolatedApp(profile_io_data, partition_descriptor, | 290 new FactoryForIsolatedApp(profile_io_data, partition_descriptor, |
| 308 main_context, protocol_handler_interceptor.Pass(), | 291 main_context, protocol_handler_interceptor.Pass(), |
| 309 blob_protocol_handler.Pass(), file_system_protocol_handler.Pass(), | 292 blob_protocol_handler.Pass(), file_system_protocol_handler.Pass(), |
| 310 developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(), | 293 chrome_protocol_handler.Pass(), |
| 311 chrome_devtools_protocol_handler.Pass())); | 294 chrome_devtools_protocol_handler.Pass())); |
| 312 } | 295 } |
| 313 | 296 |
| 314 // static | 297 // static |
| 315 ChromeURLRequestContextGetter* | 298 ChromeURLRequestContextGetter* |
| 316 ChromeURLRequestContextGetter::CreateOriginalForIsolatedMedia( | 299 ChromeURLRequestContextGetter::CreateOriginalForIsolatedMedia( |
| 317 Profile* profile, | 300 Profile* profile, |
| 318 ChromeURLRequestContextGetter* app_context, | 301 ChromeURLRequestContextGetter* app_context, |
| 319 const ProfileIOData* profile_io_data, | 302 const ProfileIOData* profile_io_data, |
| 320 const StoragePartitionDescriptor& partition_descriptor) { | 303 const StoragePartitionDescriptor& partition_descriptor) { |
| 321 DCHECK(!profile->IsOffTheRecord()); | 304 DCHECK(!profile->IsOffTheRecord()); |
| 322 return new ChromeURLRequestContextGetter( | 305 return new ChromeURLRequestContextGetter( |
| 323 new FactoryForIsolatedMedia( | 306 new FactoryForIsolatedMedia( |
| 324 profile_io_data, partition_descriptor, app_context)); | 307 profile_io_data, partition_descriptor, app_context)); |
| 325 } | 308 } |
| 326 | 309 |
| 327 // static | 310 // static |
| 328 ChromeURLRequestContextGetter* | 311 ChromeURLRequestContextGetter* |
| 329 ChromeURLRequestContextGetter::CreateOffTheRecord( | 312 ChromeURLRequestContextGetter::CreateOffTheRecord( |
| 330 Profile* profile, | 313 Profile* profile, |
| 331 const ProfileIOData* profile_io_data, | 314 const ProfileIOData* profile_io_data, |
| 332 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 315 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 333 blob_protocol_handler, | 316 blob_protocol_handler, |
| 334 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 317 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 335 file_system_protocol_handler, | 318 file_system_protocol_handler, |
| 336 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 319 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 337 developer_protocol_handler, | |
| 338 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 339 chrome_protocol_handler, | 320 chrome_protocol_handler, |
| 340 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 321 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 341 chrome_devtools_protocol_handler) { | 322 chrome_devtools_protocol_handler) { |
| 342 DCHECK(profile->IsOffTheRecord()); | 323 DCHECK(profile->IsOffTheRecord()); |
| 343 return new ChromeURLRequestContextGetter( | 324 return new ChromeURLRequestContextGetter( |
| 344 new FactoryForMain(profile_io_data, | 325 new FactoryForMain(profile_io_data, |
| 345 blob_protocol_handler.Pass(), | 326 blob_protocol_handler.Pass(), |
| 346 file_system_protocol_handler.Pass(), | 327 file_system_protocol_handler.Pass(), |
| 347 developer_protocol_handler.Pass(), | |
| 348 chrome_protocol_handler.Pass(), | 328 chrome_protocol_handler.Pass(), |
| 349 chrome_devtools_protocol_handler.Pass())); | 329 chrome_devtools_protocol_handler.Pass())); |
| 350 } | 330 } |
| 351 | 331 |
| 352 // static | 332 // static |
| 353 ChromeURLRequestContextGetter* | 333 ChromeURLRequestContextGetter* |
| 354 ChromeURLRequestContextGetter::CreateOffTheRecordForExtensions( | 334 ChromeURLRequestContextGetter::CreateOffTheRecordForExtensions( |
| 355 Profile* profile, const ProfileIOData* profile_io_data) { | 335 Profile* profile, const ProfileIOData* profile_io_data) { |
| 356 DCHECK(profile->IsOffTheRecord()); | 336 DCHECK(profile->IsOffTheRecord()); |
| 357 return new ChromeURLRequestContextGetter( | 337 return new ChromeURLRequestContextGetter( |
| 358 new FactoryForExtensions(profile_io_data)); | 338 new FactoryForExtensions(profile_io_data)); |
| 359 } | 339 } |
| 360 | 340 |
| 361 // static | 341 // static |
| 362 ChromeURLRequestContextGetter* | 342 ChromeURLRequestContextGetter* |
| 363 ChromeURLRequestContextGetter::CreateOffTheRecordForIsolatedApp( | 343 ChromeURLRequestContextGetter::CreateOffTheRecordForIsolatedApp( |
| 364 Profile* profile, | 344 Profile* profile, |
| 365 const ProfileIOData* profile_io_data, | 345 const ProfileIOData* profile_io_data, |
| 366 const StoragePartitionDescriptor& partition_descriptor, | 346 const StoragePartitionDescriptor& partition_descriptor, |
| 367 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 347 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
| 368 protocol_handler_interceptor, | 348 protocol_handler_interceptor, |
| 369 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 349 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 370 blob_protocol_handler, | 350 blob_protocol_handler, |
| 371 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 351 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 372 file_system_protocol_handler, | 352 file_system_protocol_handler, |
| 373 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 353 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 374 developer_protocol_handler, | |
| 375 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 376 chrome_protocol_handler, | 354 chrome_protocol_handler, |
| 377 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 355 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 378 chrome_devtools_protocol_handler) { | 356 chrome_devtools_protocol_handler) { |
| 379 DCHECK(profile->IsOffTheRecord()); | 357 DCHECK(profile->IsOffTheRecord()); |
| 380 ChromeURLRequestContextGetter* main_context = | 358 ChromeURLRequestContextGetter* main_context = |
| 381 static_cast<ChromeURLRequestContextGetter*>(profile->GetRequestContext()); | 359 static_cast<ChromeURLRequestContextGetter*>(profile->GetRequestContext()); |
| 382 return new ChromeURLRequestContextGetter( | 360 return new ChromeURLRequestContextGetter( |
| 383 new FactoryForIsolatedApp(profile_io_data, partition_descriptor, | 361 new FactoryForIsolatedApp(profile_io_data, partition_descriptor, |
| 384 main_context, protocol_handler_interceptor.Pass(), | 362 main_context, protocol_handler_interceptor.Pass(), |
| 385 blob_protocol_handler.Pass(), file_system_protocol_handler.Pass(), | 363 blob_protocol_handler.Pass(), file_system_protocol_handler.Pass(), |
| 386 developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(), | 364 chrome_protocol_handler.Pass(), |
| 387 chrome_devtools_protocol_handler.Pass())); | 365 chrome_devtools_protocol_handler.Pass())); |
| 388 } | 366 } |
| 389 | 367 |
| 390 // ---------------------------------------------------------------------------- | 368 // ---------------------------------------------------------------------------- |
| 391 // ChromeURLRequestContext | 369 // ChromeURLRequestContext |
| 392 // ---------------------------------------------------------------------------- | 370 // ---------------------------------------------------------------------------- |
| 393 | 371 |
| 394 ChromeURLRequestContext::ChromeURLRequestContext( | 372 ChromeURLRequestContext::ChromeURLRequestContext( |
| 395 ContextType type, | 373 ContextType type, |
| 396 chrome_browser_net::LoadTimeStats* load_time_stats) | 374 chrome_browser_net::LoadTimeStats* load_time_stats) |
| 397 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), | 375 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), |
| 398 load_time_stats_(load_time_stats) { | 376 load_time_stats_(load_time_stats) { |
| 399 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 377 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 400 if (load_time_stats_) | 378 if (load_time_stats_) |
| 401 load_time_stats_->RegisterURLRequestContext(this, type); | 379 load_time_stats_->RegisterURLRequestContext(this, type); |
| 402 } | 380 } |
| 403 | 381 |
| 404 ChromeURLRequestContext::~ChromeURLRequestContext() { | 382 ChromeURLRequestContext::~ChromeURLRequestContext() { |
| 405 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 383 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 406 if (load_time_stats_) | 384 if (load_time_stats_) |
| 407 load_time_stats_->UnregisterURLRequestContext(this); | 385 load_time_stats_->UnregisterURLRequestContext(this); |
| 408 } | 386 } |
| 409 | 387 |
| 410 void ChromeURLRequestContext::CopyFrom(ChromeURLRequestContext* other) { | 388 void ChromeURLRequestContext::CopyFrom(ChromeURLRequestContext* other) { |
| 411 URLRequestContext::CopyFrom(other); | 389 URLRequestContext::CopyFrom(other); |
| 412 | 390 |
| 413 // Copy ChromeURLRequestContext parameters. | 391 // Copy ChromeURLRequestContext parameters. |
| 414 } | 392 } |
| OLD | NEW |