| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |