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 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 }; | 480 }; |
481 | 481 |
482 class WebRequestEventHandled : public SyncIOThreadExtensionFunction { | 482 class WebRequestEventHandled : public SyncIOThreadExtensionFunction { |
483 public: | 483 public: |
484 DECLARE_EXTENSION_FUNCTION("webRequestInternal.eventHandled", | 484 DECLARE_EXTENSION_FUNCTION("webRequestInternal.eventHandled", |
485 WEBREQUESTINTERNAL_EVENTHANDLED) | 485 WEBREQUESTINTERNAL_EVENTHANDLED) |
486 | 486 |
487 protected: | 487 protected: |
488 virtual ~WebRequestEventHandled() {} | 488 virtual ~WebRequestEventHandled() {} |
489 | 489 |
490 // Cancels and unblocks the network request, and sets error_ such that the | 490 // Unblocks the network request and sets |error_| such that the developer |
491 // developer console will show the respective error message. Use this function | 491 // console will show the respective error message. Use this function to handle |
492 // to handle incorrect requests from the extension that cannot be detected by | 492 // incorrect requests from the extension that cannot be detected by the schema |
493 // the schema validator. | 493 // validator. |
494 void CancelWithError( | 494 void RespondWithError( |
495 const std::string& event_name, | 495 const std::string& event_name, |
496 const std::string& sub_event_name, | 496 const std::string& sub_event_name, |
497 uint64 request_id, | 497 uint64 request_id, |
498 scoped_ptr<ExtensionWebRequestEventRouter::EventResponse> response, | 498 scoped_ptr<ExtensionWebRequestEventRouter::EventResponse> response, |
499 const std::string& error); | 499 const std::string& error); |
500 | 500 |
501 // ExtensionFunction: | 501 // ExtensionFunction: |
502 virtual bool RunImpl() OVERRIDE; | 502 virtual bool RunImpl() OVERRIDE; |
503 }; | 503 }; |
504 | 504 |
(...skipping 14 matching lines...) Expand all Loading... |
519 virtual void OnQuotaExceeded(const std::string& error) OVERRIDE; | 519 virtual void OnQuotaExceeded(const std::string& error) OVERRIDE; |
520 virtual bool RunImpl() OVERRIDE; | 520 virtual bool RunImpl() OVERRIDE; |
521 }; | 521 }; |
522 | 522 |
523 // Send updates to |host| with information about what webRequest-related | 523 // Send updates to |host| with information about what webRequest-related |
524 // extensions are installed. | 524 // extensions are installed. |
525 // TODO(mpcomplete): remove. http://crbug.com/100411 | 525 // TODO(mpcomplete): remove. http://crbug.com/100411 |
526 void SendExtensionWebRequestStatusToHost(content::RenderProcessHost* host); | 526 void SendExtensionWebRequestStatusToHost(content::RenderProcessHost* host); |
527 | 527 |
528 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ | 528 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ |
OLD | NEW |