Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_api.h

Issue 212693002: Do not cancel request when an error occurs in a webRequest event handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/web_request/web_request_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/web_request/web_request_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698