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

Unified Diff: extensions/browser/extension_function.h

Issue 670173002: Fix webrequest api for webview in webui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename EmbedderDestroyed to EmbedderWillBeDestroyed Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/extension_function.h
diff --git a/extensions/browser/extension_function.h b/extensions/browser/extension_function.h
index f4ffaa273afe5e96007c9a93b7eed5444f87844a..2a933ab37e0e55ff7dd1b590a1a3c653a6624816 100644
--- a/extensions/browser/extension_function.h
+++ b/extensions/browser/extension_function.h
@@ -218,7 +218,14 @@ class ExtensionFunction
extension_ = extension;
}
const extensions::Extension* extension() const { return extension_.get(); }
- const std::string& extension_id() const { return extension_->id(); }
+ const std::string& extension_id() const {
+ DCHECK(extension())
+ << "extension_id() called without an Extension. If " << name()
+ << " is allowed to be called without any Extension then you should "
+ << "check extension() first. If not, there is a bug in the Extension "
+ << "platform, so page somebody in extensions/OWNERS";
+ return extension_->id();
+ }
void set_request_id(int request_id) { request_id_ = request_id; }
int request_id() { return request_id_; }

Powered by Google App Engine
This is Rietveld 408576698