| 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 "chrome/browser/net/chrome_extensions_network_delegate.h" | 5 #include "chrome/browser/net/chrome_extensions_network_delegate.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 9 #include "base/macros.h" |
| 7 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| 8 | 11 |
| 9 #if defined(ENABLE_EXTENSIONS) | 12 #if defined(ENABLE_EXTENSIONS) |
| 10 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/extensions/api/proxy/proxy_api.h" | 14 #include "chrome/browser/extensions/api/proxy/proxy_api.h" |
| 12 #include "chrome/browser/extensions/event_router_forwarder.h" | 15 #include "chrome/browser/extensions/event_router_forwarder.h" |
| 13 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
| 14 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
| 15 #include "content/public/browser/render_frame_host.h" | 18 #include "content/public/browser/render_frame_host.h" |
| 16 #include "content/public/browser/resource_request_info.h" | 19 #include "content/public/browser/resource_request_info.h" |
| 17 #include "extensions/browser/api/web_request/web_request_api.h" | 20 #include "extensions/browser/api/web_request/web_request_api.h" |
| 18 #include "extensions/browser/info_map.h" | 21 #include "extensions/browser/info_map.h" |
| 19 #include "extensions/browser/process_manager.h" | 22 #include "extensions/browser/process_manager.h" |
| 20 #include "net/url_request/url_request.h" | 23 #include "net/url_request/url_request.h" |
| 21 | 24 |
| 22 using content::BrowserThread; | 25 using content::BrowserThread; |
| 23 using content::ResourceRequestInfo; | 26 using content::ResourceRequestInfo; |
| 24 using extensions::ExtensionWebRequestEventRouter; | 27 using extensions::ExtensionWebRequestEventRouter; |
| 25 | 28 |
| 26 namespace { | 29 namespace { |
| 27 | 30 |
| 28 enum RequestStatus { REQUEST_STARTED, REQUEST_DONE }; | 31 enum RequestStatus { REQUEST_STARTED, REQUEST_DONE }; |
| 29 | 32 |
| 30 // Notifies the extensions::ProcessManager that a request has started or stopped | 33 // Notifies the extensions::ProcessManager that a request has started or stopped |
| 31 // for a particular RenderFrame. | 34 // for a particular RenderFrame. |
| 32 void NotifyEPMRequestStatus(RequestStatus status, | 35 void NotifyEPMRequestStatus(RequestStatus status, |
| 33 void* profile_id, | 36 void* profile_id, |
| 34 uint64 request_id, | 37 uint64_t request_id, |
| 35 int process_id, | 38 int process_id, |
| 36 int render_frame_id) { | 39 int render_frame_id) { |
| 37 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 40 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 38 if (!g_browser_process->profile_manager()->IsValidProfile(profile_id)) | 41 if (!g_browser_process->profile_manager()->IsValidProfile(profile_id)) |
| 39 return; | 42 return; |
| 40 Profile* profile = reinterpret_cast<Profile*>(profile_id); | 43 Profile* profile = reinterpret_cast<Profile*>(profile_id); |
| 41 | 44 |
| 42 extensions::ProcessManager* process_manager = | 45 extensions::ProcessManager* process_manager = |
| 43 extensions::ProcessManager::Get(profile); | 46 extensions::ProcessManager::Get(profile); |
| 44 DCHECK(process_manager); | 47 DCHECK(process_manager); |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 } | 349 } |
| 347 | 350 |
| 348 net::NetworkDelegate::AuthRequiredResponse | 351 net::NetworkDelegate::AuthRequiredResponse |
| 349 ChromeExtensionsNetworkDelegate::OnAuthRequired( | 352 ChromeExtensionsNetworkDelegate::OnAuthRequired( |
| 350 net::URLRequest* request, | 353 net::URLRequest* request, |
| 351 const net::AuthChallengeInfo& auth_info, | 354 const net::AuthChallengeInfo& auth_info, |
| 352 const AuthCallback& callback, | 355 const AuthCallback& callback, |
| 353 net::AuthCredentials* credentials) { | 356 net::AuthCredentials* credentials) { |
| 354 return net::NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION; | 357 return net::NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION; |
| 355 } | 358 } |
| OLD | NEW |