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

Side by Side Diff: ppapi/native_client/src/trusted/plugin/browser_interface.h

Issue 9390028: Remove browser support for non-PPAPI nexes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7
8 // Interface for browser interaction
9
10 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_BROWSER_INTERFACE_H_
11 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_BROWSER_INTERFACE_H_
12
13 #include <stdio.h>
14 #include <map>
15
16 #include "native_client/src/include/nacl_macros.h"
17 #include "native_client/src/include/nacl_string.h"
18 #include "native_client/src/include/portability.h"
19
20 namespace pp {
21 class InstancePrivate;
22 } // namespace
23
24 namespace plugin {
25
26 // BrowserInterface represents the interface to the browser from the plugin.
27 // I.e., when the plugin needs to request an alert, it uses these interfaces.
28 class BrowserInterface {
29 public:
30 BrowserInterface() : next_identifier(0) {}
31 ~BrowserInterface() { }
32
33 // Functions for communication with the browser.
34
35 // Convert a string to an identifier.
36 uintptr_t StringToIdentifier(const nacl::string& str);
37 // Convert an identifier to a string.
38 nacl::string IdentifierToString(uintptr_t ident);
39
40 // Write to the JavaScript console.
41 void AddToConsole(pp::InstancePrivate* instance, const nacl::string& text);
42
43 private:
44 NACL_DISALLOW_COPY_AND_ASSIGN(BrowserInterface);
45
46 // Map strings used for property and method names to unique ids and back.
47 typedef std::map<nacl::string, uintptr_t> StringToIdentifierMap;
48 typedef std::map<uintptr_t, nacl::string> IdentifierToStringMap;
49 StringToIdentifierMap string_to_identifier_map_;
50 IdentifierToStringMap identifier_to_string_map_;
51 uintptr_t next_identifier; // will be incremented once used
52 };
53
54 } // namespace plugin
55
56 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_BROWSER_INTERFACE_H_
OLDNEW
« no previous file with comments | « ppapi/native_client/src/trusted/plugin/array_ppapi.cc ('k') | ppapi/native_client/src/trusted/plugin/browser_interface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698