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 CHROME_RENDERER_EXTENSIONS_PEPPER_REQUEST_NATIVES_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_PEPPER_REQUEST_NATIVES_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_PEPPER_REQUEST_NATIVES_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_PEPPER_REQUEST_NATIVES_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "extensions/renderer/object_backed_native_handler.h" | 9 #include "extensions/renderer/object_backed_native_handler.h" |
10 | 10 |
11 namespace base { | 11 namespace base { |
12 class Value; | 12 class Value; |
13 } | 13 } |
14 | 14 |
15 namespace extensions { | 15 namespace extensions { |
16 class ChromeV8Context; | |
17 | 16 |
18 // Custom bindings for handling API calls from pepper plugins. | 17 // Custom bindings for handling API calls from pepper plugins. |
19 class PepperRequestNatives : public ObjectBackedNativeHandler { | 18 class PepperRequestNatives : public ObjectBackedNativeHandler { |
20 public: | 19 public: |
21 explicit PepperRequestNatives(ChromeV8Context* context); | 20 explicit PepperRequestNatives(ScriptContext* context); |
22 | 21 |
23 private: | 22 private: |
24 // Sends a response to an API call to the pepper plugin which made the call. | 23 // Sends a response to an API call to the pepper plugin which made the call. |
25 // |args| should contain: | 24 // |args| should contain: |
26 // |request_id|: An int containing the id of the request. | 25 // |request_id|: An int containing the id of the request. |
27 // |response|: An array containing the response. | 26 // |response|: An array containing the response. |
28 // |error|: A string containing the error message if an error occurred or | 27 // |error|: A string containing the error message if an error occurred or |
29 // null if the call was successful. | 28 // null if the call was successful. |
30 void SendResponse(const v8::FunctionCallbackInfo<v8::Value>& args); | 29 void SendResponse(const v8::FunctionCallbackInfo<v8::Value>& args); |
31 | 30 |
32 DISALLOW_COPY_AND_ASSIGN(PepperRequestNatives); | 31 DISALLOW_COPY_AND_ASSIGN(PepperRequestNatives); |
33 }; | 32 }; |
34 | 33 |
35 } // namespace extensions | 34 } // namespace extensions |
36 | 35 |
37 #endif // CHROME_RENDERER_EXTENSIONS_PEPPER_REQUEST_NATIVES_H_ | 36 #endif // CHROME_RENDERER_EXTENSIONS_PEPPER_REQUEST_NATIVES_H_ |
OLD | NEW |