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

Side by Side 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: scoped_refptr not testable 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_
6 #define EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ 6 #define EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_
7 7
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 10
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 const std::string& name() const { return name_; } 211 const std::string& name() const { return name_; }
212 212
213 void set_profile_id(void* profile_id) { profile_id_ = profile_id; } 213 void set_profile_id(void* profile_id) { profile_id_ = profile_id; }
214 void* profile_id() const { return profile_id_; } 214 void* profile_id() const { return profile_id_; }
215 215
216 void set_extension( 216 void set_extension(
217 const scoped_refptr<const extensions::Extension>& extension) { 217 const scoped_refptr<const extensions::Extension>& extension) {
218 extension_ = extension; 218 extension_ = extension;
219 } 219 }
220 const extensions::Extension* extension() const { return extension_.get(); } 220 const extensions::Extension* extension() const { return extension_.get(); }
221 const std::string& extension_id() const { return extension_->id(); } 221 const std::string& extension_id() const {
222 DCHECK(extension())
223 << "extension_id() called without an Extension. If " << name()
224 << " is allowed to be called without any Extension then you should "
225 << "check extension() first. If not, there is a bug in the Extension "
226 << "platform, so page somebody in extensions/OWNERS";
227 return extension_->id();
228 }
222 229
223 void set_request_id(int request_id) { request_id_ = request_id; } 230 void set_request_id(int request_id) { request_id_ = request_id; }
224 int request_id() { return request_id_; } 231 int request_id() { return request_id_; }
225 232
226 void set_source_url(const GURL& source_url) { source_url_ = source_url; } 233 void set_source_url(const GURL& source_url) { source_url_ = source_url; }
227 const GURL& source_url() { return source_url_; } 234 const GURL& source_url() { return source_url_; }
228 235
229 void set_has_callback(bool has_callback) { has_callback_ = has_callback; } 236 void set_has_callback(bool has_callback) { has_callback_ = has_callback; }
230 bool has_callback() { return has_callback_; } 237 bool has_callback() { return has_callback_; }
231 238
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 virtual bool RunSync() = 0; 613 virtual bool RunSync() = 0;
607 614
608 // ValidationFailure override to match RunSync(). 615 // ValidationFailure override to match RunSync().
609 static bool ValidationFailure(SyncIOThreadExtensionFunction* function); 616 static bool ValidationFailure(SyncIOThreadExtensionFunction* function);
610 617
611 private: 618 private:
612 ResponseAction Run() override; 619 ResponseAction Run() override;
613 }; 620 };
614 621
615 #endif // EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ 622 #endif // EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_
OLDNEW
« no previous file with comments | « extensions/browser/api/web_request/web_request_api_helpers.cc ('k') | extensions/browser/extension_function_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698