| 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_EXTENSION_FUNCTION_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // Sets the function's error string. | 117 // Sets the function's error string. |
| 118 virtual void SetError(const std::string& error); | 118 virtual void SetError(const std::string& error); |
| 119 | 119 |
| 120 // Specifies the name of the function. | 120 // Specifies the name of the function. |
| 121 void set_name(const std::string& name) { name_ = name; } | 121 void set_name(const std::string& name) { name_ = name; } |
| 122 const std::string& name() const { return name_; } | 122 const std::string& name() const { return name_; } |
| 123 | 123 |
| 124 void set_profile_id(void* profile_id) { profile_id_ = profile_id; } | 124 void set_profile_id(void* profile_id) { profile_id_ = profile_id; } |
| 125 void* profile_id() const { return profile_id_; } | 125 void* profile_id() const { return profile_id_; } |
| 126 | 126 |
| 127 void set_extension(const Extension* extension) { extension_ = extension; } | 127 void set_extension(const extensions::Extension* extension) { |
| 128 const Extension* GetExtension() const { return extension_.get(); } | 128 extension_ = extension; |
| 129 } |
| 130 const extensions::Extension* GetExtension() const { return extension_.get(); } |
| 129 const std::string& extension_id() const { return extension_->id(); } | 131 const std::string& extension_id() const { return extension_->id(); } |
| 130 | 132 |
| 131 void set_request_id(int request_id) { request_id_ = request_id; } | 133 void set_request_id(int request_id) { request_id_ = request_id; } |
| 132 int request_id() { return request_id_; } | 134 int request_id() { return request_id_; } |
| 133 | 135 |
| 134 void set_source_url(const GURL& source_url) { source_url_ = source_url; } | 136 void set_source_url(const GURL& source_url) { source_url_ = source_url; } |
| 135 const GURL& source_url() { return source_url_; } | 137 const GURL& source_url() { return source_url_; } |
| 136 | 138 |
| 137 void set_has_callback(bool has_callback) { has_callback_ = has_callback; } | 139 void set_has_callback(bool has_callback) { has_callback_ = has_callback; } |
| 138 bool has_callback() { return has_callback_; } | 140 bool has_callback() { return has_callback_; } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // is non-null. | 176 // is non-null. |
| 175 bool HasOptionalArgument(size_t index); | 177 bool HasOptionalArgument(size_t index); |
| 176 | 178 |
| 177 // Id of this request, used to map the response back to the caller. | 179 // Id of this request, used to map the response back to the caller. |
| 178 int request_id_; | 180 int request_id_; |
| 179 | 181 |
| 180 // The Profile of this function's extension. | 182 // The Profile of this function's extension. |
| 181 void* profile_id_; | 183 void* profile_id_; |
| 182 | 184 |
| 183 // The extension that called this function. | 185 // The extension that called this function. |
| 184 scoped_refptr<const Extension> extension_; | 186 scoped_refptr<const extensions::Extension> extension_; |
| 185 | 187 |
| 186 // The name of this function. | 188 // The name of this function. |
| 187 std::string name_; | 189 std::string name_; |
| 188 | 190 |
| 189 // The URL of the frame which is making this request | 191 // The URL of the frame which is making this request |
| 190 GURL source_url_; | 192 GURL source_url_; |
| 191 | 193 |
| 192 // True if the js caller provides a callback function to receive the response | 194 // True if the js caller provides a callback function to receive the response |
| 193 // of this call. | 195 // of this call. |
| 194 bool has_callback_; | 196 bool has_callback_; |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 public: | 420 public: |
| 419 SyncIOThreadExtensionFunction(); | 421 SyncIOThreadExtensionFunction(); |
| 420 | 422 |
| 421 virtual void Run() OVERRIDE; | 423 virtual void Run() OVERRIDE; |
| 422 | 424 |
| 423 protected: | 425 protected: |
| 424 virtual ~SyncIOThreadExtensionFunction(); | 426 virtual ~SyncIOThreadExtensionFunction(); |
| 425 }; | 427 }; |
| 426 | 428 |
| 427 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ | 429 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ |
| OLD | NEW |